From owner-svn-src-all@freebsd.org Sun Aug 12 00:00: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 294331056DF8; Sun, 12 Aug 2018 00:00:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D414196073; Sun, 12 Aug 2018 00:00:13 +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 B2B741E454; Sun, 12 Aug 2018 00:00:13 +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 w7C00DiU052033; Sun, 12 Aug 2018 00:00:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C00Dpq052032; Sun, 12 Aug 2018 00:00:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808120000.w7C00Dpq052032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 12 Aug 2018 00:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337664 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 337664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 00:00:14 -0000 Author: kevans Date: Sun Aug 12 00:00:13 2018 New Revision: 337664 URL: https://svnweb.freebsd.org/changeset/base/337664 Log: bectl(8): Rename "index" variable, which shadows a global in some lands Modified: head/sbin/bectl/bectl.c Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Sat Aug 11 23:50:09 2018 (r337663) +++ head/sbin/bectl/bectl.c Sun Aug 12 00:00:13 2018 (r337664) @@ -116,14 +116,14 @@ static struct command_map_entry command_map[] = }; static int -get_cmd_index(const char *cmd, int *index) +get_cmd_index(const char *cmd, int *idx) { int map_size; map_size = nitems(command_map); for (int i = 0; i < map_size; ++i) { if (strcmp(cmd, command_map[i].command) == 0) { - *index = i; + *idx = i; return (0); } } From owner-svn-src-all@freebsd.org Sun Aug 12 00:06:22 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 061F210571B1; Sun, 12 Aug 2018 00:06:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC9E296526; Sun, 12 Aug 2018 00:06:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CA651E5E4; Sun, 12 Aug 2018 00:06:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7C06LgR056714; Sun, 12 Aug 2018 00:06:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C06LJx056713; Sun, 12 Aug 2018 00:06:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808120006.w7C06LJx056713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 12 Aug 2018 00:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337665 - head/kerberos5/usr.bin/krb5-config X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/kerberos5/usr.bin/krb5-config X-SVN-Commit-Revision: 337665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 00:06:22 -0000 Author: kevans Date: Sun Aug 12 00:06:21 2018 New Revision: 337665 URL: https://svnweb.freebsd.org/changeset/base/337665 Log: krb5-config build: Remove gratuitous escaping MFC after: 1 week Modified: head/kerberos5/usr.bin/krb5-config/Makefile Modified: head/kerberos5/usr.bin/krb5-config/Makefile ============================================================================== --- head/kerberos5/usr.bin/krb5-config/Makefile Sun Aug 12 00:00:13 2018 (r337664) +++ head/kerberos5/usr.bin/krb5-config/Makefile Sun Aug 12 00:06:21 2018 (r337665) @@ -6,20 +6,20 @@ MAN= krb5-config.1 CLEANFILES= krb5-config krb5-config: krb5-config.in - sed -e "s,@PACKAGE\@,FreeBSD heimdal,g" \ - -e "s,@VERSION\@,1.1.0,g" \ - -e "s,@prefix\@,/usr,g" \ - -e "s,@exec_prefix\@,/usr,g" \ - -e "s,@libdir\@,${LIBDIR},g" \ - -e "s,@includedir\@,${INCLUDEDIR},g" \ - -e "s,@LIB_crypt\@,-lcrypt,g" \ - -e "s,@LIB_dbopen\@,,g" \ - -e "s,@LIB_hcrypto_appl\@,-lcrypto,g" \ - -e "s,@LIB_pkinit\@,-lhx509,g" \ - -e "s,@LIB_dlopen\@,,g" \ - -e "s,@LIB_door_create\@,,g" \ - -e "s,@PTHREAD_LIBADD\@,-pthread,g" \ - -e "s,@LIBS\@,,g" \ + sed -e "s,@PACKAGE@,FreeBSD heimdal,g" \ + -e "s,@VERSION@,1.1.0,g" \ + -e "s,@prefix@,/usr,g" \ + -e "s,@exec_prefix@,/usr,g" \ + -e "s,@libdir@,${LIBDIR},g" \ + -e "s,@includedir@,${INCLUDEDIR},g" \ + -e "s,@LIB_crypt@,-lcrypt,g" \ + -e "s,@LIB_dbopen@,,g" \ + -e "s,@LIB_hcrypto_appl@,-lcrypto,g" \ + -e "s,@LIB_pkinit@,-lhx509,g" \ + -e "s,@LIB_dlopen@,,g" \ + -e "s,@LIB_door_create@,,g" \ + -e "s,@PTHREAD_LIBADD@,-pthread,g" \ + -e "s,@LIBS@,,g" \ -e "s,@INCLUDE_hcrypto@,,g" \ ${.ALLSRC} > ${.TARGET} From owner-svn-src-all@freebsd.org Sun Aug 12 00:08: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 18CAD1057287; Sun, 12 Aug 2018 00:08:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C06969668E; Sun, 12 Aug 2018 00:08:14 +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 9D4071E5E5; Sun, 12 Aug 2018 00:08:14 +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 w7C08EiC056849; Sun, 12 Aug 2018 00:08:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C08ECi056848; Sun, 12 Aug 2018 00:08:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808120008.w7C08ECi056848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 12 Aug 2018 00:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337666 - 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: 337666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 00:08:15 -0000 Author: kevans Date: Sun Aug 12 00:08:14 2018 New Revision: 337666 URL: https://svnweb.freebsd.org/changeset/base/337666 Log: getopt_long(3): Document behavior of leading characters in optstring Leading '+', '-', and ':' in optstring have special meaning. We briefly mention that the first two have special meaning in that we say POSIXLY_CORRECT turns them off, but we don't actually document their meaning. Add a paragraph to RETURN VALUES explaining how they control the treatment of non-option arguments. A leading ':' has no mention; add a note that it suppresses warnings about missing arguments. Reviewed by: jilles MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14142 Modified: head/lib/libc/stdlib/getopt_long.3 Modified: head/lib/libc/stdlib/getopt_long.3 ============================================================================== --- head/lib/libc/stdlib/getopt_long.3 Sun Aug 12 00:06:21 2018 (r337665) +++ head/lib/libc/stdlib/getopt_long.3 Sun Aug 12 00:08:14 2018 (r337666) @@ -31,7 +31,7 @@ .\" @(#)getopt.3 8.5 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd December 25, 2011 +.Dd May 2, 2018 .Dt GETOPT_LONG 3 .Os .Sh NAME @@ -207,12 +207,53 @@ these functions return 0 and store .Fa val in the location pointed to by .Fa flag . +.Pp These functions return .Ql \&: -if there was a missing option argument, +if there was a missing option argument and error messages are suppressed, .Ql \&? if the user specified an unknown or ambiguous option, and \-1 when the argument list has been exhausted. +The default behavior when a missing option argument is encountered is to write +an error and return +.Ql \&? . +Specifying +.Ql \&: +in +.Fa optstr +will cause the error message to be suppressed and +.Ql \&: +to be returned instead. +.Pp +In addition to +.Ql \&: , +a leading +.Ql \&+ +or +.Ql \&- +in +.Fa optstr +also has special meaning. +If either of these are specified, they must appear before +.Ql \&: . +.Pp +A leading +.Ql \&+ +indicates that processing should be halted at the first non-option argument, +matching the default behavior of +.Xr getopt 3 . +The default behavior without +.Ql \&+ +is to permute non-option argments to the end of +.Fa argv . +.Pp +A leading +.Ql \&- +indicates that all non-option arguments should be treated as if they are +arguments to a literal +.Ql \&1 +flag (i.e., the function call will return the value 1, rather than the char +literal '1'). .Sh ENVIRONMENT .Bl -tag -width ".Ev POSIXLY_CORRECT" .It Ev POSIXLY_CORRECT From owner-svn-src-all@freebsd.org Sun Aug 12 00:09: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 374B91057396; Sun, 12 Aug 2018 00:09:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7E689684B; Sun, 12 Aug 2018 00:09:52 +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 B39CF1E5FB; Sun, 12 Aug 2018 00:09:52 +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 w7C09qdQ056956; Sun, 12 Aug 2018 00:09:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C09qeK056955; Sun, 12 Aug 2018 00:09:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808120009.w7C09qeK056955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 12 Aug 2018 00:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337667 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 337667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 00:09:53 -0000 Author: kevans Date: Sun Aug 12 00:09:52 2018 New Revision: 337667 URL: https://svnweb.freebsd.org/changeset/base/337667 Log: bectl(8): Use strcmp, rather than trying to directly compare Modified: head/sbin/bectl/bectl_list.c Modified: head/sbin/bectl/bectl_list.c ============================================================================== --- head/sbin/bectl/bectl_list.c Sun Aug 12 00:08:14 2018 (r337666) +++ head/sbin/bectl/bectl_list.c Sun Aug 12 00:09:52 2018 (r337667) @@ -320,7 +320,7 @@ print_headers(nvlist_t *props, struct printc *pc) * will produce quite a bit of input. Throw an extra blank line after * the header to make it look nicer. */ - if (chosen_be_header != HEADER_BE) + if (strcmp(chosen_be_header, HEADER_BE) != 0) printf("\n"); } From owner-svn-src-all@freebsd.org Sun Aug 12 00:33:26 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 F12791057E78; Sun, 12 Aug 2018 00:33:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93D74973A2; Sun, 12 Aug 2018 00:33: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 6F50B1EAC9; Sun, 12 Aug 2018 00:33: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 w7C0XPTe072039; Sun, 12 Aug 2018 00:33:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C0XOEj072036; Sun, 12 Aug 2018 00:33:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808120033.w7C0XOEj072036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 12 Aug 2018 00:33: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: r337668 - in stable/11/sys: amd64/amd64 dev/efidev sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 dev/efidev sys X-SVN-Commit-Revision: 337668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 00:33:26 -0000 Author: kevans Date: Sun Aug 12 00:33:24 2018 New Revision: 337668 URL: https://svnweb.freebsd.org/changeset/base/337668 Log: MFC r337331: efirt: Don't enter EFI context early, convert addrs to KVA efi_enter here was needed because efi_runtime dereference causes a fault outside of EFI context, due to runtime table living in runtime service space. This may cause problems early in boot, though, so instead access it by converting paddr to KVA for access. While here, remove the other direct PHYS_TO_DMAP calls and the explicit DMAP requirement from efidev. Modified: stable/11/sys/amd64/amd64/efirt_machdep.c stable/11/sys/dev/efidev/efirt.c stable/11/sys/sys/efi.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/efirt_machdep.c Sun Aug 12 00:09:52 2018 (r337667) +++ stable/11/sys/amd64/amd64/efirt_machdep.c Sun Aug 12 00:33:24 2018 (r337668) @@ -85,6 +85,19 @@ efi_destroy_1t1_map(void) efi_pml4_page = NULL; } +/* + * Map a physical address from EFI runtime space into KVA space. Returns 0 to + * indicate a failed mapping so that the caller may handle error. + */ +vm_offset_t +efi_phys_to_kva(vm_paddr_t paddr) +{ + + if (paddr >= dmaplimit) + return (0); + return (PHYS_TO_DMAP(paddr)); +} + static vm_page_t efi_1t1_page(void) { Modified: stable/11/sys/dev/efidev/efirt.c ============================================================================== --- stable/11/sys/dev/efidev/efirt.c Sun Aug 12 00:09:52 2018 (r337667) +++ stable/11/sys/dev/efidev/efirt.c Sun Aug 12 00:33:24 2018 (r337668) @@ -131,9 +131,10 @@ efi_init(void) { struct efi_map_header *efihdr; struct efi_md *map; + struct efi_rt *rtdm; caddr_t kmdp; size_t efisz; - int rt_disabled; + int ndesc, rt_disabled; rt_disabled = 0; TUNABLE_INT_FETCH("efi.rt.disabled", &rt_disabled); @@ -146,8 +147,9 @@ efi_init(void) printf("EFI systbl not available\n"); return (0); } - efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); - if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { + + efi_systbl = (struct efi_systbl *)efi_phys_to_kva(efi_systbl_phys); + if (efi_systbl == NULL || efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { efi_systbl = NULL; if (bootverbose) printf("EFI systbl signature invalid\n"); @@ -175,8 +177,8 @@ efi_init(void) if (efihdr->descriptor_size == 0) return (ENOMEM); - if (!efi_create_1t1_map(map, efihdr->memory_size / - efihdr->descriptor_size, efihdr->descriptor_size)) { + ndesc = efihdr->memory_size / efihdr->descriptor_size; + if (!efi_create_1t1_map(map, ndesc, efihdr->descriptor_size)) { if (bootverbose) printf("EFI cannot create runtime map\n"); return (ENOMEM); @@ -191,6 +193,7 @@ efi_init(void) return (ENXIO); } +#if defined(__aarch64__) || defined(__amd64__) /* * Some UEFI implementations have multiple implementations of the * RS->GetTime function. They switch from one we can only use early @@ -198,14 +201,10 @@ efi_init(void) * call RS->SetVirtualAddressMap. As this is not always the case, e.g. * with an old loader.efi, check if the RS->GetTime function is within * the EFI map, and fail to attach if not. - * - * We need to enter into the EFI environment as efi_runtime may point - * to an EFI address. */ - efi_enter(); - if (!efi_is_in_map(map, efihdr->memory_size / efihdr->descriptor_size, - efihdr->descriptor_size, (vm_offset_t)efi_runtime->rt_gettime)) { - efi_leave(); + rtdm = (struct efi_rt *)efi_phys_to_kva((uintptr_t)efi_runtime); + if (rtdm == NULL || !efi_is_in_map(map, ndesc, efihdr->descriptor_size, + (vm_offset_t)rtdm->rt_gettime)) { if (bootverbose) printf( "EFI runtime services table has an invalid pointer\n"); @@ -213,7 +212,7 @@ efi_init(void) efi_destroy_1t1_map(); return (ENXIO); } - efi_leave(); +#endif return (0); } @@ -292,7 +291,7 @@ efi_get_table(struct uuid *uuid, void **ptr) ct = efi_cfgtbl; while (count--) { if (!bcmp(&ct->ct_uuid, uuid, sizeof(*uuid))) { - *ptr = (void *)PHYS_TO_DMAP(ct->ct_data); + *ptr = (void *)efi_phys_to_kva(ct->ct_data); return (0); } ct++; Modified: stable/11/sys/sys/efi.h ============================================================================== --- stable/11/sys/sys/efi.h Sun Aug 12 00:09:52 2018 (r337667) +++ stable/11/sys/sys/efi.h Sun Aug 12 00:33:24 2018 (r337668) @@ -172,6 +172,7 @@ extern vm_paddr_t efi_systbl_phys; /* Internal MD EFI functions */ int efi_arch_enter(void); void efi_arch_leave(void); +vm_offset_t efi_phys_to_kva(vm_paddr_t); bool efi_create_1t1_map(struct efi_md *, int, int); void efi_destroy_1t1_map(void); From owner-svn-src-all@freebsd.org Sun Aug 12 00:45: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 F0BDE10582F6; Sun, 12 Aug 2018 00:45:56 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9065497815; Sun, 12 Aug 2018 00:45:56 +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 518351EC60; Sun, 12 Aug 2018 00:45:56 +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 w7C0junO077227; Sun, 12 Aug 2018 00:45:56 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C0jsYR077215; Sun, 12 Aug 2018 00:45:54 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808120045.w7C0jsYR077215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 12 Aug 2018 00:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337669 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/ztest cddl/usr.bin/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/ztest cddl/usr.bin/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/... X-SVN-Commit-Revision: 337669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 00:45:57 -0000 Author: mmacy Date: Sun Aug 12 00:45:53 2018 New Revision: 337669 URL: https://svnweb.freebsd.org/changeset/base/337669 Log: MFV/ZoL: Implement large_dnode pool feature commit 50c957f702ea6d08a634e42f73e8a49931dd8055 Author: Ned Bass Date: Wed Mar 16 18:25:34 2016 -0700 Implement large_dnode pool feature Justification ------------- This feature adds support for variable length dnodes. Our motivation is to eliminate the overhead associated with using spill blocks. Spill blocks are used to store system attribute data (i.e. file metadata) that does not fit in the dnode's bonus buffer. By allowing a larger bonus buffer area the use of a spill block can be avoided. Spill blocks potentially incur an additional read I/O for every dnode in a dnode block. As a worst case example, reading 32 dnodes from a 16k dnode block and all of the spill blocks could issue 33 separate reads. Now suppose those dnodes have size 1024 and therefore don't need spill blocks. Then the worst case number of blocks read is reduced to from 33 to two--one per dnode block. In practice spill blocks may tend to be co-located on disk with the dnode blocks so the reduction in I/O would not be this drastic. In a badly fragmented pool, however, the improvement could be significant. ZFS-on-Linux systems that make heavy use of extended attributes would benefit from this feature. In particular, ZFS-on-Linux supports the xattr=sa dataset property which allows file extended attribute data to be stored in the dnode bonus buffer as an alternative to the traditional directory-based format. Workloads such as SELinux and the Lustre distributed filesystem often store enough xattr data to force spill bocks when xattr=sa is in effect. Large dnodes may therefore provide a performance benefit to such systems. Other use cases that may benefit from this feature include files with large ACLs and symbolic links with long target names. Furthermore, this feature may be desirable on other platforms in case future applications or features are developed that could make use of a larger bonus buffer area. Implementation -------------- The size of a dnode may be a multiple of 512 bytes up to the size of a dnode block (currently 16384 bytes). A dn_extra_slots field was added to the current on-disk dnode_phys_t structure to describe the size of the physical dnode on disk. The 8 bits for this field were taken from the zero filled dn_pad2 field. The field represents how many "extra" dnode_phys_t slots a dnode consumes in its dnode block. This convention results in a value of 0 for 512 byte dnodes which preserves on-disk format compatibility with older software. Similarly, the in-memory dnode_t structure has a new dn_num_slots field to represent the total number of dnode_phys_t slots consumed on disk. Thus dn->dn_num_slots is 1 greater than the corresponding dnp->dn_extra_slots. This difference in convention was adopted because, unlike on-disk structures, backward compatibility is not a concern for in-memory objects, so we used a more natural way to represent size for a dnode_t. The default size for newly created dnodes is determined by the value of a new "dnodesize" dataset property. By default the property is set to "legacy" which is compatible with older software. Setting the property to "auto" will allow the filesystem to choose the most suitable dnode size. Currently this just sets the default dnode size to 1k, but future code improvements could dynamically choose a size based on observed workload patterns. Dnodes of varying sizes can coexist within the same dataset and even within the same dnode block. For example, to enable automatically-sized dnodes, run # zfs set dnodesize=auto tank/fish The user can also specify literal values for the dnodesize property. These are currently limited to powers of two from 1k to 16k. The power-of-2 limitation is only for simplicity of the user interface. Internally the implementation can handle any multiple of 512 up to 16k, and consumers of the DMU API can specify any legal dnode value. The size of a new dnode is determined at object allocation time and stored as a new field in the znode in-memory structure. New DMU interfaces are added to allow the consumer to specify the dnode size that a newly allocated object should use. Existing interfaces are unchanged to avoid having to update every call site and to preserve compatibility with external consumers such as Lustre. The new interfaces names are given below. The versions of these functions that don't take a dnodesize parameter now just call the _dnsize() versions with a dnodesize of 0, which means use the legacy dnode size. New DMU interfaces: dmu_object_alloc_dnsize() dmu_object_claim_dnsize() dmu_object_reclaim_dnsize() New ZAP interfaces: zap_create_dnsize() zap_create_norm_dnsize() zap_create_flags_dnsize() zap_create_claim_norm_dnsize() zap_create_link_dnsize() The constant DN_MAX_BONUSLEN is renamed to DN_OLD_MAX_BONUSLEN. The spa_maxdnodesize() function should be used to determine the maximum bonus length for a pool. These are a few noteworthy changes to key functions: * The prototype for dnode_hold_impl() now takes a "slots" parameter. When the DNODE_MUST_BE_FREE flag is set, this parameter is used to ensure the hole at the specified object offset is large enough to hold the dnode being created. The slots parameter is also used to ensure a dnode does not span multiple dnode blocks. In both of these cases, if a failure occurs, ENOSPC is returned. Keep in mind, these failure cases are only possible when using DNODE_MUST_BE_FREE. If the DNODE_MUST_BE_ALLOCATED flag is set, "slots" must be 0. dnode_hold_impl() will check if the requested dnode is already consumed as an extra dnode slot by an large dnode, in which case it returns ENOENT. * The function dmu_object_alloc() advances to the next dnode block if dnode_hold_impl() returns an error for a requested object. This is because the beginning of the next dnode block is the only location it can safely assume to either be a hole or a valid starting point for a dnode. * dnode_next_offset_level() and other functions that iterate through dnode blocks may no longer use a simple array indexing scheme. These now use the current dnode's dn_num_slots field to advance to the next dnode in the block. This is to ensure we properly skip the current dnode's bonus area and don't interpret it as a valid dnode. zdb --- The zdb command was updated to display a dnode's size under the "dnsize" column when the object is dumped. For ZIL create log records, zdb will now display the slot count for the object. ztest ----- Ztest chooses a random dnodesize for every newly created object. The random distribution is more heavily weighted toward small dnodes to better simulate real-world datasets. Unused bonus buffer space is filled with non-zero values computed from the object number, dataset id, offset, and generation number. This helps ensure that the dnode traversal code properly skips the interior regions of large dnodes, and that these interior regions are not overwritten by data belonging to other dnodes. A new test visits each object in a dataset. It verifies that the actual dnode size matches what was stored in the ztest block tag when it was created. It also verifies that the unused bonus buffer space is filled with the expected data patterns. ZFS Test Suite -------------- Added six new large dnode-specific tests, and integrated the dnodesize property into existing tests for zfs allow and send/recv. Send/Receive ------------ ZFS send streams for datasets containing large dnodes cannot be received on pools that don't support the large_dnode feature. A send stream with large dnodes sets a DMU_BACKUP_FEATURE_LARGE_DNODE flag which will be unrecognized by an incompatible receiving pool so that the zfs receive will fail gracefully. While not implemented here, it may be possible to generate a backward-compatible send stream from a dataset containing large dnodes. The implementation may be tricky, however, because the send object record for a large dnode would need to be resized to a 512 byte dnode, possibly kicking in a spill block in the process. This means we would need to construct a new SA layout and possibly register it in the SA layout object. The SA layout is normally just sent as an ordinary object record. But if we are constructing new layouts while generating the send stream we'd have to build the SA layout object dynamically and send it at the end of the stream. For sending and receiving between pools that do support large dnodes, the drr_object send record type is extended with a new field to store the dnode slot count. This field was repurposed from unused padding in the structure. ZIL Replay ---------- The dnode slot count is stored in the uppermost 8 bits of the lr_foid field. The bits were unused as the object id is currently capped at 48 bits. Resizing Dnodes --------------- It should be possible to resize a dnode when it is dirtied if the current dnodesize dataset property differs from the dnode's size, but this functionality is not currently implemented. Clearly a dnode can only grow if there are sufficient contiguous unused slots in the dnode block, but it should always be possible to shrink a dnode. Growing dnodes may be useful to reduce fragmentation in a pool with many spill blocks in use. Shrinking dnodes may be useful to allow sending a dataset to a pool that doesn't support the large_dnode feature. Feature Reference Counting -------------------------- The reference count for the large_dnode pool feature tracks the number of datasets that have ever contained a dnode of size larger than 512 bytes. The first time a large dnode is created in a dataset the dataset is converted to an extensible dataset. This is a one-way operation and the only way to decrement the feature count is to destroy the dataset, even if the dataset no longer contains any large dnodes. The complexity of reference counting on a per-dnode basis was too high, so we chose to track it on a per-dataset basis similarly to the large_block feature. Signed-off-by: Ned Bass Signed-off-by: Brian Behlendorf Closes #3542 Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/usr.bin/ztest/Makefile head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Aug 12 00:33:24 2018 (r337668) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Aug 12 00:45:53 2018 (r337669) @@ -2096,7 +2096,7 @@ dump_object(objset_t *os, uint64_t object, int verbosi dnode_t *dn; void *bonus = NULL; size_t bsize = 0; - char iblk[32], dblk[32], lsize[32], asize[32], fill[32]; + char iblk[32], dblk[32], lsize[32], asize[32], fill[32], dnsize[32]; char bonus_size[32]; char aux[50]; int error; @@ -2109,9 +2109,9 @@ dump_object(objset_t *os, uint64_t object, int verbosi CTASSERT(sizeof (bonus_size) >= NN_NUMBUF_SZ); if (*print_header) { - (void) printf("\n%10s %3s %5s %5s %5s %5s %6s %s\n", - "Object", "lvl", "iblk", "dblk", "dsize", "lsize", - "%full", "type"); + (void) printf("\n%10s %3s %5s %5s %5s %6s %5s %6s %s\n", + "Object", "lvl", "iblk", "dblk", "dsize", "dnsize", + "lsize", "%full", "type"); *print_header = 0; } @@ -2133,6 +2133,7 @@ dump_object(objset_t *os, uint64_t object, int verbosi zdb_nicenum(doi.doi_max_offset, lsize, sizeof (lsize)); zdb_nicenum(doi.doi_physical_blocks_512 << 9, asize, sizeof (asize)); zdb_nicenum(doi.doi_bonus_size, bonus_size, sizeof (bonus_size)); + zdb_nicenum(doi.doi_dnodesize, dnsize, sizeof (dnsize)); (void) sprintf(fill, "%6.2f", 100.0 * doi.doi_fill_count * doi.doi_data_block_size / (object == 0 ? DNODES_PER_BLOCK : 1) / doi.doi_max_offset); @@ -2149,13 +2150,13 @@ dump_object(objset_t *os, uint64_t object, int verbosi ZDB_COMPRESS_NAME(doi.doi_compress)); } - (void) printf("%10lld %3u %5s %5s %5s %5s %6s %s%s\n", + (void) printf("%10lld %3u %5s %5s %5s %6s %5s %6s %s%s\n", (u_longlong_t)object, doi.doi_indirection, iblk, dblk, - asize, lsize, fill, ZDB_OT_NAME(doi.doi_type), aux); + asize, dnsize, lsize, fill, ZDB_OT_NAME(doi.doi_type), aux); if (doi.doi_bonus_type != DMU_OT_NONE && verbosity > 3) { - (void) printf("%10s %3s %5s %5s %5s %5s %6s %s\n", - "", "", "", "", "", bonus_size, "bonus", + (void) printf("%10s %3s %5s %5s %5s %5s %5s %6s %s\n", + "", "", "", "", "", "", bonus_size, "bonus", ZDB_OT_NAME(doi.doi_bonus_type)); } Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Sun Aug 12 00:33:24 2018 (r337668) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Sun Aug 12 00:45:53 2018 (r337669) @@ -84,8 +84,10 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, void *a } (void) printf("%s%s", tab_prefix, ctime(&crtime)); - (void) printf("%sdoid %llu, foid %llu, mode %llo\n", tab_prefix, - (u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_foid, + (void) printf("%sdoid %llu, foid %llu, slots %llu, mode %llo\n", tab_prefix, + (u_longlong_t)lr->lr_doid, + (u_longlong_t)LR_FOID_GET_OBJ(lr->lr_foid), + (u_longlong_t)LR_FOID_GET_SLOTS(lr->lr_foid), (longlong_t)lr->lr_mode); (void) printf("%suid %llu, gid %llu, gen %llu, rdev 0x%llx\n", tab_prefix, Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun Aug 12 00:33:24 2018 (r337668) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun Aug 12 00:45:53 2018 (r337669) @@ -226,6 +226,7 @@ typedef struct ztest_block_tag { uint64_t bt_magic; uint64_t bt_objset; uint64_t bt_object; + uint64_t bt_dnodesize; uint64_t bt_offset; uint64_t bt_gen; uint64_t bt_txg; @@ -274,6 +275,7 @@ typedef struct ztest_od { dmu_object_type_t od_crtype; uint64_t od_blocksize; uint64_t od_crblocksize; + uint64_t od_crdnodesize; uint64_t od_gen; uint64_t od_crgen; char od_name[ZFS_MAX_DATASET_NAME_LEN]; @@ -350,6 +352,7 @@ ztest_func_t ztest_device_removal; ztest_func_t ztest_remap_blocks; ztest_func_t ztest_spa_checkpoint_create_discard; ztest_func_t ztest_initialize; +ztest_func_t ztest_verify_dnode_bt; uint64_t zopt_always = 0ULL * NANOSEC; /* all the time */ uint64_t zopt_incessant = 1ULL * NANOSEC / 10; /* every 1/10 second */ @@ -394,7 +397,8 @@ ztest_info_t ztest_info[] = { { ztest_device_removal, 1, &zopt_sometimes }, { ztest_remap_blocks, 1, &zopt_sometimes }, { ztest_spa_checkpoint_create_discard, 1, &zopt_rarely }, - { ztest_initialize, 1, &zopt_sometimes } + { ztest_initialize, 1, &zopt_sometimes }, + { ztest_verify_dnode_bt, 1, &zopt_sometimes } }; #define ZTEST_FUNCS (sizeof (ztest_info) / sizeof (ztest_info_t)) @@ -440,8 +444,8 @@ static spa_t *ztest_spa = NULL; static ztest_ds_t *ztest_ds; static kmutex_t ztest_vdev_lock; -static kmutex_t ztest_checkpoint_lock; static boolean_t ztest_device_removal_active = B_FALSE; +static kmutex_t ztest_checkpoint_lock; /* * The ztest_name_lock protects the pool and dataset namespace used by @@ -1011,6 +1015,36 @@ ztest_random_blocksize(void) } static int +ztest_random_dnodesize(void) +{ + int slots; + int max_slots = spa_maxdnodesize(ztest_spa) >> DNODE_SHIFT; + + if (max_slots == DNODE_MIN_SLOTS) + return (DNODE_MIN_SIZE); + + /* + * Weight the random distribution more heavily toward smaller + * dnode sizes since that is more likely to reflect real-world + * usage. + */ + ASSERT3U(max_slots, >, 4); + switch (ztest_random(10)) { + case 0: + slots = 5 + ztest_random(max_slots - 4); + break; + case 1 ... 4: + slots = 2 + ztest_random(3); + break; + default: + slots = 1; + break; + } + + return (slots << DNODE_SHIFT); +} + +static int ztest_random_ibshift(void) { return (DN_MIN_INDBLKSHIFT + @@ -1287,11 +1321,13 @@ ztest_pattern_match(void *buf, uint64_t size, uint64_t static void ztest_bt_generate(ztest_block_tag_t *bt, objset_t *os, uint64_t object, - uint64_t offset, uint64_t gen, uint64_t txg, uint64_t crtxg) + uint64_t dnodesize, uint64_t offset, uint64_t gen, uint64_t txg, + uint64_t crtxg) { bt->bt_magic = BT_MAGIC; bt->bt_objset = dmu_objset_id(os); bt->bt_object = object; + bt->bt_dnodesize = dnodesize; bt->bt_offset = offset; bt->bt_gen = gen; bt->bt_txg = txg; @@ -1300,11 +1336,13 @@ ztest_bt_generate(ztest_block_tag_t *bt, objset_t *os, static void ztest_bt_verify(ztest_block_tag_t *bt, objset_t *os, uint64_t object, - uint64_t offset, uint64_t gen, uint64_t txg, uint64_t crtxg) + uint64_t dnodesize, uint64_t offset, uint64_t gen, uint64_t txg, + uint64_t crtxg) { ASSERT3U(bt->bt_magic, ==, BT_MAGIC); ASSERT3U(bt->bt_objset, ==, dmu_objset_id(os)); ASSERT3U(bt->bt_object, ==, object); + ASSERT3U(bt->bt_dnodesize, ==, dnodesize); ASSERT3U(bt->bt_offset, ==, offset); ASSERT3U(bt->bt_gen, <=, gen); ASSERT3U(bt->bt_txg, <=, txg); @@ -1326,6 +1364,52 @@ ztest_bt_bonus(dmu_buf_t *db) } /* + * Generate a token to fill up unused bonus buffer space. Try to make + * it unique to the object, generation, and offset to verify that data + * is not getting overwritten by data from other dnodes. + */ +#define ZTEST_BONUS_FILL_TOKEN(obj, ds, gen, offset) \ + (((ds) << 48) | ((gen) << 32) | ((obj) << 8) | (offset)) + +/* + * Fill up the unused bonus buffer region before the block tag with a + * verifiable pattern. Filling the whole bonus area with non-zero data + * helps ensure that all dnode traversal code properly skips the + * interior regions of large dnodes. + */ +void +ztest_fill_unused_bonus(dmu_buf_t *db, void *end, uint64_t obj, + objset_t *os, uint64_t gen) +{ + uint64_t *bonusp; + + ASSERT(IS_P2ALIGNED((char *)end - (char *)db->db_data, 8)); + + for (bonusp = db->db_data; bonusp < (uint64_t *)end; bonusp++) { + uint64_t token = ZTEST_BONUS_FILL_TOKEN(obj, dmu_objset_id(os), + gen, bonusp - (uint64_t *)db->db_data); + *bonusp = token; + } +} + +/* + * Verify that the unused area of a bonus buffer is filled with the + * expected tokens. + */ +void +ztest_verify_unused_bonus(dmu_buf_t *db, void *end, uint64_t obj, + objset_t *os, uint64_t gen) +{ + uint64_t *bonusp; + + for (bonusp = db->db_data; bonusp < (uint64_t *)end; bonusp++) { + uint64_t token = ZTEST_BONUS_FILL_TOKEN(obj, dmu_objset_id(os), + gen, bonusp - (uint64_t *)db->db_data); + VERIFY3U(*bonusp, ==, token); + } +} + +/* * ZIL logging ops */ @@ -1333,7 +1417,7 @@ ztest_bt_bonus(dmu_buf_t *db) #define lrz_blocksize lr_uid #define lrz_ibshift lr_gid #define lrz_bonustype lr_rdev -#define lrz_bonuslen lr_crtime[1] +#define lrz_dnodesize lr_crtime[1] static void ztest_log_create(ztest_ds_t *zd, dmu_tx_t *tx, lr_create_t *lr) @@ -1449,6 +1533,7 @@ ztest_replay_create(void *arg1, void *arg2, boolean_t dmu_tx_t *tx; uint64_t txg; int error = 0; + int bonuslen; if (byteswap) byteswap_uint64_array(lr, sizeof (*lr)); @@ -1471,26 +1556,27 @@ ztest_replay_create(void *arg1, void *arg2, boolean_t return (ENOSPC); ASSERT(dmu_objset_zil(os)->zl_replay == !!lr->lr_foid); + bonuslen = DN_BONUS_SIZE(lr->lrz_dnodesize); if (lr->lrz_type == DMU_OT_ZAP_OTHER) { if (lr->lr_foid == 0) { - lr->lr_foid = zap_create(os, + lr->lr_foid = zap_create_dnsize(os, lr->lrz_type, lr->lrz_bonustype, - lr->lrz_bonuslen, tx); + bonuslen, lr->lrz_dnodesize, tx); } else { - error = zap_create_claim(os, lr->lr_foid, + error = zap_create_claim_dnsize(os, lr->lr_foid, lr->lrz_type, lr->lrz_bonustype, - lr->lrz_bonuslen, tx); + bonuslen, lr->lrz_dnodesize, tx); } } else { if (lr->lr_foid == 0) { - lr->lr_foid = dmu_object_alloc(os, + lr->lr_foid = dmu_object_alloc_dnsize(os, lr->lrz_type, 0, lr->lrz_bonustype, - lr->lrz_bonuslen, tx); + bonuslen, lr->lrz_dnodesize, tx); } else { - error = dmu_object_claim(os, lr->lr_foid, + error = dmu_object_claim_dnsize(os, lr->lr_foid, lr->lrz_type, 0, lr->lrz_bonustype, - lr->lrz_bonuslen, tx); + bonuslen, lr->lrz_dnodesize, tx); } } @@ -1510,7 +1596,9 @@ ztest_replay_create(void *arg1, void *arg2, boolean_t VERIFY3U(0, ==, dmu_bonus_hold(os, lr->lr_foid, FTAG, &db)); bbt = ztest_bt_bonus(db); dmu_buf_will_dirty(db, tx); - ztest_bt_generate(bbt, os, lr->lr_foid, -1ULL, lr->lr_gen, txg, txg); + ztest_bt_generate(bbt, os, lr->lr_foid, lr->lrz_dnodesize, -1ULL, + lr->lr_gen, txg, txg); + ztest_fill_unused_bonus(db, bbt, lr->lr_foid, os, lr->lr_gen); dmu_buf_rele(db, FTAG); VERIFY3U(0, ==, zap_add(os, lr->lr_doid, name, sizeof (uint64_t), 1, @@ -1660,7 +1748,7 @@ ztest_replay_write(void *arg1, void *arg2, boolean_t b VERIFY(dmu_read(os, lr->lr_foid, offset, sizeof (rbt), &rbt, prefetch) == 0); if (rbt.bt_magic == BT_MAGIC) { - ztest_bt_verify(&rbt, os, lr->lr_foid, + ztest_bt_verify(&rbt, os, lr->lr_foid, 0, offset, gen, txg, crtxg); } } @@ -1672,7 +1760,7 @@ ztest_replay_write(void *arg1, void *arg2, boolean_t b * as it was when the write was generated. */ if (zd->zd_zilog->zl_replay) { - ztest_bt_verify(bt, os, lr->lr_foid, offset, + ztest_bt_verify(bt, os, lr->lr_foid, 0, offset, MAX(gen, bt->bt_gen), MAX(txg, lrtxg), bt->bt_crtxg); } @@ -1681,7 +1769,8 @@ ztest_replay_write(void *arg1, void *arg2, boolean_t b * Set the bt's gen/txg to the bonus buffer's gen/txg * so that all of the usual ASSERTs will work. */ - ztest_bt_generate(bt, os, lr->lr_foid, offset, gen, txg, crtxg); + ztest_bt_generate(bt, os, lr->lr_foid, 0, offset, gen, txg, + crtxg); } if (abuf == NULL) { @@ -1753,7 +1842,7 @@ ztest_replay_setattr(void *arg1, void *arg2, boolean_t dmu_tx_t *tx; dmu_buf_t *db; ztest_block_tag_t *bbt; - uint64_t txg, lrtxg, crtxg; + uint64_t txg, lrtxg, crtxg, dnodesize; if (byteswap) byteswap_uint64_array(lr, sizeof (*lr)); @@ -1776,6 +1865,7 @@ ztest_replay_setattr(void *arg1, void *arg2, boolean_t ASSERT3U(bbt->bt_magic, ==, BT_MAGIC); crtxg = bbt->bt_crtxg; lrtxg = lr->lr_common.lrc_txg; + dnodesize = bbt->bt_dnodesize; if (zd->zd_zilog->zl_replay) { ASSERT(lr->lr_size != 0); @@ -1794,7 +1884,7 @@ ztest_replay_setattr(void *arg1, void *arg2, boolean_t /* * Verify that the current bonus buffer is not newer than our txg. */ - ztest_bt_verify(bbt, os, lr->lr_foid, -1ULL, lr->lr_mode, + ztest_bt_verify(bbt, os, lr->lr_foid, dnodesize, -1ULL, lr->lr_mode, MAX(txg, lrtxg), crtxg); dmu_buf_will_dirty(db, tx); @@ -1804,8 +1894,9 @@ ztest_replay_setattr(void *arg1, void *arg2, boolean_t VERIFY0(dmu_set_bonus(db, lr->lr_size, tx)); bbt = ztest_bt_bonus(db); - ztest_bt_generate(bbt, os, lr->lr_foid, -1ULL, lr->lr_mode, txg, crtxg); - + ztest_bt_generate(bbt, os, lr->lr_foid, dnodesize, -1ULL, lr->lr_mode, + txg, crtxg); + ztest_fill_unused_bonus(db, bbt, lr->lr_foid, os, bbt->bt_gen); dmu_buf_rele(db, FTAG); (void) ztest_log_setattr(zd, tx, lr); @@ -2037,7 +2128,7 @@ ztest_create(ztest_ds_t *zd, ztest_od_t *od, int count lr->lrz_blocksize = od->od_crblocksize; lr->lrz_ibshift = ztest_random_ibshift(); lr->lrz_bonustype = DMU_OT_UINT64_OTHER; - lr->lrz_bonuslen = dmu_bonus_max(); + lr->lrz_dnodesize = od->od_crdnodesize; lr->lr_gen = od->od_crgen; lr->lr_crtime[0] = time(NULL); @@ -2216,7 +2307,8 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t off switch (io_type) { case ZTEST_IO_WRITE_TAG: - ztest_bt_generate(&wbt, zd->zd_os, object, offset, 0, 0, 0); + ztest_bt_generate(&wbt, zd->zd_os, object, doi.doi_dnodesize, + offset, 0, 0, 0); (void) ztest_write(zd, object, offset, sizeof (wbt), &wbt); break; @@ -2277,13 +2369,15 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t off */ static void ztest_od_init(ztest_od_t *od, uint64_t id, char *tag, uint64_t index, - dmu_object_type_t type, uint64_t blocksize, uint64_t gen) + dmu_object_type_t type, uint64_t blocksize, uint64_t dnodesize, + uint64_t gen) { od->od_dir = ZTEST_DIROBJ; od->od_object = 0; od->od_crtype = type; od->od_crblocksize = blocksize ? blocksize : ztest_random_blocksize(); + od->od_crdnodesize = dnodesize ? dnodesize : ztest_random_dnodesize(); od->od_crgen = gen; od->od_type = DMU_OT_NONE; @@ -3726,7 +3820,7 @@ ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t i int batchsize = sizeof (od) / sizeof (od[0]); for (int b = 0; b < batchsize; b++) - ztest_od_init(&od[b], id, FTAG, b, DMU_OT_UINT64_OTHER, 0, 0); + ztest_od_init(&od[b], id, FTAG, b, DMU_OT_UINT64_OTHER, 0, 0, 0); /* * Destroy the previous batch of objects, create a new batch, @@ -3786,8 +3880,8 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id) /* * Read the directory info. If it's the first time, set things up. */ - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, chunksize); - ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, chunksize); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, chunksize); + ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, chunksize); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4056,8 +4150,8 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id /* * Read the directory info. If it's the first time, set things up. */ - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0); - ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, chunksize); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0, 0); + ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, chunksize); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4257,7 +4351,7 @@ ztest_dmu_write_parallel(ztest_ds_t *zd, uint64_t id) * to verify that parallel writes to an object -- even to the * same blocks within the object -- doesn't cause any trouble. */ - ztest_od_init(&od[0], ID_PARALLEL, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0); + ztest_od_init(&od[0], ID_PARALLEL, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4276,7 +4370,7 @@ ztest_dmu_prealloc(ztest_ds_t *zd, uint64_t id) uint64_t blocksize = ztest_random_blocksize(); void *data; - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0, 0); if (ztest_object_init(zd, od, sizeof (od), !ztest_random(2)) != 0) return; @@ -4322,7 +4416,7 @@ ztest_zap(ztest_ds_t *zd, uint64_t id) int error; char *hc[2] = { "s.acl.h", ".s.open.h.hyLZlg" }; - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0, 0); if (ztest_object_init(zd, od, sizeof (od), !ztest_random(2)) != 0) return; @@ -4454,7 +4548,7 @@ ztest_fzap(ztest_ds_t *zd, uint64_t id) ztest_od_t od[1]; uint64_t object, txg; - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0, 0); if (ztest_object_init(zd, od, sizeof (od), !ztest_random(2)) != 0) return; @@ -4500,7 +4594,7 @@ ztest_zap_parallel(ztest_ds_t *zd, uint64_t id) char name[20], string_value[20]; void *data; - ztest_od_init(&od[0], ID_PARALLEL, FTAG, micro, DMU_OT_ZAP_OTHER, 0, 0); + ztest_od_init(&od[0], ID_PARALLEL, FTAG, micro, DMU_OT_ZAP_OTHER, 0, 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4688,7 +4782,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id uint64_t old_txg, txg; int i, error; - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4802,6 +4896,41 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id dmu_tx_commit(tx); } +/* + * Visit each object in the dataset. Verify that its properties + * are consistent what was stored in the block tag when it was created, + * and that its unused bonus buffer space has not been overwritten. + */ +void +ztest_verify_dnode_bt(ztest_ds_t *zd, uint64_t id) +{ + objset_t *os = zd->zd_os; + uint64_t obj; + int err = 0; + + for (obj = 0; err == 0; err = dmu_object_next(os, &obj, FALSE, 0)) { + ztest_block_tag_t *bt = NULL; + dmu_object_info_t doi; + dmu_buf_t *db; + + if (dmu_bonus_hold(os, obj, FTAG, &db) != 0) + continue; + + dmu_object_info_from_db(db, &doi); + if (doi.doi_bonus_size >= sizeof (*bt)) + bt = ztest_bt_bonus(db); + + if (bt && bt->bt_magic == BT_MAGIC) { + ztest_bt_verify(bt, os, obj, doi.doi_dnodesize, + bt->bt_offset, bt->bt_gen, bt->bt_txg, + bt->bt_crtxg); + ztest_verify_unused_bonus(db, bt, obj, os, bt->bt_gen); + } + + dmu_buf_rele(db, FTAG); + } +} + /* ARGSUSED */ void ztest_dsl_prop_get_set(ztest_ds_t *zd, uint64_t id) @@ -5286,7 +5415,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id) blocksize = ztest_random_blocksize(); blocksize = MIN(blocksize, 2048); /* because we write so many */ - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -6212,7 +6341,7 @@ ztest_freeze(void) numloops++ < ztest_opts.zo_maxloops && metaslab_class_get_alloc(spa_normal_class(spa)) < capacity) { ztest_od_t od; - ztest_od_init(&od, 0, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0); + ztest_od_init(&od, 0, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, 0); VERIFY0(ztest_object_init(zd, &od, sizeof (od), B_FALSE)); ztest_io(zd, od.od_object, ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT); Modified: head/cddl/usr.bin/ztest/Makefile ============================================================================== --- head/cddl/usr.bin/ztest/Makefile Sun Aug 12 00:33:24 2018 (r337668) +++ head/cddl/usr.bin/ztest/Makefile Sun Aug 12 00:45:53 2018 (r337669) @@ -23,6 +23,6 @@ CSTD= c99 # Since there are many asserts in this program, it makes no sense to compile # it without debugging. -CFLAGS+= -g -DDEBUG=1 +CFLAGS+= -g -DDEBUG=1 -Wno-format .include Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Sun Aug 12 00:33:24 2018 (r337668) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Sun Aug 12 00:45:53 2018 (r337669) @@ -243,6 +243,18 @@ zpool_feature_init(void) "org.open-zfs:large_blocks", "large_blocks", "Support for blocks larger than 128KB.", ZFEATURE_FLAG_PER_DATASET, large_blocks_deps); + + { + static const spa_feature_t large_dnode_deps[] = { + SPA_FEATURE_EXTENSIBLE_DATASET, + SPA_FEATURE_NONE + }; + zfeature_register(SPA_FEATURE_LARGE_DNODE, + "org.zfsonlinux:large_dnode", "large_dnode", + "Variable on-disk size of dnodes.", + ZFEATURE_FLAG_PER_DATASET, large_dnode_deps); + } + zfeature_register(SPA_FEATURE_SHA512, "org.illumos:sha512", "sha512", "SHA-512/256 hash algorithm.", Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Sun Aug 12 00:33:24 2018 (r337668) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Sun Aug 12 00:45:53 2018 (r337669) @@ -52,6 +52,7 @@ typedef enum spa_feature { SPA_FEATURE_BOOKMARKS, SPA_FEATURE_FS_SS_LIMIT, SPA_FEATURE_LARGE_BLOCKS, + SPA_FEATURE_LARGE_DNODE, SPA_FEATURE_SHA512, SPA_FEATURE_SKEIN, #ifdef illumos Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sun Aug 12 00:33:24 2018 (r337668) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sun Aug 12 00:45:53 2018 (r337669) @@ -222,6 +222,17 @@ zfs_prop_init(void) { NULL } }; + static zprop_index_t dnsize_table[] = { + { "legacy", ZFS_DNSIZE_LEGACY }, + { "auto", ZFS_DNSIZE_AUTO }, + { "1k", ZFS_DNSIZE_1K }, + { "2k", ZFS_DNSIZE_2K }, + { "4k", ZFS_DNSIZE_4K }, + { "8k", ZFS_DNSIZE_8K }, + { "16k", ZFS_DNSIZE_16K }, + { NULL } + }; + static zprop_index_t redundant_metadata_table[] = { { "all", ZFS_REDUNDANT_METADATA_ALL }, { "most", ZFS_REDUNDANT_METADATA_MOST }, @@ -281,7 +292,10 @@ zfs_prop_init(void) ZFS_VOLMODE_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME, "default | geom | dev | none", "VOLMODE", volmode_table); - + zprop_register_index(ZFS_PROP_DNODESIZE, "dnodesize", + ZFS_DNSIZE_LEGACY, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, + "legacy | auto | 1k | 2k | 4k | 8k | 16k", "DNSIZE", dnsize_table); + /* inherit index (boolean) properties */ zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off", "ATIME", boolean_table); Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sun Aug 12 00:33:24 2018 (r337668) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sun Aug 12 00:45:53 2018 (r337669) @@ -138,6 +138,8 @@ zpool_prop_init(void) PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_POOL, "MAXBLOCKSIZE"); zprop_register_hidden(ZPOOL_PROP_TNAME, "tname", PROP_TYPE_STRING, PROP_ONETIME, ZFS_TYPE_POOL, "TNAME"); + zprop_register_hidden(ZPOOL_PROP_MAXDNODESIZE, "maxdnodesize", + PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_POOL, "MAXDNODESIZE"); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 00:33:24 2018 (r337668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 00:45:53 2018 (r337669) @@ -752,7 +752,6 @@ dbuf_verify(dmu_buf_impl_t *db) ASSERT3U(db->db.db_offset, ==, DMU_BONUS_BLKID); } else if (db->db_blkid == DMU_SPILL_BLKID) { ASSERT(dn != NULL); - ASSERT3U(db->db.db_size, >=, dn->dn_bonuslen); ASSERT0(db->db.db_offset); } else { ASSERT3U(db->db.db_offset, ==, db->db_blkid * db->db.db_size); @@ -1010,13 +1009,18 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_ ASSERT(db->db_buf == NULL); if (db->db_blkid == DMU_BONUS_BLKID) { + /* + * The bonus length stored in the dnode may be less than + * the maximum available space in the bonus buffer. + */ int bonuslen = MIN(dn->dn_bonuslen, dn->dn_phys->dn_bonuslen); + int max_bonuslen = DN_SLOTS_TO_BONUSLEN(dn->dn_num_slots); ASSERT3U(bonuslen, <=, db->db.db_size); - db->db.db_data = zio_buf_alloc(DN_MAX_BONUSLEN); - arc_space_consume(DN_MAX_BONUSLEN, ARC_SPACE_BONUS); - if (bonuslen < DN_MAX_BONUSLEN) - bzero(db->db.db_data, DN_MAX_BONUSLEN); + db->db.db_data = zio_buf_alloc(max_bonuslen); + arc_space_consume(max_bonuslen, ARC_SPACE_BONUS); + if (bonuslen < max_bonuslen) + bzero(db->db.db_data, max_bonuslen); if (bonuslen) bcopy(DN_BONUS(dn->dn_phys), db->db.db_data, bonuslen); DB_DNODE_EXIT(db); @@ -1123,9 +1127,11 @@ dbuf_fix_old_data(dmu_buf_impl_t *db, uint64_t txg) ASSERT(dr->dr_txg >= txg - 2); if (db->db_blkid == DMU_BONUS_BLKID) { /* Note that the data bufs here are zio_bufs */ - dr->dt.dl.dr_data = zio_buf_alloc(DN_MAX_BONUSLEN); - arc_space_consume(DN_MAX_BONUSLEN, ARC_SPACE_BONUS); - bcopy(db->db.db_data, dr->dt.dl.dr_data, DN_MAX_BONUSLEN); + dnode_t *dn = DB_DNODE(db); + int bonuslen = DN_SLOTS_TO_BONUSLEN(dn->dn_num_slots); + dr->dt.dl.dr_data = zio_buf_alloc(bonuslen); + arc_space_consume(bonuslen, ARC_SPACE_BONUS); + bcopy(db->db.db_data, dr->dt.dl.dr_data, bonuslen); } else if (refcount_count(&db->db_holds) > db->db_dirtycnt) { int size = arc_buf_size(db->db_buf); arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); @@ -2096,10 +2102,13 @@ dbuf_destroy(dmu_buf_impl_t *db) } if (db->db_blkid == DMU_BONUS_BLKID) { - ASSERT(db->db.db_data != NULL); - zio_buf_free(db->db.db_data, DN_MAX_BONUSLEN); - arc_space_return(DN_MAX_BONUSLEN, ARC_SPACE_BONUS); - db->db_state = DB_UNCACHED; + int slots = DB_DNODE(db)->dn_num_slots; + int bonuslen = DN_SLOTS_TO_BONUSLEN(slots); + if (db->db.db_data != NULL) { + zio_buf_free(db->db.db_data, bonuslen); + arc_space_return(bonuslen, ARC_SPACE_BONUS); + db->db_state = DB_UNCACHED; + } } dbuf_clear_data(db); @@ -2203,7 +2212,7 @@ dbuf_findbp(dnode_t *dn, int level, uint64_t blkid, in mutex_enter(&dn->dn_mtx); if (dn->dn_have_spill && (dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) - *bpp = &dn->dn_phys->dn_spill; + *bpp = DN_SPILL_BLKPTR(dn->dn_phys); else *bpp = NULL; dbuf_add_ref(dn->dn_dbuf, NULL); @@ -2304,7 +2313,7 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid if (blkid == DMU_BONUS_BLKID) { ASSERT3P(parent, ==, dn->dn_dbuf); - db->db.db_size = DN_MAX_BONUSLEN - + db->db.db_size = DN_SLOTS_TO_BONUSLEN(dn->dn_num_slots) - (dn->dn_nblkptr-1) * sizeof (blkptr_t); ASSERT3U(db->db.db_size, >=, dn->dn_bonuslen); db->db.db_offset = DMU_BONUS_BLKID; @@ -3054,7 +3063,7 @@ dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) return; if (db->db_blkid == DMU_SPILL_BLKID) { - db->db_blkptr = &dn->dn_phys->dn_spill; + db->db_blkptr = DN_SPILL_BLKPTR(dn->dn_phys); BP_ZERO(db->db_blkptr); return; } @@ -3185,13 +3194,17 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) ASSERT(*datap != NULL); ASSERT0(db->db_level); - ASSERT3U(dn->dn_phys->dn_bonuslen, <=, DN_MAX_BONUSLEN); - bcopy(*datap, DN_BONUS(dn->dn_phys), dn->dn_phys->dn_bonuslen); + ASSERT3U(DN_MAX_BONUS_LEN(dn->dn_phys), <=, + DN_SLOTS_TO_BONUSLEN(dn->dn_phys->dn_extra_slots + 1)); + bcopy(*datap, DN_BONUS(dn->dn_phys), + DN_MAX_BONUS_LEN(dn->dn_phys)); DB_DNODE_EXIT(db); if (*datap != db->db.db_data) { - zio_buf_free(*datap, DN_MAX_BONUSLEN); - arc_space_return(DN_MAX_BONUSLEN, ARC_SPACE_BONUS); + int slots = DB_DNODE(db)->dn_num_slots; + int bonuslen = DN_SLOTS_TO_BONUSLEN(slots); + zio_buf_free(*datap, bonuslen); + arc_space_return(bonuslen, ARC_SPACE_BONUS); } db->db_data_pending = NULL; drp = &db->db_last_dirty; @@ -3201,8 +3214,8 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) ASSERT(dr->dr_dbuf == db); *drp = dr->dr_next; if (dr->dr_dbuf->db_level != 0) { - list_destroy(&dr->dt.di.dr_children); mutex_destroy(&dr->dt.di.dr_mtx); + list_destroy(&dr->dt.di.dr_children); } kmem_free(dr, sizeof (dbuf_dirty_record_t)); ASSERT(db->db_dirtycnt > 0); @@ -3351,7 +3364,7 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb if (db->db_blkid == DMU_SPILL_BLKID) { ASSERT(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR); ASSERT(!(BP_IS_HOLE(bp)) && - db->db_blkptr == &dn->dn_phys->dn_spill); + db->db_blkptr == DN_SPILL_BLKPTR(dn->dn_phys)); } #endif @@ -3363,11 +3376,16 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb mutex_exit(&dn->dn_mtx); if (dn->dn_type == DMU_OT_DNODE) { - dnode_phys_t *dnp = db->db.db_data; - for (i = db->db.db_size >> DNODE_SHIFT; i > 0; - i--, dnp++) { - if (dnp->dn_type != DMU_OT_NONE) + i = 0; + while (i < db->db.db_size) { + dnode_phys_t *dnp = db->db.db_data + i; + + i += DNODE_MIN_SIZE; + if (dnp->dn_type != DMU_OT_NONE) { fill++; + i += dnp->dn_extra_slots * + DNODE_MIN_SIZE; + } } } else { if (BP_IS_HOLE(bp)) { @@ -3520,7 +3538,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb) dn = DB_DNODE(db); ASSERT(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR); ASSERT(!(BP_IS_HOLE(db->db_blkptr)) && - db->db_blkptr == &dn->dn_phys->dn_spill); + db->db_blkptr == DN_SPILL_BLKPTR(dn->dn_phys)); DB_DNODE_EXIT(db); } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Aug 12 00:33:24 2018 (r337668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Aug 12 00:45:53 2018 (r337669) @@ -244,7 +244,7 @@ dmu_buf_hold(objset_t *os, uint64_t object, uint64_t o int dmu_bonus_max(void) { - return (DN_MAX_BONUSLEN); + return (DN_OLD_MAX_BONUSLEN); } int @@ -2524,6 +2524,7 @@ dmu_object_info_from_dnode(dnode_t *dn, dmu_object_inf doi->doi_type = dn->dn_type; doi->doi_bonus_type = dn->dn_bonustype; doi->doi_bonus_size = dn->dn_bonuslen; + doi->doi_dnodesize = dn->dn_num_slots << DNODE_SHIFT; doi->doi_indirection = dn->dn_nlevels; doi->doi_checksum = dn->dn_checksum; doi->doi_compress = dn->dn_compress; @@ -2586,9 +2587,21 @@ dmu_object_size_from_db(dmu_buf_t *db_fake, uint32_t * dn = DB_DNODE(db); *blksize = dn->dn_datablksz; - /* add 1 for dnode space */ + /* add in number of slots used for the dnode itself */ *nblk512 = ((DN_USED_BYTES(dn->dn_phys) + SPA_MINBLOCKSIZE/2) >> - SPA_MINBLOCKSHIFT) + 1; + SPA_MINBLOCKSHIFT) + dn->dn_num_slots; + DB_DNODE_EXIT(db); +} + +void +dmu_object_dnsize_from_db(dmu_buf_t *db_fake, int *dnsize) +{ + dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake; + dnode_t *dn; + + DB_DNODE_ENTER(db); + dn = DB_DNODE(db); + *dnsize = dn->dn_num_slots << DNODE_SHIFT; DB_DNODE_EXIT(db); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sun Aug 12 00:33:24 2018 (r337668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sun Aug 12 00:45:53 2018 (r337669) @@ -30,29 +30,49 @@ #include #include #include +#include -uint64_t -dmu_object_alloc_ibs(objset_t *os, dmu_object_type_t ot, int blocksize, - int indirect_blockshift, - dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) + +static uint64_t +dmu_object_alloc_impl(objset_t *os, dmu_object_type_t ot, int blocksize, + int indirect_blockshift, dmu_object_type_t bonustype, int bonuslen, + int dnodesize, dmu_tx_t *tx) { uint64_t object; uint64_t L1_dnode_count = DNODES_PER_BLOCK << (DMU_META_DNODE(os)->dn_indblkshift - SPA_BLKPTRSHIFT); dnode_t *dn = NULL; + int dn_slots = dnodesize >> DNODE_SHIFT; + boolean_t restarted = B_FALSE; + if (dn_slots == 0) { + dn_slots = DNODE_MIN_SLOTS; + } else { + ASSERT3S(dn_slots, >=, DNODE_MIN_SLOTS); + ASSERT3S(dn_slots, <=, DNODE_MAX_SLOTS); + } + mutex_enter(&os->os_obj_lock); for (;;) { object = os->os_obj_next; /* * Each time we polish off a L1 bp worth of dnodes (2^12 - * objects), move to another L1 bp that's still reasonably - * sparse (at most 1/4 full). Look from the beginning at most - * once per txg, but after that keep looking from here. + * objects), move to another L1 bp that's still + * reasonably sparse (at most 1/4 full). Look from the + * beginning at most once per txg. If we still can't + * allocate from that L1 block, search for an empty L0 + * block, which will quickly skip to the end of the + * metadnode if the no nearby L0 blocks are empty. This + * fallback avoids a pathology where full dnode blocks + * containing large dnodes appear sparse because they + * have a low blk_fill, leading to many failed + * allocation attempts. In the long term a better + * mechanism to search for sparse metadnode regions, + * such as spacemaps, could be implemented. + * * os_scan_dnodes is set during txg sync if enough objects * have been freed since the previous rescan to justify - * backfilling again. If we can't find a suitable block, just - * keep going from here. + * backfilling again. * * Note that dmu_traverse depends on the behavior that we use * multiple blocks of the dnode object before going back to @@ -60,9 +80,10 @@ dmu_object_alloc_ibs(objset_t *os, dmu_object_type_t o * that property or find another solution to the issues * described in traverse_visitbp. */ - if (P2PHASE(object, L1_dnode_count) == 0) { uint64_t offset; + uint64_t blkfill; + int minlvl; int error; if (os->os_rescan_dnodes) { offset = 0; @@ -70,13 +91,15 @@ dmu_object_alloc_ibs(objset_t *os, dmu_object_type_t o } else { offset = object << DNODE_SHIFT; } + blkfill = restarted ? 1 : DNODES_PER_BLOCK >> 2; + minlvl = restarted ? 1 : 2; + restarted = B_TRUE; error = dnode_next_offset(DMU_META_DNODE(os), - DNODE_FIND_HOLE, - &offset, 2, DNODES_PER_BLOCK >> 2, 0); + DNODE_FIND_HOLE, &offset, minlvl, blkfill, 0); if (error == 0) object = offset >> DNODE_SHIFT; } - os->os_obj_next = ++object; + os->os_obj_next = object + dn_slots; /* * XXX We should check for an i/o error here and return @@ -84,17 +107,23 @@ dmu_object_alloc_ibs(objset_t *os, dmu_object_type_t o * dmu_tx_assign(), but there is currently no mechanism * to do so. */ - (void) dnode_hold_impl(os, object, DNODE_MUST_BE_FREE, + (void) dnode_hold_impl(os, object, DNODE_MUST_BE_FREE, dn_slots, FTAG, &dn); if (dn) break; if (dmu_object_next(os, &object, B_TRUE, 0) == 0) - os->os_obj_next = object - 1; + os->os_obj_next = object; + else + /* + * Skip to next known valid starting point for a dnode. + */ + os->os_obj_next = P2ROUNDUP(object + 1, + DNODES_PER_BLOCK); } dnode_allocate(dn, ot, blocksize, indirect_blockshift, - bonustype, bonuslen, tx); + bonustype, bonuslen, dn_slots, tx); mutex_exit(&os->os_obj_lock); dmu_tx_add_new_object(tx, dn); @@ -107,24 +136,57 @@ uint64_t dmu_object_alloc(objset_t *os, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - return (dmu_object_alloc_ibs(os, ot, blocksize, 0, - bonustype, bonuslen, tx)); + return dmu_object_alloc_impl(os, ot, blocksize, 0, bonustype, + bonuslen, 0, tx); } +uint64_t +dmu_object_alloc_ibs(objset_t *os, dmu_object_type_t ot, int blocksize, + int indirect_blockshift, dmu_object_type_t bonustype, int bonuslen, + dmu_tx_t *tx) +{ + return dmu_object_alloc_impl(os, ot, blocksize, indirect_blockshift, + bonustype, bonuslen, 0, tx); +} + +uint64_t +dmu_object_alloc_dnsize(objset_t *os, dmu_object_type_t ot, int blocksize, + dmu_object_type_t bonustype, int bonuslen, int dnodesize, dmu_tx_t *tx) +{ + return (dmu_object_alloc_impl(os, ot, blocksize, 0, bonustype, + bonuslen, dnodesize, tx)); +} + int dmu_object_claim(objset_t *os, uint64_t object, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { + return (dmu_object_claim_dnsize(os, object, ot, blocksize, bonustype, + bonuslen, 0, tx)); +} + +int +dmu_object_claim_dnsize(objset_t *os, uint64_t object, dmu_object_type_t ot, + int blocksize, dmu_object_type_t bonustype, int bonuslen, + int dnodesize, dmu_tx_t *tx) +{ dnode_t *dn; + int dn_slots = dnodesize >> DNODE_SHIFT; int err; + if (dn_slots == 0) + dn_slots = DNODE_MIN_SLOTS; + ASSERT3S(dn_slots, >=, DNODE_MIN_SLOTS); + ASSERT3S(dn_slots, <=, DNODE_MAX_SLOTS); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Aug 12 01:10: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 D2AE91058DD8; Sun, 12 Aug 2018 01:10:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8459870260; Sun, 12 Aug 2018 01:10:20 +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 667041EFE4; Sun, 12 Aug 2018 01:10:20 +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 w7C1AKEa087862; Sun, 12 Aug 2018 01:10:20 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C1AIL1087851; Sun, 12 Aug 2018 01:10:18 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808120110.w7C1AIL1087851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 12 Aug 2018 01:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337670 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 337670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 01:10:21 -0000 Author: mmacy Date: Sun Aug 12 01:10:18 2018 New Revision: 337670 URL: https://svnweb.freebsd.org/changeset/base/337670 Log: MFV/ZoL: add dbuf stats NB: disabled pending the addition of KSTAT_TYPE_RAW support to the SPL commit e0b0ca983d6897bcddf05af2c0e5d01ff66f90db Author: Brian Behlendorf Date: Wed Oct 2 17:11:19 2013 -0700 Add visibility in to cached dbufs Currently there is no mechanism to inspect which dbufs are being cached by the system. There are some coarse counters in arcstats by they only give a rough idea of what's being cached. This patch aims to improve the current situation by adding a new dbufs kstat. When read this new kstat will walk all cached dbufs linked in to the dbuf_hash. For each dbuf it will dump detailed information about the buffer. It will also dump additional information about the referenced arc buffer and its related dnode. This provides a more complete view in to exactly what is being cached. With this generic infrastructure in place utilities can be written to post-process the data to understand exactly how the caching is working. For example, the data could be processed to show a list of all cached dnodes and how much space they're consuming. Or a similar list could be generated based on dnode type. Many other ways to interpret the data exist based on what kinds of questions you're trying to answer. Signed-off-by: Brian Behlendorf Signed-off-by: Prakash Surya Added: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf_stats.c Modified: head/sys/cddl/compat/opensolaris/sys/kstat.h head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Modified: head/sys/cddl/compat/opensolaris/sys/kstat.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kstat.h Sun Aug 12 00:45:53 2018 (r337669) +++ head/sys/cddl/compat/opensolaris/sys/kstat.h Sun Aug 12 01:10:18 2018 (r337670) @@ -31,7 +31,18 @@ #include -#define KSTAT_TYPE_NAMED 1 +#define KSTAT_TYPE_RAW 0 /* can be anything */ + /* ks_ndata >= 1 */ +#define KSTAT_TYPE_NAMED 1 /* name/value pair */ + /* ks_ndata >= 1 */ +#define KSTAT_TYPE_INTR 2 /* interrupt statistics */ + /* ks_ndata == 1 */ +#define KSTAT_TYPE_IO 3 /* I/O statistics */ + /* ks_ndata == 1 */ +#define KSTAT_TYPE_TIMER 4 /* event timer */ + /* ks_ndata >= 1 */ + +#define KSTAT_NUM_TYPES 5 #define KSTAT_FLAG_VIRTUAL 0x01 Modified: head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sun Aug 12 00:45:53 2018 (r337669) +++ head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sun Aug 12 01:10:18 2018 (r337670) @@ -72,6 +72,7 @@ ZFS_COMMON_OBJS += \ bqueue.o \ cityhash.o \ dbuf.o \ + dbuf_stats.o \ ddt.o \ ddt_zap.o \ dmu.o \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 12 00:45:53 2018 (r337669) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 12 01:10:18 2018 (r337670) @@ -523,6 +523,10 @@ typedef struct arc_state { * non-evictable, ARC_BUFC_DATA, and ARC_BUFC_METADATA. */ refcount_t arcs_size; + /* + * supports the "dbufs" kstat + */ + arc_state_type_t arcs_state; } arc_state_t; /* @@ -1111,6 +1115,11 @@ typedef struct l1arc_buf_hdr { /* updated atomically */ clock_t b_arc_access; + uint32_t b_mru_hits; + uint32_t b_mru_ghost_hits; + uint32_t b_mfu_hits; + uint32_t b_mfu_ghost_hits; + uint32_t b_l2_hits; /* self protecting */ refcount_t b_refcnt; @@ -1125,6 +1134,7 @@ typedef struct l2arc_buf_hdr { /* protected by arc_buf_hdr mutex */ l2arc_dev_t *b_dev; /* L2ARC device */ uint64_t b_daddr; /* disk address, offset byte */ + uint32_t b_hits; list_node_t b_l2node; } l2arc_buf_hdr_t; @@ -2552,6 +2562,55 @@ remove_reference(arc_buf_hdr_t *hdr, kmutex_t *hash_lo } /* + * Returns detailed information about a specific arc buffer. When the + * state_index argument is set the function will calculate the arc header + * list position for its arc state. Since this requires a linear traversal + * callers are strongly encourage not to do this. However, it can be helpful + * for targeted analysis so the functionality is provided. + */ +void +arc_buf_info(arc_buf_t *ab, arc_buf_info_t *abi, int state_index) +{ + arc_buf_hdr_t *hdr = ab->b_hdr; + l1arc_buf_hdr_t *l1hdr = NULL; + l2arc_buf_hdr_t *l2hdr = NULL; + arc_state_t *state = NULL; + + memset(abi, 0, sizeof (arc_buf_info_t)); + + if (hdr == NULL) + return; + + abi->abi_flags = hdr->b_flags; + + if (HDR_HAS_L1HDR(hdr)) { + l1hdr = &hdr->b_l1hdr; + state = l1hdr->b_state; + } + if (HDR_HAS_L2HDR(hdr)) + l2hdr = &hdr->b_l2hdr; + + if (l1hdr) { + abi->abi_bufcnt = l1hdr->b_bufcnt; + abi->abi_access = l1hdr->b_arc_access; + abi->abi_mru_hits = l1hdr->b_mru_hits; + abi->abi_mru_ghost_hits = l1hdr->b_mru_ghost_hits; + abi->abi_mfu_hits = l1hdr->b_mfu_hits; + abi->abi_mfu_ghost_hits = l1hdr->b_mfu_ghost_hits; + abi->abi_holds = refcount_count(&l1hdr->b_refcnt); + } + + if (l2hdr) { + abi->abi_l2arc_dattr = l2hdr->b_daddr; + abi->abi_l2arc_hits = l2hdr->b_hits; + } + + abi->abi_state_type = state ? state->arcs_state : ARC_STATE_ANON; + abi->abi_state_contents = arc_buf_type(hdr); + abi->abi_size = arc_hdr_size(hdr); +} + +/* * Move the supplied buffer to the indicated state. The hash lock * for the buffer must be held by the caller. */ @@ -5258,6 +5317,7 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); arc_change_state(arc_mfu, hdr, hash_lock); } + atomic_inc_32(&hdr->b_l1hdr.b_mru_hits); ARCSTAT_BUMP(arcstat_mru_hits); } else if (hdr->b_l1hdr.b_state == arc_mru_ghost) { arc_state_t *new_state; @@ -5283,6 +5343,7 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) hdr->b_l1hdr.b_arc_access = ddi_get_lbolt(); arc_change_state(new_state, hdr, hash_lock); + atomic_inc_32(&hdr->b_l1hdr.b_mru_ghost_hits); ARCSTAT_BUMP(arcstat_mru_ghost_hits); } else if (hdr->b_l1hdr.b_state == arc_mfu) { /* @@ -5295,6 +5356,7 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) * the head of the list now. */ + atomic_inc_32(&hdr->b_l1hdr.b_mfu_hits); ARCSTAT_BUMP(arcstat_mfu_hits); hdr->b_l1hdr.b_arc_access = ddi_get_lbolt(); } else if (hdr->b_l1hdr.b_state == arc_mfu_ghost) { @@ -5317,6 +5379,7 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, hdr); arc_change_state(new_state, hdr, hash_lock); + atomic_inc_32(&hdr->b_l1hdr.b_mfu_ghost_hits); ARCSTAT_BUMP(arcstat_mfu_ghost_hits); } else if (hdr->b_l1hdr.b_state == arc_l2c_only) { /* @@ -5913,6 +5976,7 @@ top: DTRACE_PROBE1(l2arc__hit, arc_buf_hdr_t *, hdr); ARCSTAT_BUMP(arcstat_l2_hits); + atomic_inc_32(&hdr->b_l2hdr.b_hits); cb = kmem_zalloc(sizeof (l2arc_read_callback_t), KM_SLEEP); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 00:45:53 2018 (r337669) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 01:10:18 2018 (r337670) @@ -649,6 +649,7 @@ retry: for (i = 0; i < DBUF_MUTEXES; i++) mutex_init(&h->hash_mutexes[i], NULL, MUTEX_DEFAULT, NULL); + dbuf_stats_init(h); /* * Setup the parameters for the dbuf caches. We set the sizes of the * dbuf cache and the metadata cache to 1/32nd and 1/16th (default) @@ -692,6 +693,8 @@ dbuf_fini(void) { dbuf_hash_table_t *h = &dbuf_hash_table; int i; + + dbuf_stats_destroy(); for (i = 0; i < DBUF_MUTEXES; i++) mutex_destroy(&h->hash_mutexes[i]); Added: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf_stats.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf_stats.c Sun Aug 12 01:10:18 2018 (r337670) @@ -0,0 +1,242 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +#include +#include +#include + +/* + * Calculate the index of the arc header for the state, disabled by default. + */ +int zfs_dbuf_state_index = 0; + +/* + * ========================================================================== + * Dbuf Hash Read Routines + * ========================================================================== + */ +typedef struct dbuf_stats_t { + kmutex_t lock; + kstat_t *kstat; + dbuf_hash_table_t *hash; + int idx; +} dbuf_stats_t; + +static dbuf_stats_t dbuf_stats_hash_table; + +static int +dbuf_stats_hash_table_headers(char *buf, size_t size) +{ + size = snprintf(buf, size - 1, + "%-88s | %-124s | %s\n" + "%-16s %-8s %-8s %-8s %-8s %-8s %-8s %-5s %-5s %5s | " + "%-5s %-5s %-6s %-8s %-6s %-8s %-12s " + "%-6s %-6s %-6s %-6s %-6s %-8s %-8s %-8s %-5s | " + "%-6s %-6s %-8s %-8s %-6s %-6s %-5s %-8s %-8s\n", + "dbuf", "arcbuf", "dnode", "pool", "objset", "object", "level", + "blkid", "offset", "dbsize", "meta", "state", "dbholds", "list", + "atype", "index", "flags", "count", "asize", "access", "mru", "gmru", + "mfu", "gmfu", "l2", "l2_dattr", "l2_asize", "l2_comp", "aholds", + "dtype", "btype", "data_bs", "meta_bs", "bsize", + "lvls", "dholds", "blocks", "dsize"); + buf[size] = '\0'; + + return (0); +} + +int +__dbuf_stats_hash_table_data(char *buf, size_t size, dmu_buf_impl_t *db) +{ + arc_buf_info_t abi = { 0 }; + dmu_object_info_t doi = { 0 }; + dnode_t *dn = DB_DNODE(db); + + if (db->db_buf) + arc_buf_info(db->db_buf, &abi, zfs_dbuf_state_index); + + if (dn) + __dmu_object_info_from_dnode(dn, &doi); + + size = snprintf(buf, size - 1, + "%-16s %-8llu %-8lld %-8lld %-8lld %-8llu %-8llu %-5d %-5d %-5lu | " + "%-5d %-5d %-6lld 0x%-6x %-6lu %-8llu %-12llu " + "%-6lu %-6lu %-6lu %-6lu %-6lu %-8llu %-8llu %-8d %-5lu | " + "%-6d %-6d %-8lu %-8lu %-6llu %-6lu %-5lu %-8llu %-8llu\n", + /* dmu_buf_impl_t */ + spa_name(dn->dn_objset->os_spa), + (u_longlong_t)dmu_objset_id(db->db_objset), + (longlong_t)db->db.db_object, + (longlong_t)db->db_level, + (longlong_t)db->db_blkid, + (u_longlong_t)db->db.db_offset, + (u_longlong_t)db->db.db_size, + !!dbuf_is_metadata(db), + db->db_state, + (ulong_t)refcount_count(&db->db_holds), + /* arc_buf_info_t */ + abi.abi_state_type, + abi.abi_state_contents, + (longlong_t)abi.abi_state_index, + abi.abi_flags, + (ulong_t)abi.abi_bufcnt, + (u_longlong_t)abi.abi_size, + (u_longlong_t)abi.abi_access, + (ulong_t)abi.abi_mru_hits, + (ulong_t)abi.abi_mru_ghost_hits, + (ulong_t)abi.abi_mfu_hits, + (ulong_t)abi.abi_mfu_ghost_hits, + (ulong_t)abi.abi_l2arc_hits, + (u_longlong_t)abi.abi_l2arc_dattr, + (u_longlong_t)abi.abi_l2arc_asize, + abi.abi_l2arc_compress, + (ulong_t)abi.abi_holds, + /* dmu_object_info_t */ + doi.doi_type, + doi.doi_bonus_type, + (ulong_t)doi.doi_data_block_size, + (ulong_t)doi.doi_metadata_block_size, + (u_longlong_t)doi.doi_bonus_size, + (ulong_t)doi.doi_indirection, + (ulong_t)refcount_count(&dn->dn_holds), + (u_longlong_t)doi.doi_fill_count, + (u_longlong_t)doi.doi_max_offset); + buf[size] = '\0'; + + return (size); +} + +static int +dbuf_stats_hash_table_data(char *buf, size_t size, void *data) +{ + dbuf_stats_t *dsh = (dbuf_stats_t *)data; + dbuf_hash_table_t *h = dsh->hash; + dmu_buf_impl_t *db; + int length, error = 0; + + ASSERT3S(dsh->idx, >=, 0); + ASSERT3S(dsh->idx, <=, h->hash_table_mask); + memset(buf, 0, size); + + mutex_enter(DBUF_HASH_MUTEX(h, dsh->idx)); + for (db = h->hash_table[dsh->idx]; db != NULL; db = db->db_hash_next) { + /* + * Returning ENOMEM will cause the data and header functions + * to be called with a larger scratch buffers. + */ + if (size < 512) { + error = ENOMEM; + break; + } + + mutex_enter(&db->db_mtx); + mutex_exit(DBUF_HASH_MUTEX(h, dsh->idx)); + + length = __dbuf_stats_hash_table_data(buf, size, db); + buf += length; + size -= length; + + mutex_exit(&db->db_mtx); + mutex_enter(DBUF_HASH_MUTEX(h, dsh->idx)); + } + mutex_exit(DBUF_HASH_MUTEX(h, dsh->idx)); + + return (error); +} + +static void * +dbuf_stats_hash_table_addr(kstat_t *ksp, off_t n) +{ + dbuf_stats_t *dsh = ksp->ks_private; + + ASSERT(MUTEX_HELD(&dsh->lock)); + + if (n <= dsh->hash->hash_table_mask) { + dsh->idx = n; + return (dsh); + } + + return (NULL); +} + +#ifndef __FreeBSD__ +/* + * XXX The FreeBSD SPL is missing support for KSTAT_TYPE_RAW + * we can enable this as soon as that's implemented. See the + * lindebugfs module for similar callback semantics. + */ +static void +dbuf_stats_hash_table_init(dbuf_hash_table_t *hash) +{ + dbuf_stats_t *dsh = &dbuf_stats_hash_table; + kstat_t *ksp; + + mutex_init(&dsh->lock, NULL, MUTEX_DEFAULT, NULL); + dsh->hash = hash; + + ksp = kstat_create("zfs", 0, "dbufs", "misc", + KSTAT_TYPE_RAW, 0, KSTAT_FLAG_VIRTUAL); + dsh->kstat = ksp; + + if (ksp) { + ksp->ks_lock = &dsh->lock; + ksp->ks_ndata = UINT32_MAX; + ksp->ks_private = dsh; + kstat_set_raw_ops(ksp, dbuf_stats_hash_table_headers, + dbuf_stats_hash_table_data, dbuf_stats_hash_table_addr); + kstat_install(ksp); + } +} + +static void +dbuf_stats_hash_table_destroy(void) +{ + dbuf_stats_t *dsh = &dbuf_stats_hash_table; + kstat_t *ksp; + + ksp = dsh->kstat; + if (ksp) + kstat_delete(ksp); + + mutex_destroy(&dsh->lock); +} +#else +static void +dbuf_stats_hash_table_init(dbuf_hash_table_t *hash) +{ +} + +static void +dbuf_stats_hash_table_destroy(void) +{ +} +#endif + +void +dbuf_stats_init(dbuf_hash_table_t *hash) +{ + dbuf_stats_hash_table_init(hash); +} + +void +dbuf_stats_destroy(void) +{ + dbuf_stats_hash_table_destroy(); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Aug 12 00:45:53 2018 (r337669) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Aug 12 01:10:18 2018 (r337670) @@ -2509,15 +2509,10 @@ dmu_object_wait_synced(objset_t *os, uint64_t object) } void -dmu_object_info_from_dnode(dnode_t *dn, dmu_object_info_t *doi) +__dmu_object_info_from_dnode(dnode_t *dn, dmu_object_info_t *doi) { - dnode_phys_t *dnp; + dnode_phys_t *dnp = dn->dn_phys; - rw_enter(&dn->dn_struct_rwlock, RW_READER); - mutex_enter(&dn->dn_mtx); - - dnp = dn->dn_phys; - doi->doi_data_block_size = dn->dn_datablksz; doi->doi_metadata_block_size = dn->dn_indblkshift ? 1ULL << dn->dn_indblkshift : 0; @@ -2534,6 +2529,15 @@ dmu_object_info_from_dnode(dnode_t *dn, dmu_object_inf doi->doi_fill_count = 0; for (int i = 0; i < dnp->dn_nblkptr; i++) doi->doi_fill_count += BP_GET_FILL(&dnp->dn_blkptr[i]); +} + +void +dmu_object_info_from_dnode(dnode_t *dn, dmu_object_info_t *doi) +{ + rw_enter(&dn->dn_struct_rwlock, RW_READER); + mutex_enter(&dn->dn_mtx); + + __dmu_object_info_from_dnode(dn, doi); mutex_exit(&dn->dn_mtx); rw_exit(&dn->dn_struct_rwlock); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sun Aug 12 00:45:53 2018 (r337669) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sun Aug 12 01:10:18 2018 (r337670) @@ -185,6 +185,36 @@ typedef enum arc_space_type { ARC_SPACE_NUMTYPES } arc_space_type_t; +typedef enum arc_state_type { + ARC_STATE_ANON, + ARC_STATE_MRU, + ARC_STATE_MRU_GHOST, + ARC_STATE_MFU, + ARC_STATE_MFU_GHOST, + ARC_STATE_L2C_ONLY, + ARC_STATE_NUMTYPES +} arc_state_type_t; + +typedef struct arc_buf_info { + arc_state_type_t abi_state_type; + arc_buf_contents_t abi_state_contents; + uint64_t abi_state_index; + uint32_t abi_flags; + uint32_t abi_bufcnt; + uint64_t abi_size; + uint64_t abi_spa; + uint64_t abi_access; + uint32_t abi_mru_hits; + uint32_t abi_mru_ghost_hits; + uint32_t abi_mfu_hits; + uint32_t abi_mfu_ghost_hits; + uint32_t abi_l2arc_hits; + uint32_t abi_holds; + uint64_t abi_l2arc_dattr; + uint64_t abi_l2arc_asize; + enum zio_compress abi_l2arc_compress; +} arc_buf_info_t; + void arc_space_consume(uint64_t space, arc_space_type_t type); void arc_space_return(uint64_t space, arc_space_type_t type); boolean_t arc_is_metadata(arc_buf_t *buf); @@ -200,6 +230,7 @@ arc_buf_t *arc_loan_compressed_buf(spa_t *spa, uint64_ void arc_return_buf(arc_buf_t *buf, void *tag); void arc_loan_inuse_buf(arc_buf_t *buf, void *tag); void arc_buf_destroy(arc_buf_t *buf, void *tag); +void arc_buf_info(arc_buf_t *buf, arc_buf_info_t *abi, int state_index); int arc_buf_size(arc_buf_t *buf); int arc_buf_lsize(arc_buf_t *buf); void arc_buf_access(arc_buf_t *buf); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Sun Aug 12 00:45:53 2018 (r337669) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Sun Aug 12 01:10:18 2018 (r337670) @@ -333,6 +333,9 @@ void dbuf_free_range(struct dnode *dn, uint64_t start, void dbuf_new_size(dmu_buf_impl_t *db, int size, dmu_tx_t *tx); +void dbuf_stats_init(dbuf_hash_table_t *hash); +void dbuf_stats_destroy(void); + #define DB_DNODE(_db) ((_db)->db_dnode_handle->dnh_dnode) #define DB_DNODE_LOCK(_db) ((_db)->db_dnode_handle->dnh_zrlock) #define DB_DNODE_ENTER(_db) (zrl_add(&DB_DNODE_LOCK(_db))) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sun Aug 12 00:45:53 2018 (r337669) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sun Aug 12 01:10:18 2018 (r337670) @@ -855,6 +855,7 @@ extern const dmu_object_byteswap_info_t dmu_ot_byteswa * If doi is NULL, just indicates whether the object exists. */ int dmu_object_info(objset_t *os, uint64_t object, dmu_object_info_t *doi); +void __dmu_object_info_from_dnode(struct dnode *dn, dmu_object_info_t *doi); /* Like dmu_object_info, but faster if you have a held dnode in hand. */ void dmu_object_info_from_dnode(dnode_t *dn, dmu_object_info_t *doi); /* Like dmu_object_info, but faster if you have a held dbuf in hand. */ From owner-svn-src-all@freebsd.org Sun Aug 12 01:17: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 49326105964B; Sun, 12 Aug 2018 01:17:33 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0AF1709F0; Sun, 12 Aug 2018 01:17:32 +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 BC1D21F1D1; Sun, 12 Aug 2018 01:17:32 +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 w7C1HWqk092730; Sun, 12 Aug 2018 01:17:32 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C1HWrx092729; Sun, 12 Aug 2018 01:17:32 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808120117.w7C1HWrx092729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 12 Aug 2018 01:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337671 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 01:17:33 -0000 Author: mmacy Date: Sun Aug 12 01:17:32 2018 New Revision: 337671 URL: https://svnweb.freebsd.org/changeset/base/337671 Log: MFV/ZoL: Fix PANIC: metaslab_free_dva(): bad DVA X:Y:Z commit 81edd3e83409218879e7af293daa86b0c40eb015 Author: Peng Date: Wed Jun 8 15:22:07 2016 +0800 Fix PANIC: metaslab_free_dva(): bad DVA X:Y:Z The following scenario can result in garbage in the dn_spill field. The db->db_blkptr must be set to NULL when DNODE_FLAG_SPILL_BLKPTR is clear to ensure the dn_spill field is cleared. Current txg = A. * A new spill buffer is created. Its dbuf is initialized with db_blkptr = NULL and it's dirtied. Current txg = B. * The spill buffer is modified. It's marked as dirty in this txg. * Additional changes make the spill buffer unnecessary because the xattr fits into the bonus buffer, so it's removed. The dbuf is undirtied in this txg, but it's still referenced and cannot be destroyed. Current txg = C. * Starts syncing of txg A * dbuf_sync_leaf() is called for the spill buffer. Since db_blkptr is NULL, dbuf_check_blkptr() is called. * The dbuf starts being written and it reaches the ready state (not done yet). * A new change makes the spill buffer necessary again. sa_build_layouts() ends up calling dbuf_find() to locate the dbuf. It finds the old dbuf because it has not been destroyed yet (it will be destroyed when the previous write is done and there are no more references). The old dbuf has db_blkptr != NULL. * txg A write is complete and the dbuf released. However it's still referenced, so it's not destroyed. Current txg = D. * Starts syncing of txg B * dbuf_sync_leaf() is called for the bonus buffer. Its contents are directly copied into the dnode, overwriting the blkptr area because, in txg B, the bonus buffer was big enough to hold the entire xattr. * At this point, the db_blkptr of the spill buffer used in txg C gets corrupted. Signed-off-by: Peng Signed-off-by: Tim Chase Signed-off-by: Brian Behlendorf Closes #3937 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 01:10:18 2018 (r337670) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 01:17:32 2018 (r337671) @@ -3182,6 +3182,22 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) if (db->db_blkid == DMU_SPILL_BLKID) { mutex_enter(&dn->dn_mtx); + if (!(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) { + /* + * In the previous transaction group, the bonus buffer + * was entirely used to store the attributes for the + * dnode which overrode the dn_spill field. However, + * when adding more attributes to the file a spill + * block was required to hold the extra attributes. + * + * Make sure to clear the garbage left in the dn_spill + * field from the previous attributes in the bonus + * buffer. Otherwise, after writing out the spill + * block to the new allocated dva, it will free + * the old block pointed to by the invalid dn_spill. + */ + db->db_blkptr = NULL; + } dn->dn_phys->dn_flags |= DNODE_FLAG_SPILL_BLKPTR; mutex_exit(&dn->dn_mtx); } From owner-svn-src-all@freebsd.org Sun Aug 12 01:29: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 A1095105B03E; Sun, 12 Aug 2018 01:29:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57531710F8; Sun, 12 Aug 2018 01:29:31 +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 387781F399; Sun, 12 Aug 2018 01:29:31 +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 w7C1TVR0098099; Sun, 12 Aug 2018 01:29:31 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C1TUAj098097; Sun, 12 Aug 2018 01:29:30 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808120129.w7C1TUAj098097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 12 Aug 2018 01:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337672 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 01:29:31 -0000 Author: mmacy Date: Sun Aug 12 01:29:30 2018 New Revision: 337672 URL: https://svnweb.freebsd.org/changeset/base/337672 Log: MFV/ZoL: Fix stack noinline commit 60948de1ef976aabaa3630707bcc8b5867508507 Author: Brian Behlendorf Date: Thu Aug 26 10:58:36 2010 -0700 Fix stack noinline Certain function must never be automatically inlined by gcc because they are stack heavy or called recursively. This patch flags all such functions I've found as 'noinline' to prevent gcc from making the optimization. Signed-off-by: Brian Behlendorf Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 01:17:32 2018 (r337671) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 01:29:30 2018 (r337672) @@ -3101,7 +3101,12 @@ dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) } } -static void +/* + * dbuf_sync_indirect() is called recursively from dbuf_sync_list() so it + * is critical the we not allow the compiler to inline this function in to + * dbuf_sync_list() thereby drastically bloating the stack usage. + */ +noinline static void dbuf_sync_indirect(dbuf_dirty_record_t *dr, dmu_tx_t *tx) { dmu_buf_impl_t *db = dr->dr_dbuf; @@ -3148,7 +3153,12 @@ dbuf_sync_indirect(dbuf_dirty_record_t *dr, dmu_tx_t * zio_nowait(zio); } -static void +/* + * dbuf_sync_leaf() is called recursively from dbuf_sync_list() so it is + * critical the we not allow the compiler to inline this function in to + * dbuf_sync_list() thereby drastically bloating the stack usage. + */ +noinline static void dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) { arc_buf_t **datap = &dr->dt.dl.dr_data; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Aug 12 01:17:32 2018 (r337671) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Aug 12 01:29:30 2018 (r337672) @@ -2002,7 +2002,7 @@ receive_read(struct receive_arg *ra, int len, void *bu return (0); } -static void +noinline static void byteswap_record(dmu_replay_record_t *drr) { #define DO64(X) (drr->drr_u.X = BSWAP_64(drr->drr_u.X)) @@ -2137,7 +2137,7 @@ save_resume_state(struct receive_writer_arg *rwa, rwa->os->os_dsl_dataset->ds_resume_bytes[txgoff] = rwa->bytes_read; } -static int +noinline static int receive_object(struct receive_writer_arg *rwa, struct drr_object *drro, void *data) { @@ -2243,7 +2243,7 @@ receive_object(struct receive_writer_arg *rwa, struct } /* ARGSUSED */ -static int +noinline static int receive_freeobjects(struct receive_writer_arg *rwa, struct drr_freeobjects *drrfo) { @@ -2279,7 +2279,7 @@ receive_freeobjects(struct receive_writer_arg *rwa, return (0); } -static int +noinline static int receive_write(struct receive_writer_arg *rwa, struct drr_write *drrw, arc_buf_t *abuf) { @@ -2309,7 +2309,6 @@ receive_write(struct receive_writer_arg *rwa, struct d return (SET_ERROR(EINVAL)); tx = dmu_tx_create(rwa->os); - dmu_tx_hold_write(tx, drrw->drr_object, drrw->drr_offset, drrw->drr_logical_size); err = dmu_tx_assign(tx, TXG_WAIT); @@ -2500,7 +2499,7 @@ receive_spill(struct receive_writer_arg *rwa, struct d } /* ARGSUSED */ -static int +noinline static int receive_free(struct receive_writer_arg *rwa, struct drr_free *drrf) { int err; From owner-svn-src-all@freebsd.org Sun Aug 12 01:54: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 2BC1D105C522; Sun, 12 Aug 2018 01:54:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5979722AC; Sun, 12 Aug 2018 01:54:05 +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 B6B3A1F8B8; Sun, 12 Aug 2018 01:54:05 +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 w7C1s5T6013066; Sun, 12 Aug 2018 01:54:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C1s5Mh013065; Sun, 12 Aug 2018 01:54:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808120154.w7C1s5Mh013065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 12 Aug 2018 01:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337673 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 337673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 01:54:06 -0000 Author: jhb Date: Sun Aug 12 01:54:05 2018 New Revision: 337673 URL: https://svnweb.freebsd.org/changeset/base/337673 Log: Add an overview section to bus_dma.9. Describe the role of tags and mapping objects as abstractions. Describe static vs dynamic transaction types and give a brief overview of the set of functions and object life cycles used for static vs dynamic. While here, fix a few other typos and expand a bit on parent tags. Reviewed by: cem, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16652 Modified: head/share/man/man9/bus_dma.9 Modified: head/share/man/man9/bus_dma.9 ============================================================================== --- head/share/man/man9/bus_dma.9 Sun Aug 12 01:29:30 2018 (r337672) +++ head/share/man/man9/bus_dma.9 Sun Aug 12 01:54:05 2018 (r337673) @@ -53,7 +53,7 @@ .\" $FreeBSD$ .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $ .\" -.Dd July 17, 2013 +.Dd August 11, 2018 .Dt BUS_DMA 9 .Os .Sh NAME @@ -135,11 +135,149 @@ It provides the client with flexibility and simplicity abstracting machine dependent issues like setting up DMA mappings, handling cache issues, bus specific features and limitations. +.Sh OVERVIEW +A tag structure +.Vt ( bus_dma_tag_t ) +is used to describe the properties of a group of related DMA +transactions. +One way to view this is that a tag describes the limitations of a DMA engine. +For example, if a DMA engine in a device is limited to 32-bit addresses, +that limitation is specified by a parameter when creating the tag +for that device. +Similarly, a tag can be marked as requiring buffers whose addresses are +aligned to a specific boundary. +.Pp +Some devices may require multiple tags to describe DMA +transactions with differing properties. +For example, a device might require 16-byte alignment of its descriptor ring +while permitting arbitrary alignment of I/O buffers. +In this case, +the driver must create one tag for the descriptor ring and a separate tag for +I/O buffers. +If a device has restrictions that are common to all DMA transactions +in addition to restrictions that differ between unrelated groups of +transactions, +the driver can first create a +.Dq parent +tag that decribes the common restrictions. +The per-group tags can then inherit these restrictions from this +.Dq parent +tag rather than having to list them explicitly when creating the per-group tags. +.Pp +A mapping structure +.Vt ( bus_dmamap_t ) +represents a mapping of a memory region for DMA. +On systems with I/O MMUs, +the mapping structure tracks any I/O MMU entries used by a request. +For DMA requests that require bounce pages, +the mapping tracks the bounce pages used. +.Pp +To prepare for one or more DMA transactions, +a mapping must be bound to a memory region by calling one of the +.Fn bus_dmamap_load +functions. +These functions configure the mapping which can include programming entries +in an I/O MMU and/or allocating bounce pages. +An output of these functions +(either directly or indirectly by invoking a callback routine) +is the list of scatter/gather address ranges a consumer can pass to a DMA +engine to access the memory region. +When a mapping is no longer needed, +the mapping must be unloaded via +.Fn bus_dmamap_unload . +.Pp +Before and after each DMA transaction, +.Fn bus_dmamap_sync +must be used to ensure that the correct data is used by the DMA engine and +the CPU. +If a mapping uses bounce pages, +the sync operations copy data between the bounce pages and the memory region +bound to the mapping. +Sync operations also handle architecture-specific details such as CPU cache +flushing and CPU memory operation ordering. +.Sh STATIC VS DYNAMIC +.Nm +handles two types of DMA transactions: static and dynamic. +Static transactions are used with a long-lived memory region that is reused +for many transactions such as a descriptor ring. +Dynamic transactions are used for transfers to or from transient buffers +such as I/O buffers holding a network packet or disk block. +Each transaction type uses a different subset of the +.Nm +API. +.Ss Static Transactions +Static transactions use memory regions allocated by +.Nm . +Each static memory region is allocated by calling +.Fn bus_dmamem_alloc . +This function requires a valid tag describing the properties of the +DMA transactions to this region such as alignment or address restrictions. +Multiple regions can share a single tag if they share the same restrictions. +.Pp +.Fn bus_dmamem_alloc +allocates a memory region along with a mapping object. +The associated tag, memory region, and mapping object must then be passed to +.Fn bus_dmamap_load +to bind the mapping to the allocated region and obtain the +scatter/gather list. +.Pp +It is expected that +.Fn bus_dmamem_alloc +will attempt to allocate memory requiring less expensive sync operations +(for example, implementations should not allocate regions requiring bounce +pages), +but sync operations should still be used. +For example, a driver should use +.Fn bus_dmamap_sync +in an interrupt handler before reading descriptor ring entries written by the +device prior to the interrupt. +.Pp +When a consumer is finished with a memory region, +it should unload the mapping via +.Fn bus_dmamap_unload +and then release the memory region and mapping object via +.Fn bus_dmamem_free . +.Ss Dynamic Transactions +Dynamic transactions map memory regions provided by other parts of the system. +A tag must be created via +.Fn bus_dma_tag_create +to describe the DMA transactions to and from these memory regions, +and a pool of mapping objects must be allocated via +.Fn bus_dmamap_create +to track the mappings of any in-flight transactions. +.Pp +When a consumer wishes to schedule a transaction for a memory region, +the consumer must first obtain an unused mapping object from its pool +of mapping objects. +The memory region must be bound to the mapping object via one of the +.Fn bus_dmamap_load +functions. +Before scheduling the transaction, +the consumer should sync the memory region via +.Fn bus_dmamap_sync +with one or more of the +.Dq PRE +flags. +After the transaction has completed, +the consumer should sync the memory region via +.Fn bus_dmamap_sync +with one or more of the +.Dq POST +flags. +The mapping can then be unloaded via +.Fn bus_dmamap_unload , +and the mapping object can be returned to the pool of unused mapping objects. +.Pp +When a consumer is no longer scheduling DMA transactions, +the mapping objects should be freed via +.Fn bus_dmamap_destroy , +and the tag should be freed via +.Fn bus_dma_tag_destroy . .Sh STRUCTURES AND TYPES .Bl -tag -width indent .It Vt bus_dma_tag_t A machine-dependent (MD) opaque type that describes the -characteristics of DMA transactions. +characteristics of a group of DMA transactions. DMA tags are organized into a hierarchy, with each child tag inheriting the restrictions of its parent. This allows all devices along the path of DMA transactions @@ -340,14 +478,18 @@ Releases and/or unlocks the client locking primitive. .It Fn bus_dma_tag_create "parent" "alignment" "boundary" "lowaddr" \ "highaddr" "*filtfunc" "*filtfuncarg" "maxsize" "nsegments" "maxsegsz" \ "flags" "lockfunc" "lockfuncarg" "*dmat" -Allocates a device specific DMA tag, and initializes it according to +Allocates a DMA tag, and initializes it according to the arguments provided: .Bl -tag -width ".Fa filtfuncarg" .It Fa parent -Indicates restrictions between the parent bridge, CPU memory, and the +A parent tag from which to inherit restrictions. +The restrictions passed in other arguments can only further tighten the +restrictions inherited from the parent tag. +.Pp +All tags created by a device driver must inherit from the tag returned by +.Fn bus_get_dma_tag +to honor restrictions between the parent bridge, CPU memory, and the device. -Each device must use a master parent tag by calling -.Fn bus_get_dma_tag . .It Fa alignment Alignment constraint, in bytes, of any mappings created using this tag. The alignment must be a power of 2. @@ -391,7 +533,7 @@ and a .Fa lowaddr of .Dv BUS_SPACE_MAXADDR_24BIT . -Some implementations requires that some region of device visible +Some implementations require that some region of device visible address space, overlapping available host memory, be outside the window. This area of From owner-svn-src-all@freebsd.org Sun Aug 12 02:09: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 E35B6105D37B; Sun, 12 Aug 2018 02:09:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87F8572CB4; Sun, 12 Aug 2018 02:09:07 +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 494DE1FA8F; Sun, 12 Aug 2018 02:09:07 +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 w7C297fk018594; Sun, 12 Aug 2018 02:09:07 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C297Ub018593; Sun, 12 Aug 2018 02:09:07 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808120209.w7C297Ub018593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 12 Aug 2018 02:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337674 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 337674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 02:09:08 -0000 Author: mmacy Date: Sun Aug 12 02:09:06 2018 New Revision: 337674 URL: https://svnweb.freebsd.org/changeset/base/337674 Log: Restore legacy dnode_phys layout on tier 2 arches Evidently gcc4 doesn't support anonymous union members Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Sun Aug 12 01:54:05 2018 (r337673) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Sun Aug 12 02:09:06 2018 (r337674) @@ -161,25 +161,54 @@ typedef struct dnode_phys { uint64_t dn_maxblkid; /* largest allocated block ID */ uint64_t dn_used; /* bytes (or sectors) of disk space */ + /* + * Both dn_pad2 and dn_pad3 are protected by the block's MAC. This + * allows us to protect any fields that might be added here in the + * future. In either case, developers will want to check + * zio_crypt_init_uios_dnode() to ensure the new field is being + * protected properly. + */ uint64_t dn_pad3[4]; - union { + /* + * The tail region is 448 bytes for a 512 byte dnode, and + * correspondingly larger for larger dnode sizes. The spill + * block pointer, when present, is always at the end of the tail + * region. There are three ways this space may be used, using + * a 512 byte dnode for this diagram: + * + * 0 64 128 192 256 320 384 448 (offset) + * +---------------+---------------+---------------+-------+ + * | dn_blkptr[0] | dn_blkptr[1] | dn_blkptr[2] | / | + * +---------------+---------------+---------------+-------+ + * | dn_blkptr[0] | dn_bonus[0..319] | + * +---------------+-----------------------+---------------+ + * | dn_blkptr[0] | dn_bonus[0..191] | dn_spill | + * +---------------+-----------------------+---------------+ + */ +#if defined(__i386__) || defined(__amd64__) + union { blkptr_t dn_blkptr[1+DN_OLD_MAX_BONUSLEN/sizeof (blkptr_t)]; - struct { - blkptr_t __dn_ignore1; + struct { + blkptr_t __dn_ignore1; uint8_t dn_bonus[DN_OLD_MAX_BONUSLEN]; - }; - struct { - blkptr_t __dn_ignore2; + }; + struct { + blkptr_t __dn_ignore2; uint8_t __dn_ignore3[DN_OLD_MAX_BONUSLEN - sizeof (blkptr_t)]; - blkptr_t dn_spill; + blkptr_t dn_spill; }; - }; + }; +#else + blkptr_t dn_blkptr[1]; + uint8_t dn_bonus[DN_MAX_BONUSLEN - sizeof (blkptr_t)]; + blkptr_t dn_spill; +#endif } dnode_phys_t; #define DN_SPILL_BLKPTR(dnp) (blkptr_t *)((char *)(dnp) + \ (((dnp)->dn_extra_slots + 1) << DNODE_SHIFT) - (1 << SPA_BLKPTRSHIFT)) - + struct dnode { /* * Protects the structure of the dnode, including the number of levels From owner-svn-src-all@freebsd.org Sun Aug 12 02:12:45 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 C351E105D7FD; Sun, 12 Aug 2018 02:12:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6896173120; Sun, 12 Aug 2018 02:12:45 +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 44D411FC35; Sun, 12 Aug 2018 02:12:45 +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 w7C2CjCk023453; Sun, 12 Aug 2018 02:12:45 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C2CjTE023452; Sun, 12 Aug 2018 02:12:45 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808120212.w7C2CjTE023452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 12 Aug 2018 02:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337675 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 337675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 02:12:45 -0000 Author: mmacy Date: Sun Aug 12 02:12:44 2018 New Revision: 337675 URL: https://svnweb.freebsd.org/changeset/base/337675 Log: fix build DN_MAX_BONUSLEN -> DN_OLD_MAX_BONUSLEN Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Sun Aug 12 02:09:06 2018 (r337674) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Sun Aug 12 02:12:44 2018 (r337675) @@ -201,7 +201,7 @@ typedef struct dnode_phys { }; #else blkptr_t dn_blkptr[1]; - uint8_t dn_bonus[DN_MAX_BONUSLEN - sizeof (blkptr_t)]; + uint8_t dn_bonus[DN_OLD_MAX_BONUSLEN - sizeof (blkptr_t)]; blkptr_t dn_spill; #endif } dnode_phys_t; From owner-svn-src-all@freebsd.org Sun Aug 12 02:24: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 C382F105F244; Sun, 12 Aug 2018 02:24:19 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75BF4737BC; Sun, 12 Aug 2018 02:24:19 +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 559761FDD1; Sun, 12 Aug 2018 02:24:19 +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 w7C2OJRo028364; Sun, 12 Aug 2018 02:24:19 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C2OJRA028363; Sun, 12 Aug 2018 02:24:19 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808120224.w7C2OJRA028363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 12 Aug 2018 02:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337676 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 02:24:20 -0000 Author: mmacy Date: Sun Aug 12 02:24:18 2018 New Revision: 337676 URL: https://svnweb.freebsd.org/changeset/base/337676 Log: MFV/ZoL: Fix stack dbuf_hold_impl() commit fc5bb51f08a6c91ff9ad3559d0266eeeab0b1f61 Author: Brian Behlendorf Date: Thu Aug 26 10:52:00 2010 -0700 Fix stack dbuf_hold_impl() This commit preserves the recursive function dbuf_hold_impl() but moves the local variables and function arguments to the heap to minimize the stack frame size. Enough space is initially allocated on the stack for 20 levels of recursion. This technique was based on commit 34229a2f2ac07363f64ddd63e014964fff2f0671 which reduced stack usage of traverse_visitbp(). Signed-off-by: Brian Behlendorf Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 02:12:44 2018 (r337675) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 02:24:18 2018 (r337676) @@ -51,6 +51,30 @@ #include #include +struct dbuf_hold_impl_data { + /* Function arguments */ + dnode_t *dh_dn; + uint8_t dh_level; + uint64_t dh_blkid; + boolean_t dh_fail_sparse; + boolean_t dh_fail_uncached; + void *dh_tag; + dmu_buf_impl_t **dh_dbp; + /* Local variables */ + dmu_buf_impl_t *dh_db; + dmu_buf_impl_t *dh_parent; + blkptr_t *dh_bp; + int dh_err; + dbuf_dirty_record_t *dh_dr; + int dh_depth; +}; + +static void __dbuf_hold_impl_init(struct dbuf_hold_impl_data *dh, + dnode_t *dn, uint8_t level, uint64_t blkid, boolean_t fail_sparse, + boolean_t fail_uncached, + void *tag, dmu_buf_impl_t **dbp, int depth); +static int __dbuf_hold_impl(struct dbuf_hold_impl_data *dh); + static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx); static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx); @@ -2202,9 +2226,10 @@ dbuf_destroy(dmu_buf_impl_t *db) * this happens when the dnode is the meta-dnode, or a userused or groupused * object. */ -static int +__attribute__((always_inline)) +static inline int dbuf_findbp(dnode_t *dn, int level, uint64_t blkid, int fail_sparse, - dmu_buf_impl_t **parentp, blkptr_t **bpp) + dmu_buf_impl_t **parentp, blkptr_t **bpp, struct dbuf_hold_impl_data *dh) { *parentp = NULL; *bpp = NULL; @@ -2257,8 +2282,16 @@ dbuf_findbp(dnode_t *dn, int level, uint64_t blkid, in return (SET_ERROR(ENOENT)); } else if (level < nlevels-1) { /* this block is referenced from an indirect block */ - int err = dbuf_hold_impl(dn, level+1, - blkid >> epbs, fail_sparse, FALSE, NULL, parentp); + int err; + if (dh == NULL) { + err = dbuf_hold_impl(dn, level+1, + blkid >> epbs, fail_sparse, FALSE, NULL, parentp); + } else { + __dbuf_hold_impl_init(dh + 1, dn, dh->dh_level + 1, + blkid >> epbs, fail_sparse, FALSE, NULL, + parentp, dh->dh_depth + 1); + err = __dbuf_hold_impl(dh + 1); + } if (err) return (err); err = dbuf_read(*parentp, NULL, @@ -2626,108 +2659,189 @@ dbuf_prefetch(dnode_t *dn, int64_t level, uint64_t blk zio_nowait(pio); } +#define DBUF_HOLD_IMPL_MAX_DEPTH 20 + /* + * Helper function for __dbuf_hold_impl() to copy a buffer. Handles + * the case of encrypted, compressed and uncompressed buffers by + * allocating the new buffer, respectively, with arc_alloc_raw_buf(), + * arc_alloc_compressed_buf() or arc_alloc_buf().* + * + * NOTE: Declared noinline to avoid stack bloat in __dbuf_hold_impl(). + */ +noinline static void +dbuf_hold_copy(struct dbuf_hold_impl_data *dh) +{ + dnode_t *dn = dh->dh_dn; + dmu_buf_impl_t *db = dh->dh_db; + dbuf_dirty_record_t *dr = dh->dh_dr; + arc_buf_t *data = dr->dt.dl.dr_data; + + enum zio_compress compress_type = arc_get_compression(data); + + if (compress_type != ZIO_COMPRESS_OFF) { + dbuf_set_data(db, arc_alloc_compressed_buf( + dn->dn_objset->os_spa, db, arc_buf_size(data), + arc_buf_lsize(data), compress_type)); + } else { + dbuf_set_data(db, arc_alloc_buf(dn->dn_objset->os_spa, db, + DBUF_GET_BUFC_TYPE(db), db->db.db_size)); + } + + bcopy(data->b_data, db->db.db_data, arc_buf_size(data)); +} + +/* * Returns with db_holds incremented, and db_mtx not held. * Note: dn_struct_rwlock must be held. */ -int -dbuf_hold_impl(dnode_t *dn, uint8_t level, uint64_t blkid, - boolean_t fail_sparse, boolean_t fail_uncached, - void *tag, dmu_buf_impl_t **dbp) +static int +__dbuf_hold_impl(struct dbuf_hold_impl_data *dh) { - dmu_buf_impl_t *db, *parent = NULL; + ASSERT3S(dh->dh_depth, <, DBUF_HOLD_IMPL_MAX_DEPTH); + dh->dh_parent = NULL; - ASSERT(blkid != DMU_BONUS_BLKID); - ASSERT(RW_LOCK_HELD(&dn->dn_struct_rwlock)); - ASSERT3U(dn->dn_nlevels, >, level); + ASSERT(dh->dh_blkid != DMU_BONUS_BLKID); + ASSERT(RW_LOCK_HELD(&dh->dh_dn->dn_struct_rwlock)); + ASSERT3U(dh->dh_dn->dn_nlevels, >, dh->dh_level); - *dbp = NULL; -top: + *(dh->dh_dbp) = NULL; + /* dbuf_find() returns with db_mtx held */ - db = dbuf_find(dn->dn_objset, dn->dn_object, level, blkid); + dh->dh_db = dbuf_find(dh->dh_dn->dn_objset, dh->dh_dn->dn_object, + dh->dh_level, dh->dh_blkid); - if (db == NULL) { - blkptr_t *bp = NULL; - int err; + if (dh->dh_db == NULL) { + dh->dh_bp = NULL; - if (fail_uncached) + if (dh->dh_fail_uncached) return (SET_ERROR(ENOENT)); - ASSERT3P(parent, ==, NULL); - err = dbuf_findbp(dn, level, blkid, fail_sparse, &parent, &bp); - if (fail_sparse) { - if (err == 0 && bp && BP_IS_HOLE(bp)) - err = SET_ERROR(ENOENT); - if (err) { - if (parent) - dbuf_rele(parent, NULL); - return (err); + ASSERT3P(dh->dh_parent, ==, NULL); + dh->dh_err = dbuf_findbp(dh->dh_dn, dh->dh_level, dh->dh_blkid, + dh->dh_fail_sparse, &dh->dh_parent, &dh->dh_bp, dh); + if (dh->dh_fail_sparse) { + if (dh->dh_err == 0 && + dh->dh_bp && BP_IS_HOLE(dh->dh_bp)) + dh->dh_err = SET_ERROR(ENOENT); + if (dh->dh_err) { + if (dh->dh_parent) + dbuf_rele(dh->dh_parent, NULL); + return (dh->dh_err); } } - if (err && err != ENOENT) - return (err); - db = dbuf_create(dn, level, blkid, parent, bp); + if (dh->dh_err && dh->dh_err != ENOENT) + return (dh->dh_err); + dh->dh_db = dbuf_create(dh->dh_dn, dh->dh_level, dh->dh_blkid, + dh->dh_parent, dh->dh_bp); } - if (fail_uncached && db->db_state != DB_CACHED) { - mutex_exit(&db->db_mtx); + if (dh->dh_fail_uncached && dh->dh_db->db_state != DB_CACHED) { + mutex_exit(&dh->dh_db->db_mtx); return (SET_ERROR(ENOENT)); } - if (db->db_buf != NULL) { - arc_buf_access(db->db_buf); - ASSERT3P(db->db.db_data, ==, db->db_buf->b_data); + if (dh->dh_db->db_buf != NULL) { + arc_buf_access(dh->dh_db->db_buf); + ASSERT3P(dh->dh_db->db.db_data, ==, dh->dh_db->db_buf->b_data); } - ASSERT(db->db_buf == NULL || arc_referenced(db->db_buf)); + ASSERT(dh->dh_db->db_buf == NULL || arc_referenced(dh->dh_db->db_buf)); /* * If this buffer is currently syncing out, and we are are * still referencing it from db_data, we need to make a copy * of it in case we decide we want to dirty it again in this txg. */ - if (db->db_level == 0 && db->db_blkid != DMU_BONUS_BLKID && - dn->dn_object != DMU_META_DNODE_OBJECT && - db->db_state == DB_CACHED && db->db_data_pending) { - dbuf_dirty_record_t *dr = db->db_data_pending; - - if (dr->dt.dl.dr_data == db->db_buf) { - arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - - dbuf_set_data(db, - arc_alloc_buf(dn->dn_objset->os_spa, db, type, - db->db.db_size)); - bcopy(dr->dt.dl.dr_data->b_data, db->db.db_data, - db->db.db_size); - } + if (dh->dh_db->db_level == 0 && + dh->dh_db->db_blkid != DMU_BONUS_BLKID && + dh->dh_dn->dn_object != DMU_META_DNODE_OBJECT && + dh->dh_db->db_state == DB_CACHED && dh->dh_db->db_data_pending) { + dh->dh_dr = dh->dh_db->db_data_pending; + if (dh->dh_dr->dt.dl.dr_data == dh->dh_db->db_buf) + dbuf_hold_copy(dh); } - if (multilist_link_active(&db->db_cache_link)) { - ASSERT(refcount_is_zero(&db->db_holds)); - ASSERT(db->db_caching_status == DB_DBUF_CACHE || - db->db_caching_status == DB_DBUF_METADATA_CACHE); + if (multilist_link_active(&dh->dh_db->db_cache_link)) { + ASSERT(refcount_is_zero(&dh->dh_db->db_holds)); + ASSERT(dh->dh_db->db_caching_status == DB_DBUF_CACHE || + dh->dh_db->db_caching_status == DB_DBUF_METADATA_CACHE); - multilist_remove(dbuf_caches[db->db_caching_status].cache, db); + multilist_remove( + dbuf_caches[dh->dh_db->db_caching_status].cache, + dh->dh_db); (void) refcount_remove_many( - &dbuf_caches[db->db_caching_status].size, - db->db.db_size, db); + &dbuf_caches[dh->dh_db->db_caching_status].size, + dh->dh_db->db.db_size, dh->dh_db); - db->db_caching_status = DB_NO_CACHE; + dh->dh_db->db_caching_status = DB_NO_CACHE; } - (void) refcount_add(&db->db_holds, tag); - DBUF_VERIFY(db); - mutex_exit(&db->db_mtx); + (void) refcount_add(&dh->dh_db->db_holds, dh->dh_tag); + DBUF_VERIFY(dh->dh_db); + mutex_exit(&dh->dh_db->db_mtx); /* NOTE: we can't rele the parent until after we drop the db_mtx */ - if (parent) - dbuf_rele(parent, NULL); + if (dh->dh_parent) + dbuf_rele(dh->dh_parent, NULL); - ASSERT3P(DB_DNODE(db), ==, dn); - ASSERT3U(db->db_blkid, ==, blkid); - ASSERT3U(db->db_level, ==, level); - *dbp = db; + ASSERT3P(DB_DNODE(dh->dh_db), ==, dh->dh_dn); + ASSERT3U(dh->dh_db->db_blkid, ==, dh->dh_blkid); + ASSERT3U(dh->dh_db->db_level, ==, dh->dh_level); + *(dh->dh_dbp) = dh->dh_db; return (0); +} + +/* + * The following code preserves the recursive function dbuf_hold_impl() + * but moves the local variables AND function arguments to the heap to + * minimize the stack frame size. Enough space is initially allocated + * on the stack for 20 levels of recursion. + */ +int +dbuf_hold_impl(dnode_t *dn, uint8_t level, uint64_t blkid, + boolean_t fail_sparse, boolean_t fail_uncached, + void *tag, dmu_buf_impl_t **dbp) +{ + struct dbuf_hold_impl_data *dh; + int error; + + dh = kmem_alloc(sizeof (struct dbuf_hold_impl_data) * + DBUF_HOLD_IMPL_MAX_DEPTH, KM_SLEEP); + __dbuf_hold_impl_init(dh, dn, level, blkid, fail_sparse, + fail_uncached, tag, dbp, 0); + + error = __dbuf_hold_impl(dh); + + kmem_free(dh, sizeof (struct dbuf_hold_impl_data) * + DBUF_HOLD_IMPL_MAX_DEPTH); + + return (error); +} + +static void +__dbuf_hold_impl_init(struct dbuf_hold_impl_data *dh, + dnode_t *dn, uint8_t level, uint64_t blkid, + boolean_t fail_sparse, boolean_t fail_uncached, + void *tag, dmu_buf_impl_t **dbp, int depth) +{ + dh->dh_dn = dn; + dh->dh_level = level; + dh->dh_blkid = blkid; + + dh->dh_fail_sparse = fail_sparse; + dh->dh_fail_uncached = fail_uncached; + + dh->dh_tag = tag; + dh->dh_dbp = dbp; + + dh->dh_db = NULL; + dh->dh_parent = NULL; + dh->dh_bp = NULL; + dh->dh_err = 0; + dh->dh_dr = NULL; + + dh->dh_depth = depth; } dmu_buf_impl_t * From owner-svn-src-all@freebsd.org Sun Aug 12 03:15: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 3CD0A10614B9; Sun, 12 Aug 2018 03:15:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC38175505; Sun, 12 Aug 2018 03:15:30 +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 A37DB2068D; Sun, 12 Aug 2018 03:15:30 +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 w7C3FUNA056998; Sun, 12 Aug 2018 03:15:30 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C3FUtF056997; Sun, 12 Aug 2018 03:15:30 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808120315.w7C3FUtF056997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 12 Aug 2018 03:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337677 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 03:15:31 -0000 Author: mmacy Date: Sun Aug 12 03:15:30 2018 New Revision: 337677 URL: https://svnweb.freebsd.org/changeset/base/337677 Log: MFV/ZoL: Add dbuf hash and dbuf cache kstats TODO: KSTAT_TYPE_NAMED support commit 5e021f56d3437d3523904652fe3cc23ea1f4cb70 Author: Giuseppe Di Natale Date: Mon Jan 29 10:24:52 2018 -0800 Add dbuf hash and dbuf cache kstats Introduce kstats about the dbuf hash and dbuf cache to make it easier to inspect state. This should help with debugging and understanding of these portions of the codebase. Correct format of dbuf kstat file. Introduce a dbc column to dbufs kstat to indicate if a dbuf is in the dbuf cache. Introduce field filtering in the dbufstat python script. Introduce a no header option to the dbufstat python script. Introduce a test case to test basic mru->mfu list movement in the ARC. Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Signed-off-by: Giuseppe Di Natale Closes #6906 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 02:24:18 2018 (r337676) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 12 03:15:30 2018 (r337677) @@ -51,6 +51,103 @@ #include #include +kstat_t *dbuf_ksp; + +typedef struct dbuf_stats { + /* + * Various statistics about the size of the dbuf cache. + */ + kstat_named_t cache_count; + kstat_named_t cache_size_bytes; + kstat_named_t cache_size_bytes_max; + /* + * Statistics regarding the bounds on the dbuf cache size. + */ + kstat_named_t cache_target_bytes; + kstat_named_t cache_lowater_bytes; + kstat_named_t cache_hiwater_bytes; + /* + * Total number of dbuf cache evictions that have occurred. + */ + kstat_named_t cache_total_evicts; + /* + * The distribution of dbuf levels in the dbuf cache and + * the total size of all dbufs at each level. + */ + kstat_named_t cache_levels[DN_MAX_LEVELS]; + kstat_named_t cache_levels_bytes[DN_MAX_LEVELS]; + /* + * Statistics about the dbuf hash table. + */ + kstat_named_t hash_hits; + kstat_named_t hash_misses; + kstat_named_t hash_collisions; + kstat_named_t hash_elements; + kstat_named_t hash_elements_max; + /* + * Number of sublists containing more than one dbuf in the dbuf + * hash table. Keep track of the longest hash chain. + */ + kstat_named_t hash_chains; + kstat_named_t hash_chain_max; + /* + * Number of times a dbuf_create() discovers that a dbuf was + * already created and in the dbuf hash table. + */ + kstat_named_t hash_insert_race; + /* + * Statistics about the size of the metadata dbuf cache. + */ + kstat_named_t metadata_cache_count; + kstat_named_t metadata_cache_size_bytes; + kstat_named_t metadata_cache_size_bytes_max; + /* + * For diagnostic purposes, this is incremented whenever we can't add + * something to the metadata cache because it's full, and instead put + * the data in the regular dbuf cache. + */ + kstat_named_t metadata_cache_overflow; +} dbuf_stats_t; + +dbuf_stats_t dbuf_stats = { + { "cache_count", KSTAT_DATA_UINT64 }, + { "cache_size_bytes", KSTAT_DATA_UINT64 }, + { "cache_size_bytes_max", KSTAT_DATA_UINT64 }, + { "cache_target_bytes", KSTAT_DATA_UINT64 }, + { "cache_lowater_bytes", KSTAT_DATA_UINT64 }, + { "cache_hiwater_bytes", KSTAT_DATA_UINT64 }, + { "cache_total_evicts", KSTAT_DATA_UINT64 }, + { { "cache_levels_N", KSTAT_DATA_UINT64 } }, + { { "cache_levels_bytes_N", KSTAT_DATA_UINT64 } }, + { "hash_hits", KSTAT_DATA_UINT64 }, + { "hash_misses", KSTAT_DATA_UINT64 }, + { "hash_collisions", KSTAT_DATA_UINT64 }, + { "hash_elements", KSTAT_DATA_UINT64 }, + { "hash_elements_max", KSTAT_DATA_UINT64 }, + { "hash_chains", KSTAT_DATA_UINT64 }, + { "hash_chain_max", KSTAT_DATA_UINT64 }, + { "hash_insert_race", KSTAT_DATA_UINT64 }, + { "metadata_cache_count", KSTAT_DATA_UINT64 }, + { "metadata_cache_size_bytes", KSTAT_DATA_UINT64 }, + { "metadata_cache_size_bytes_max", KSTAT_DATA_UINT64 }, + { "metadata_cache_overflow", KSTAT_DATA_UINT64 } +}; + +#define DBUF_STAT_INCR(stat, val) \ + atomic_add_64(&dbuf_stats.stat.value.ui64, (val)); +#define DBUF_STAT_DECR(stat, val) \ + DBUF_STAT_INCR(stat, -(val)); +#define DBUF_STAT_BUMP(stat) \ + DBUF_STAT_INCR(stat, 1); +#define DBUF_STAT_BUMPDOWN(stat) \ + DBUF_STAT_INCR(stat, -1); +#define DBUF_STAT_MAX(stat, v) { \ + uint64_t _m; \ + while ((v) > (_m = dbuf_stats.stat.value.ui64) && \ + (_m != atomic_cas_64(&dbuf_stats.stat.value.ui64, _m, (v))))\ + continue; \ +} + struct dbuf_hold_impl_data { /* Function arguments */ dnode_t *dh_dn; @@ -112,7 +209,7 @@ static boolean_t dbuf_evict_thread_exit; * number of filesystem objects), we stop taking new dbufs into the * metadata cache, instead putting them in the normal dbuf cache. * - * 2. LRU cache of dbufs. The "dbuf cache" maintains a list of dbufs that + * 2. LRU cache of dbufs. The dbuf cache maintains a list of dbufs that * are not currently held but have been recently released. These dbufs * are not eligible for arc eviction until they are aged out of the cache. * Dbufs that are aged out of the cache will be immediately destroyed and @@ -305,13 +402,17 @@ dbuf_hash_insert(dmu_buf_impl_t *db) objset_t *os = db->db_objset; uint64_t obj = db->db.db_object; int level = db->db_level; - uint64_t blkid = db->db_blkid; - uint64_t hv = dbuf_hash(os, obj, level, blkid); - uint64_t idx = hv & h->hash_table_mask; + uint64_t blkid, hv, idx; dmu_buf_impl_t *dbf; + uint32_t i; + blkid = db->db_blkid; + hv = dbuf_hash(os, obj, level, blkid); + idx = hv & h->hash_table_mask; + mutex_enter(DBUF_HASH_MUTEX(h, idx)); - for (dbf = h->hash_table[idx]; dbf != NULL; dbf = dbf->db_hash_next) { + for (dbf = h->hash_table[idx], i = 0; dbf != NULL; + dbf = dbf->db_hash_next, i++) { if (DBUF_EQUAL(dbf, os, obj, level, blkid)) { mutex_enter(&dbf->db_mtx); if (dbf->db_state != DB_EVICTING) { @@ -322,11 +423,20 @@ dbuf_hash_insert(dmu_buf_impl_t *db) } } + if (i > 0) { + DBUF_STAT_BUMP(hash_collisions); + if (i == 1) + DBUF_STAT_BUMP(hash_chains); + + DBUF_STAT_MAX(hash_chain_max, i); + } + mutex_enter(&db->db_mtx); db->db_hash_next = h->hash_table[idx]; h->hash_table[idx] = db; mutex_exit(DBUF_HASH_MUTEX(h, idx)); atomic_inc_64(&dbuf_hash_count); + DBUF_STAT_MAX(hash_elements_max, dbuf_hash_count); return (NULL); } @@ -338,13 +448,15 @@ static void dbuf_hash_remove(dmu_buf_impl_t *db) { dbuf_hash_table_t *h = &dbuf_hash_table; - uint64_t hv = dbuf_hash(db->db_objset, db->db.db_object, - db->db_level, db->db_blkid); - uint64_t idx = hv & h->hash_table_mask; + uint64_t hv, idx; dmu_buf_impl_t *dbf, **dbp; + hv = dbuf_hash(db->db_objset, db->db.db_object, + db->db_level, db->db_blkid); + idx = hv & h->hash_table_mask; + /* - * We musn't hold db_mtx to maintain lock ordering: + * We mustn't hold db_mtx to maintain lock ordering: * DBUF_HASH_MUTEX > db_mtx. */ ASSERT(refcount_is_zero(&db->db_holds)); @@ -359,6 +471,9 @@ dbuf_hash_remove(dmu_buf_impl_t *db) } *dbp = db->db_hash_next; db->db_hash_next = NULL; + if (h->hash_table[idx] && + h->hash_table[idx]->db_hash_next == NULL) + DBUF_STAT_BUMPDOWN(hash_chains); mutex_exit(DBUF_HASH_MUTEX(h, idx)); atomic_dec_64(&dbuf_hash_count); } @@ -524,24 +639,41 @@ dbuf_cache_multilist_index_func(multilist_t *ml, void multilist_get_num_sublists(ml)); } +static inline unsigned long +dbuf_cache_target_bytes(void) +{ + return MIN(dbuf_cache_max_bytes, + arc_max_bytes() >> dbuf_cache_shift); +} + +static inline uint64_t +dbuf_cache_hiwater_bytes(void) +{ + uint64_t dbuf_cache_target = dbuf_cache_target_bytes(); + return (dbuf_cache_target + + (dbuf_cache_target * dbuf_cache_hiwater_pct) / 100); +} + +static inline uint64_t +dbuf_cache_lowater_bytes(void) +{ + uint64_t dbuf_cache_target = dbuf_cache_target_bytes(); + return (dbuf_cache_target - + (dbuf_cache_target * dbuf_cache_lowater_pct) / 100); +} + static inline boolean_t dbuf_cache_above_hiwater(void) { - uint64_t dbuf_cache_hiwater_bytes = - (dbuf_cache_max_bytes * dbuf_cache_hiwater_pct) / 100; - return (refcount_count(&dbuf_caches[DB_DBUF_CACHE].size) > - dbuf_cache_max_bytes + dbuf_cache_hiwater_bytes); + dbuf_cache_hiwater_bytes()); } static inline boolean_t dbuf_cache_above_lowater(void) { - uint64_t dbuf_cache_lowater_bytes = - (dbuf_cache_max_bytes * dbuf_cache_lowater_pct) / 100; - return (refcount_count(&dbuf_caches[DB_DBUF_CACHE].size) > - dbuf_cache_max_bytes - dbuf_cache_lowater_bytes); + dbuf_cache_lowater_bytes()); } /* @@ -569,9 +701,16 @@ dbuf_evict_one(void) multilist_sublist_unlock(mls); (void) refcount_remove_many(&dbuf_caches[DB_DBUF_CACHE].size, db->db.db_size, db); + DBUF_STAT_BUMPDOWN(cache_levels[db->db_level]); + DBUF_STAT_BUMPDOWN(cache_count); + DBUF_STAT_DECR(cache_levels_bytes[db->db_level], + db->db.db_size); ASSERT3U(db->db_caching_status, ==, DB_DBUF_CACHE); db->db_caching_status = DB_NO_CACHE; dbuf_destroy(db); + DBUF_STAT_MAX(cache_size_bytes_max, + refcount_count(&dbuf_caches[DB_DBUF_CACHE].size)); + DBUF_STAT_BUMP(cache_total_evicts); } else { multilist_sublist_unlock(mls); } @@ -641,6 +780,27 @@ dbuf_evict_notify(void) } } +static int +dbuf_kstat_update(kstat_t *ksp, int rw) +{ + dbuf_stats_t *ds = ksp->ks_data; + + if (rw == KSTAT_WRITE) { + return (SET_ERROR(EACCES)); + } else { + ds->metadata_cache_size_bytes.value.ui64 = + refcount_count(&dbuf_caches[DB_DBUF_METADATA_CACHE].size); + ds->cache_size_bytes.value.ui64 = + refcount_count(&dbuf_caches[DB_DBUF_CACHE].size); + ds->cache_target_bytes.value.ui64 = dbuf_cache_target_bytes(); + ds->cache_hiwater_bytes.value.ui64 = dbuf_cache_hiwater_bytes(); + ds->cache_lowater_bytes.value.ui64 = dbuf_cache_lowater_bytes(); + ds->hash_elements.value.ui64 = dbuf_hash_count; + } + + return (0); +} + void dbuf_init(void) { @@ -710,6 +870,31 @@ retry: cv_init(&dbuf_evict_cv, NULL, CV_DEFAULT, NULL); dbuf_cache_evict_thread = thread_create(NULL, 0, dbuf_evict_thread, NULL, 0, &p0, TS_RUN, minclsyspri); + +#ifdef __linux__ + /* + * XXX FreeBSD's SPL lacks KSTAT_TYPE_NAMED support - TODO + */ + dbuf_ksp = kstat_create("zfs", 0, "dbufstats", "misc", + KSTAT_TYPE_NAMED, sizeof (dbuf_stats) / sizeof (kstat_named_t), + KSTAT_FLAG_VIRTUAL); + if (dbuf_ksp != NULL) { + dbuf_ksp->ks_data = &dbuf_stats; + dbuf_ksp->ks_update = dbuf_kstat_update; + kstat_install(dbuf_ksp); + + for (i = 0; i < DN_MAX_LEVELS; i++) { + snprintf(dbuf_stats.cache_levels[i].name, + KSTAT_STRLEN, "cache_level_%d", i); + dbuf_stats.cache_levels[i].data_type = + KSTAT_DATA_UINT64; + snprintf(dbuf_stats.cache_levels_bytes[i].name, + KSTAT_STRLEN, "cache_level_%d_bytes", i); + dbuf_stats.cache_levels_bytes[i].data_type = + KSTAT_DATA_UINT64; + } + } +#endif } void @@ -741,6 +926,11 @@ dbuf_fini(void) refcount_destroy(&dbuf_caches[dcs].size); multilist_destroy(dbuf_caches[dcs].cache); } + + if (dbuf_ksp != NULL) { + kstat_delete(dbuf_ksp); + dbuf_ksp = NULL; + } } /* @@ -1225,6 +1415,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t fla if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); + DBUF_STAT_BUMP(hash_hits); } else if (db->db_state == DB_UNCACHED) { spa_t *spa = dn->dn_objset->os_spa; boolean_t need_wait = B_FALSE; @@ -1244,6 +1435,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t fla if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); + DBUF_STAT_BUMP(hash_misses); if (need_wait) err = zio_wait(zio); @@ -1262,6 +1454,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t fla if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); + DBUF_STAT_BUMP(hash_misses); /* Skip the wait per the caller's request. */ mutex_enter(&db->db_mtx); @@ -1673,6 +1866,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx) * transaction group won't leak out when we sync the older txg. */ dr = kmem_zalloc(sizeof (dbuf_dirty_record_t), KM_SLEEP); + list_link_init(&dr->dr_dirty_node); if (db->db_level == 0) { void *data_old = db->db_buf; @@ -2149,6 +2343,14 @@ dbuf_destroy(dmu_buf_impl_t *db) &dbuf_caches[db->db_caching_status].size, db->db.db_size, db); + if (db->db_caching_status == DB_DBUF_METADATA_CACHE) { + DBUF_STAT_BUMPDOWN(metadata_cache_count); + } else { + DBUF_STAT_BUMPDOWN(cache_levels[db->db_level]); + DBUF_STAT_BUMPDOWN(cache_count); + DBUF_STAT_DECR(cache_levels_bytes[db->db_level], + db->db.db_size); + } db->db_caching_status = DB_NO_CACHE; } @@ -2382,6 +2584,7 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid /* someone else inserted it first */ kmem_cache_free(dbuf_kmem_cache, db); mutex_exit(&dn->dn_dbufs_mtx); + DBUF_STAT_BUMP(hash_insert_race); return (odb); } avl_add(&dn->dn_dbufs, db); @@ -2774,6 +2977,14 @@ __dbuf_hold_impl(struct dbuf_hold_impl_data *dh) &dbuf_caches[dh->dh_db->db_caching_status].size, dh->dh_db->db.db_size, dh->dh_db); + if (dh->dh_db->db_caching_status == DB_DBUF_METADATA_CACHE) { + DBUF_STAT_BUMPDOWN(metadata_cache_count); + } else { + DBUF_STAT_BUMPDOWN(cache_levels[dh->dh_db->db_level]); + DBUF_STAT_BUMPDOWN(cache_count); + DBUF_STAT_DECR(cache_levels_bytes[dh->dh_db->db_level], + dh->dh_db->db.db_size); + } dh->dh_db->db_caching_status = DB_NO_CACHE; } (void) refcount_add(&dh->dh_db->db_holds, dh->dh_tag); @@ -3063,6 +3274,24 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, bo multilist_insert(dbuf_caches[dcs].cache, db); (void) refcount_add_many(&dbuf_caches[dcs].size, db->db.db_size, db); + + if (dcs == DB_DBUF_METADATA_CACHE) { + DBUF_STAT_BUMP(metadata_cache_count); + DBUF_STAT_MAX( + metadata_cache_size_bytes_max, + refcount_count( + &dbuf_caches[dcs].size)); + } else { + DBUF_STAT_BUMP( + cache_levels[db->db_level]); + DBUF_STAT_BUMP(cache_count); + DBUF_STAT_INCR( + cache_levels_bytes[db->db_level], + db->db.db_size); + DBUF_STAT_MAX(cache_size_bytes_max, + refcount_count( + &dbuf_caches[dcs].size)); + } mutex_exit(&db->db_mtx); if (db->db_caching_status == DB_DBUF_CACHE && @@ -3888,7 +4117,8 @@ dbuf_remap(dnode_t *dn, dmu_buf_impl_t *db, dmu_tx_t * dnode_phys_t *dnp = db->db.db_data; ASSERT3U(db->db_dnode_handle->dnh_dnode->dn_type, ==, DMU_OT_DNODE); - for (int i = 0; i < db->db.db_size >> DNODE_SHIFT; i++) { + for (int i = 0; i < db->db.db_size >> DNODE_SHIFT; + i += dnp[i].dn_extra_slots + 1) { for (int j = 0; j < dnp[i].dn_nblkptr; j++) { dbuf_remap_impl(dn, &dnp[i].dn_blkptr[j], tx); } From owner-svn-src-all@freebsd.org Sun Aug 12 03:22: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 1BB9D1061863; Sun, 12 Aug 2018 03:22:29 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C428A75A32; Sun, 12 Aug 2018 03:22:28 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4BDA20838; Sun, 12 Aug 2018 03:22:28 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7C3MSYC062077; Sun, 12 Aug 2018 03:22:28 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C3MSgD062076; Sun, 12 Aug 2018 03:22:28 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201808120322.w7C3MSgD062076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Sun, 12 Aug 2018 03:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337678 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: truckman X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 337678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 03:22:29 -0000 Author: truckman Date: Sun Aug 12 03:22:28 2018 New Revision: 337678 URL: https://svnweb.freebsd.org/changeset/base/337678 Log: MFC r336855 Fix the long term ULE load balancer so that it actually works. The initial call to sched_balance() during startup is meant to initialize balance_ticks, but does not actually do that since smp_started is still zero at that time. Since balance_ticks does not get set, there are no further calls to sched_balance(). Fix this by setting balance_ticks in sched_initticks() since we know the value of balance_interval at that time, and eliminate the useless startup call to sched_balance(). We don't need to randomize the intial value of balance_ticks. Since there is now only one call to sched_balance(), we can hoist the tests at the top of this function out to the caller and avoid the overhead of the function call when running a SMP kernel on UP hardware. PR: 223914 Reviewed by: kib Modified: stable/11/sys/kern/sched_ule.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/sched_ule.c ============================================================================== --- stable/11/sys/kern/sched_ule.c Sun Aug 12 03:15:30 2018 (r337677) +++ stable/11/sys/kern/sched_ule.c Sun Aug 12 03:22:28 2018 (r337678) @@ -882,9 +882,6 @@ sched_balance(void) { struct tdq *tdq; - if (smp_started == 0 || rebalance == 0) - return; - balance_ticks = max(balance_interval / 2, 1) + (sched_random() % balance_interval); tdq = TDQ_SELF(); @@ -1408,7 +1405,6 @@ sched_setup_smp(void) panic("Can't find cpu group for %d\n", i); } balance_tdq = TDQ_SELF(); - sched_balance(); } #endif @@ -1469,6 +1465,7 @@ sched_initticks(void *dummy) * what realstathz is. */ balance_interval = realstathz; + balance_ticks = balance_interval; affinity = SCHED_AFFINITY_DEFAULT; #endif if (sched_idlespinthresh < 0) @@ -2384,7 +2381,7 @@ sched_clock(struct thread *td) /* * We run the long term load balancer infrequently on the first cpu. */ - if (balance_tdq == tdq) { + if (balance_tdq == tdq && smp_started != 0 && rebalance != 0) { if (balance_ticks && --balance_ticks == 0) sched_balance(); } From owner-svn-src-all@freebsd.org Sun Aug 12 03:36: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 939E31061CE5; Sun, 12 Aug 2018 03:36:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49CB47606B; Sun, 12 Aug 2018 03:36:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ADF5209EE; Sun, 12 Aug 2018 03:36:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7C3a93U067217; Sun, 12 Aug 2018 03:36:09 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C3a9xU067216; Sun, 12 Aug 2018 03:36:09 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808120336.w7C3a9xU067216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 12 Aug 2018 03:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337679 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 337679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 03:36:10 -0000 Author: np Date: Sun Aug 12 03:36:09 2018 New Revision: 337679 URL: https://svnweb.freebsd.org/changeset/base/337679 Log: Remove unused stuff from iw_cxgbe.h Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Sun Aug 12 03:22:28 2018 (r337678) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Sun Aug 12 03:36:09 2018 (r337679) @@ -978,20 +978,4 @@ u32 c4iw_get_qpid(struct c4iw_rdev *rdev, struct c4iw_ void c4iw_put_qpid(struct c4iw_rdev *rdev, u32 qid, struct c4iw_dev_ucontext *uctx); void c4iw_ev_dispatch(struct c4iw_dev *dev, struct t4_cqe *err_cqe); -void __iomem *c4iw_bar2_addrs(struct c4iw_rdev *rdev, unsigned int qid, - enum t4_bar2_qtype qtype, - unsigned int *pbar2_qid, u64 *pbar2_pa); -extern struct cxgb4_client t4c_client; -extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS]; - -#if defined(__i386__) || defined(__amd64__) -#define L1_CACHE_BYTES 128 -#else -#define L1_CACHE_BYTES 32 -#endif - -void your_reg_device(struct c4iw_dev *dev); - -#define SGE_CTRLQ_NUM 0 - #endif From owner-svn-src-all@freebsd.org Sun Aug 12 05:23: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 A6D5E1064C78; Sun, 12 Aug 2018 05:23:41 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A5EB79565; Sun, 12 Aug 2018 05:23:40 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.181.241.189]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M8JyQ-1g9z5X177C-00vyB9; Sun, 12 Aug 2018 07:23:29 +0200 Date: Sun, 12 Aug 2018 07:22:54 +0200 From: "O. Hartmann" To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337670 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys Message-ID: <20180812072321.1a74466a@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201808120110.w7C1AIL1087851@repo.freebsd.org> References: <201808120110.w7C1AIL1087851@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:uqeOQS3IvPvvP8JDSloZW7PKEBVHSueTkB6R8ok6pXUUtQCK3Xy olaY8hiL7V4ZhsaUYl7dkhzSvNQ3dSvIaGLN9Yr5xiXa87vtLJSU4wAQQPAL989QN9rHleC snhzEvlhgvkfOtkPd47UFa/Yfw/0cRU+1EsMKrNrKduDvjjGMl5R8I0+FOZ7htgXNdqaHBP chhDsNOnRUK7rYPcsfr1A== X-UI-Out-Filterresults: notjunk:1;V01:K0:GUxWh0JgUf8=:GxnrVZTA3Gm/34xVNykp9C U7bPhZ1mVAaFYxBQiQJl9SyEwCdJ04Gzvkhlu0qFmxVBnlvKDwQ+ek/tJVWYWuKfW+A+54Kmj D3os2szn9WhbtLL7OD8ROWslxgB4qkYksxZhK6uXVaWRcl4H4xl3BYDbdwSy4NkoEgJ5NuVHc TegmHpFLptiaKZQ1nKDouPvyjYWCCyf+OfFojB3VM8/HSp2vdrQ6g8aw4lvWtIonYaW127g/m yG9DWApKlEC0HMmJ5Ns0JzG8PxlclW6krRJzghtkEbAR4gHYN8cazI0ztXnDYIRUgQ1ZW26Jy Is/+gKxz4at8ZIDMsnYm6Mi05g+vFG4kOG46Arc3XIPyN0atZ5JJUZg9bj60i5RyfrnPkCD/v 55bL1FE1PVjDOwg9NMkPYlSQcL5dTDLrHtU2Zmwn4Q92nxcfyXyKejzIHxDmTi9a+f8tTQKGI 7VTxNrL2wV+C+juy3iI7sDyXudB1R2IS15xhwS+yqe3KsB+/yjraoezw/9lGhN8YD9Scd90xd +Dz131xsnCJDoI9B81Ayl3eyPatHa5zrL07Nh+a4c3zHpeW0/KX6lIwuBRW3BTH/qh4A2myuW 7Oir8N2hFqWie7WrtH2ElVYE8V8Qsa3k8ECWZ3ZaFCF7/ykCrv3D9nJoAFpc35hpgJ97+gDL5 bZCo9xZN6Wol0riEzFUu9hSh5b3Q/JmSGshBWcH3LFBR/d8N9Zs0IooYg1jx9LxtFmGzt8tez V9vwYnveNizMrSKoEg4ky29S0cPf7iZKuAJfhOQ3EtlW0ittz2XA/JxuI/DMMy2082lg1hIWC 2NzJsv/ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 05:23:42 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFN1 biwgMTIgQXVnIDIwMTggMDE6MTA6MTggKzAwMDAgKFVUQykNCk1hdHQgTWFjeSA8bW1hY3lARnJl ZUJTRC5vcmc+IHNjaHJpZWI6DQoNCj4gQXV0aG9yOiBtbWFjeQ0KPiBEYXRlOiBTdW4gQXVnIDEy IDAxOjEwOjE4IDIwMTgNCj4gTmV3IFJldmlzaW9uOiAzMzc2NzANCj4gVVJMOiBodHRwczovL3N2 bndlYi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8zMzc2NzANCj4gDQo+IExvZzoNCj4gICBN RlYvWm9MOiBhZGQgZGJ1ZiBzdGF0cw0KPiAgIA0KPiAgIE5COiBkaXNhYmxlZCBwZW5kaW5nIHRo ZSBhZGRpdGlvbiBvZiBLU1RBVF9UWVBFX1JBVyBzdXBwb3J0IHRvIHRoZQ0KPiAgIFNQTA0KPiAg IA0KPiAgIGNvbW1pdCBlMGIwY2E5ODNkNjg5N2JjZGRmMDVhZjJjMGU1ZDAxZmY2NmY5MGRiDQo+ ICAgQXV0aG9yOiBCcmlhbiBCZWhsZW5kb3JmIDxiZWhsZW5kb3JmMUBsbG5sLmdvdj4NCj4gICBE YXRlOiAgIFdlZCBPY3QgMiAxNzoxMToxOSAyMDEzIC0wNzAwDQo+ICAgDQo+ICAgICAgIEFkZCB2 aXNpYmlsaXR5IGluIHRvIGNhY2hlZCBkYnVmcw0KPiAgIA0KPiAgICAgICBDdXJyZW50bHkgdGhl cmUgaXMgbm8gbWVjaGFuaXNtIHRvIGluc3BlY3Qgd2hpY2ggZGJ1ZnMgYXJlIGJlaW5nDQo+ICAg ICAgIGNhY2hlZCBieSB0aGUgc3lzdGVtLiAgVGhlcmUgYXJlIHNvbWUgY29hcnNlIGNvdW50ZXJz IGluIGFyY3N0YXRzDQo+ICAgICAgIGJ5IHRoZXkgb25seSBnaXZlIGEgcm91Z2ggaWRlYSBvZiB3 aGF0J3MgYmVpbmcgY2FjaGVkLiAgVGhpcyBwYXRjaA0KPiAgICAgICBhaW1zIHRvIGltcHJvdmUg dGhlIGN1cnJlbnQgc2l0dWF0aW9uIGJ5IGFkZGluZyBhIG5ldyBkYnVmcyBrc3RhdC4NCj4gICAN Cj4gICAgICAgV2hlbiByZWFkIHRoaXMgbmV3IGtzdGF0IHdpbGwgd2FsayBhbGwgY2FjaGVkIGRi dWZzIGxpbmtlZCBpbiB0bw0KPiAgICAgICB0aGUgZGJ1Zl9oYXNoLiAgRm9yIGVhY2ggZGJ1ZiBp dCB3aWxsIGR1bXAgZGV0YWlsZWQgaW5mb3JtYXRpb24NCj4gICAgICAgYWJvdXQgdGhlIGJ1ZmZl ci4gIEl0IHdpbGwgYWxzbyBkdW1wIGFkZGl0aW9uYWwgaW5mb3JtYXRpb24gYWJvdXQNCj4gICAg ICAgdGhlIHJlZmVyZW5jZWQgYXJjIGJ1ZmZlciBhbmQgaXRzIHJlbGF0ZWQgZG5vZGUuICBUaGlz IHByb3ZpZGVzIGENCj4gICAgICAgbW9yZSBjb21wbGV0ZSB2aWV3IGluIHRvIGV4YWN0bHkgd2hh dCBpcyBiZWluZyBjYWNoZWQuDQo+ICAgDQo+ICAgICAgIFdpdGggdGhpcyBnZW5lcmljIGluZnJh c3RydWN0dXJlIGluIHBsYWNlIHV0aWxpdGllcyBjYW4gYmUgd3JpdHRlbg0KPiAgICAgICB0byBw b3N0LXByb2Nlc3MgdGhlIGRhdGEgdG8gdW5kZXJzdGFuZCBleGFjdGx5IGhvdyB0aGUgY2FjaGlu ZyBpcw0KPiAgICAgICB3b3JraW5nLiAgRm9yIGV4YW1wbGUsIHRoZSBkYXRhIGNvdWxkIGJlIHBy b2Nlc3NlZCB0byBzaG93IGEgbGlzdA0KPiAgICAgICBvZiBhbGwgY2FjaGVkIGRub2RlcyBhbmQg aG93IG11Y2ggc3BhY2UgdGhleSdyZSBjb25zdW1pbmcuICBPciBhDQo+ICAgICAgIHNpbWlsYXIg bGlzdCBjb3VsZCBiZSBnZW5lcmF0ZWQgYmFzZWQgb24gZG5vZGUgdHlwZS4gIE1hbnkgb3RoZXIN Cj4gICAgICAgd2F5cyB0byBpbnRlcnByZXQgdGhlIGRhdGEgZXhpc3QgYmFzZWQgb24gd2hhdCBr aW5kcyBvZiBxdWVzdGlvbnMNCj4gICAgICAgeW91J3JlIHRyeWluZyB0byBhbnN3ZXIuDQo+ICAg DQo+ICAgICAgIFNpZ25lZC1vZmYtYnk6IEJyaWFuIEJlaGxlbmRvcmYgPGJlaGxlbmRvcmYxQGxs bmwuZ292Pg0KPiAgICAgICBTaWduZWQtb2ZmLWJ5OiBQcmFrYXNoIFN1cnlhIDxzdXJ5YTFAbGxu bC5nb3Y+DQo+IA0KPiBBZGRlZDoNCj4gICBoZWFkL3N5cy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFy aXMvdXRzL2NvbW1vbi9mcy96ZnMvZGJ1Zl9zdGF0cy5jDQo+IE1vZGlmaWVkOg0KPiAgIGhlYWQv c3lzL2NkZGwvY29tcGF0L29wZW5zb2xhcmlzL3N5cy9rc3RhdC5oDQo+ICAgaGVhZC9zeXMvY2Rk bC9jb250cmliL29wZW5zb2xhcmlzL3V0cy9jb21tb24vTWFrZWZpbGUuZmlsZXMNCj4gICBoZWFk L3N5cy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9mcy96ZnMvYXJjLmMNCj4g ICBoZWFkL3N5cy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9mcy96ZnMvZGJ1 Zi5jDQo+ICAgaGVhZC9zeXMvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMv emZzL2RtdS5jDQo+ICAgaGVhZC9zeXMvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3V0cy9jb21t b24vZnMvemZzL3N5cy9hcmMuaA0KPiAgIGhlYWQvc3lzL2NkZGwvY29udHJpYi9vcGVuc29sYXJp cy91dHMvY29tbW9uL2ZzL3pmcy9zeXMvZGJ1Zi5oDQo+ICAgaGVhZC9zeXMvY2RkbC9jb250cmli L29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZzL3N5cy9kbXUuaA0KPiANCj4gTW9kaWZpZWQ6 IGhlYWQvc3lzL2NkZGwvY29tcGF0L29wZW5zb2xhcmlzL3N5cy9rc3RhdC5oDQo+ID09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvY2RkbC9jb21wYXQvb3BlbnNvbGFyaXMvc3lz L2tzdGF0LmgJU3VuIEF1ZyAxMiAwMDo0NTo1MyAyMDE4DQo+IChyMzM3NjY5KSArKysgaGVhZC9z eXMvY2RkbC9jb21wYXQvb3BlbnNvbGFyaXMvc3lzL2tzdGF0LmgJU3VuIEF1ZyAxMiAwMToxMDox OA0KPiAyMDE4CShyMzM3NjcwKSBAQCAtMzEsNyArMzEsMTggQEANCj4gIA0KPiAgI2luY2x1ZGUg PHN5cy9zeXNjdGwuaD4NCj4gIA0KPiAtI2RlZmluZQlLU1RBVF9UWVBFX05BTUVECTENCj4gKyNk ZWZpbmUJS1NUQVRfVFlQRV9SQVcJCTAJLyogY2FuIGJlIGFueXRoaW5nICovDQo+ICsJCQkJCS8q IGtzX25kYXRhID49IDEgKi8NCj4gKyNkZWZpbmUJS1NUQVRfVFlQRV9OQU1FRAkxCS8qIG5hbWUv dmFsdWUgcGFpciAqLw0KPiArCQkJCQkvKiBrc19uZGF0YSA+PSAxICovDQo+ICsjZGVmaW5lCUtT VEFUX1RZUEVfSU5UUgkJMgkvKiBpbnRlcnJ1cHQgc3RhdGlzdGljcyAqLw0KPiArCQkJCQkvKiBr c19uZGF0YSA9PSAxICovDQo+ICsjZGVmaW5lCUtTVEFUX1RZUEVfSU8JCTMJLyogSS9PIHN0YXRp c3RpY3MgKi8NCj4gKwkJCQkJLyoga3NfbmRhdGEgPT0gMSAqLw0KPiArI2RlZmluZQlLU1RBVF9U WVBFX1RJTUVSCTQJLyogZXZlbnQgdGltZXIgKi8NCj4gKwkJCQkJLyoga3NfbmRhdGEgPj0gMSAq Lw0KPiArDQo+ICsjZGVmaW5lCUtTVEFUX05VTV9UWVBFUwkJNQ0KPiAgDQo+ICAjZGVmaW5lCUtT VEFUX0ZMQUdfVklSVFVBTAkweDAxDQo+ICANCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N5cy9jZGRs L2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9NYWtlZmlsZS5maWxlcw0KPiA9PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT0NCj4gLS0tIGhlYWQvc3lzL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy91 dHMvY29tbW9uL01ha2VmaWxlLmZpbGVzCVN1biBBdWcgMTINCj4gMDA6NDU6NTMgMjAxOAkocjMz NzY2OSkgKysrDQo+IGhlYWQvc3lzL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy91dHMvY29tbW9u L01ha2VmaWxlLmZpbGVzCVN1biBBdWcgMTIgMDE6MTA6MTgNCj4gMjAxOAkocjMzNzY3MCkgQEAg LTcyLDYgKzcyLDcgQEAgWkZTX0NPTU1PTl9PQkpTICs9CQlcDQo+IGJxdWV1ZS5vCQlcIGNpdHlo YXNoLm8JCVwNCj4gIAlkYnVmLm8JCQlcDQo+ICsJZGJ1Zl9zdGF0cy5vCQlcDQo+ICAJZGR0Lm8J CQlcDQo+ICAJZGR0X3phcC5vCQlcDQo+ICAJZG11Lm8JCQlcDQo+IA0KPiBNb2RpZmllZDogaGVh ZC9zeXMvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZzL2FyYy5jDQo+ ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvY2RkbC9jb250cmliL29wZW5z b2xhcmlzL3V0cy9jb21tb24vZnMvemZzL2FyYy5jCVN1biBBdWcgMTINCj4gMDA6NDU6NTMgMjAx OAkocjMzNzY2OSkgKysrDQo+IGhlYWQvc3lzL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy91dHMv Y29tbW9uL2ZzL3pmcy9hcmMuYwlTdW4gQXVnIDEyIDAxOjEwOjE4DQo+IDIwMTgJKHIzMzc2NzAp IEBAIC01MjMsNiArNTIzLDEwIEBAIHR5cGVkZWYgc3RydWN0IGFyY19zdGF0ZSB7DQo+ICAJICog bm9uLWV2aWN0YWJsZSwgQVJDX0JVRkNfREFUQSwgYW5kIEFSQ19CVUZDX01FVEFEQVRBLg0KPiAg CSAqLw0KPiAgCXJlZmNvdW50X3QgYXJjc19zaXplOw0KPiArCS8qDQo+ICsJICogc3VwcG9ydHMg dGhlICJkYnVmcyIga3N0YXQNCj4gKwkgKi8NCj4gKwlhcmNfc3RhdGVfdHlwZV90IGFyY3Nfc3Rh dGU7DQo+ICB9IGFyY19zdGF0ZV90Ow0KPiAgDQo+ICAvKg0KPiBAQCAtMTExMSw2ICsxMTE1LDEx IEBAIHR5cGVkZWYgc3RydWN0IGwxYXJjX2J1Zl9oZHIgew0KPiAgDQo+ICAJLyogdXBkYXRlZCBh dG9taWNhbGx5ICovDQo+ICAJY2xvY2tfdAkJCWJfYXJjX2FjY2VzczsNCj4gKwl1aW50MzJfdAkJ Yl9tcnVfaGl0czsNCj4gKwl1aW50MzJfdAkJYl9tcnVfZ2hvc3RfaGl0czsNCj4gKwl1aW50MzJf dAkJYl9tZnVfaGl0czsNCj4gKwl1aW50MzJfdAkJYl9tZnVfZ2hvc3RfaGl0czsNCj4gKwl1aW50 MzJfdAkJYl9sMl9oaXRzOw0KPiAgDQo+ICAJLyogc2VsZiBwcm90ZWN0aW5nICovDQo+ICAJcmVm Y291bnRfdAkJYl9yZWZjbnQ7DQo+IEBAIC0xMTI1LDYgKzExMzQsNyBAQCB0eXBlZGVmIHN0cnVj dCBsMmFyY19idWZfaGRyIHsNCj4gIAkvKiBwcm90ZWN0ZWQgYnkgYXJjX2J1Zl9oZHIgbXV0ZXgg Ki8NCj4gIAlsMmFyY19kZXZfdAkJKmJfZGV2OwkJLyogTDJBUkMgZGV2aWNlICovDQo+ICAJdWlu dDY0X3QJCWJfZGFkZHI7CS8qIGRpc2sgYWRkcmVzcywgb2Zmc2V0IGJ5dGUgKi8NCj4gKwl1aW50 MzJfdAkJYl9oaXRzOw0KPiAgDQo+ICAJbGlzdF9ub2RlX3QJCWJfbDJub2RlOw0KPiAgfSBsMmFy Y19idWZfaGRyX3Q7DQo+IEBAIC0yNTUyLDYgKzI1NjIsNTUgQEAgcmVtb3ZlX3JlZmVyZW5jZShh cmNfYnVmX2hkcl90ICpoZHIsIGttdXRleF90ICpoYXNoX2xvDQo+ICB9DQo+ICANCj4gIC8qDQo+ ICsgKiBSZXR1cm5zIGRldGFpbGVkIGluZm9ybWF0aW9uIGFib3V0IGEgc3BlY2lmaWMgYXJjIGJ1 ZmZlci4gIFdoZW4gdGhlDQo+ICsgKiBzdGF0ZV9pbmRleCBhcmd1bWVudCBpcyBzZXQgdGhlIGZ1 bmN0aW9uIHdpbGwgY2FsY3VsYXRlIHRoZSBhcmMgaGVhZGVyDQo+ICsgKiBsaXN0IHBvc2l0aW9u IGZvciBpdHMgYXJjIHN0YXRlLiAgU2luY2UgdGhpcyByZXF1aXJlcyBhIGxpbmVhciB0cmF2ZXJz YWwNCj4gKyAqIGNhbGxlcnMgYXJlIHN0cm9uZ2x5IGVuY291cmFnZSBub3QgdG8gZG8gdGhpcy4g IEhvd2V2ZXIsIGl0IGNhbiBiZSBoZWxwZnVsDQo+ICsgKiBmb3IgdGFyZ2V0ZWQgYW5hbHlzaXMg c28gdGhlIGZ1bmN0aW9uYWxpdHkgaXMgcHJvdmlkZWQuDQo+ICsgKi8NCj4gK3ZvaWQNCj4gK2Fy Y19idWZfaW5mbyhhcmNfYnVmX3QgKmFiLCBhcmNfYnVmX2luZm9fdCAqYWJpLCBpbnQgc3RhdGVf aW5kZXgpDQo+ICt7DQo+ICsJYXJjX2J1Zl9oZHJfdCAqaGRyID0gYWItPmJfaGRyOw0KPiArCWwx YXJjX2J1Zl9oZHJfdCAqbDFoZHIgPSBOVUxMOw0KPiArCWwyYXJjX2J1Zl9oZHJfdCAqbDJoZHIg PSBOVUxMOw0KPiArCWFyY19zdGF0ZV90ICpzdGF0ZSA9IE5VTEw7DQo+ICsNCj4gKwltZW1zZXQo YWJpLCAwLCBzaXplb2YgKGFyY19idWZfaW5mb190KSk7DQo+ICsNCj4gKwlpZiAoaGRyID09IE5V TEwpDQo+ICsJCXJldHVybjsNCj4gKw0KPiArCWFiaS0+YWJpX2ZsYWdzID0gaGRyLT5iX2ZsYWdz Ow0KPiArDQo+ICsJaWYgKEhEUl9IQVNfTDFIRFIoaGRyKSkgew0KPiArCQlsMWhkciA9ICZoZHIt PmJfbDFoZHI7DQo+ICsJCXN0YXRlID0gbDFoZHItPmJfc3RhdGU7DQo+ICsJfQ0KPiArCWlmIChI RFJfSEFTX0wySERSKGhkcikpDQo+ICsJCWwyaGRyID0gJmhkci0+Yl9sMmhkcjsNCj4gKw0KPiAr CWlmIChsMWhkcikgew0KPiArCQlhYmktPmFiaV9idWZjbnQgPSBsMWhkci0+Yl9idWZjbnQ7DQo+ ICsJCWFiaS0+YWJpX2FjY2VzcyA9IGwxaGRyLT5iX2FyY19hY2Nlc3M7DQo+ICsJCWFiaS0+YWJp X21ydV9oaXRzID0gbDFoZHItPmJfbXJ1X2hpdHM7DQo+ICsJCWFiaS0+YWJpX21ydV9naG9zdF9o aXRzID0gbDFoZHItPmJfbXJ1X2dob3N0X2hpdHM7DQo+ICsJCWFiaS0+YWJpX21mdV9oaXRzID0g bDFoZHItPmJfbWZ1X2hpdHM7DQo+ICsJCWFiaS0+YWJpX21mdV9naG9zdF9oaXRzID0gbDFoZHIt PmJfbWZ1X2dob3N0X2hpdHM7DQo+ICsJCWFiaS0+YWJpX2hvbGRzID0gcmVmY291bnRfY291bnQo JmwxaGRyLT5iX3JlZmNudCk7DQo+ICsJfQ0KPiArDQo+ICsJaWYgKGwyaGRyKSB7DQo+ICsJCWFi aS0+YWJpX2wyYXJjX2RhdHRyID0gbDJoZHItPmJfZGFkZHI7DQo+ICsJCWFiaS0+YWJpX2wyYXJj X2hpdHMgPSBsMmhkci0+Yl9oaXRzOw0KPiArCX0NCj4gKw0KPiArCWFiaS0+YWJpX3N0YXRlX3R5 cGUgPSBzdGF0ZSA/IHN0YXRlLT5hcmNzX3N0YXRlIDogQVJDX1NUQVRFX0FOT047DQo+ICsJYWJp LT5hYmlfc3RhdGVfY29udGVudHMgPSBhcmNfYnVmX3R5cGUoaGRyKTsNCj4gKwlhYmktPmFiaV9z aXplID0gYXJjX2hkcl9zaXplKGhkcik7DQo+ICt9DQo+ICsNCj4gKy8qDQo+ICAgKiBNb3ZlIHRo ZSBzdXBwbGllZCBidWZmZXIgdG8gdGhlIGluZGljYXRlZCBzdGF0ZS4gVGhlIGhhc2ggbG9jaw0K PiAgICogZm9yIHRoZSBidWZmZXIgbXVzdCBiZSBoZWxkIGJ5IHRoZSBjYWxsZXIuDQo+ICAgKi8N Cj4gQEAgLTUyNTgsNiArNTMxNyw3IEBAIGFyY19hY2Nlc3MoYXJjX2J1Zl9oZHJfdCAqaGRyLCBr bXV0ZXhfdCAqaGFzaF9sb2NrKQ0KPiAgCQkJRFRSQUNFX1BST0JFMShuZXdfc3RhdGVfX21mdSwg YXJjX2J1Zl9oZHJfdCAqLCBoZHIpOw0KPiAgCQkJYXJjX2NoYW5nZV9zdGF0ZShhcmNfbWZ1LCBo ZHIsIGhhc2hfbG9jayk7DQo+ICAJCX0NCj4gKwkJYXRvbWljX2luY18zMigmaGRyLT5iX2wxaGRy LmJfbXJ1X2hpdHMpOw0KPiAgCQlBUkNTVEFUX0JVTVAoYXJjc3RhdF9tcnVfaGl0cyk7DQo+ICAJ fSBlbHNlIGlmIChoZHItPmJfbDFoZHIuYl9zdGF0ZSA9PSBhcmNfbXJ1X2dob3N0KSB7DQo+ICAJ CWFyY19zdGF0ZV90CSpuZXdfc3RhdGU7DQo+IEBAIC01MjgzLDYgKzUzNDMsNyBAQCBhcmNfYWNj ZXNzKGFyY19idWZfaGRyX3QgKmhkciwga211dGV4X3QgKmhhc2hfbG9jaykNCj4gIAkJaGRyLT5i X2wxaGRyLmJfYXJjX2FjY2VzcyA9IGRkaV9nZXRfbGJvbHQoKTsNCj4gIAkJYXJjX2NoYW5nZV9z dGF0ZShuZXdfc3RhdGUsIGhkciwgaGFzaF9sb2NrKTsNCj4gIA0KPiArCQlhdG9taWNfaW5jXzMy KCZoZHItPmJfbDFoZHIuYl9tcnVfZ2hvc3RfaGl0cyk7DQo+ICAJCUFSQ1NUQVRfQlVNUChhcmNz dGF0X21ydV9naG9zdF9oaXRzKTsNCj4gIAl9IGVsc2UgaWYgKGhkci0+Yl9sMWhkci5iX3N0YXRl ID09IGFyY19tZnUpIHsNCj4gIAkJLyoNCj4gQEAgLTUyOTUsNiArNTM1Niw3IEBAIGFyY19hY2Nl c3MoYXJjX2J1Zl9oZHJfdCAqaGRyLCBrbXV0ZXhfdCAqaGFzaF9sb2NrKQ0KPiAgCQkgKiB0aGUg aGVhZCBvZiB0aGUgbGlzdCBub3cuDQo+ICAJCSAqLw0KPiAgDQo+ICsJCWF0b21pY19pbmNfMzIo Jmhkci0+Yl9sMWhkci5iX21mdV9oaXRzKTsNCj4gIAkJQVJDU1RBVF9CVU1QKGFyY3N0YXRfbWZ1 X2hpdHMpOw0KPiAgCQloZHItPmJfbDFoZHIuYl9hcmNfYWNjZXNzID0gZGRpX2dldF9sYm9sdCgp Ow0KPiAgCX0gZWxzZSBpZiAoaGRyLT5iX2wxaGRyLmJfc3RhdGUgPT0gYXJjX21mdV9naG9zdCkg ew0KPiBAQCAtNTMxNyw2ICs1Mzc5LDcgQEAgYXJjX2FjY2VzcyhhcmNfYnVmX2hkcl90ICpoZHIs IGttdXRleF90ICpoYXNoX2xvY2spDQo+ICAJCURUUkFDRV9QUk9CRTEobmV3X3N0YXRlX19tZnUs IGFyY19idWZfaGRyX3QgKiwgaGRyKTsNCj4gIAkJYXJjX2NoYW5nZV9zdGF0ZShuZXdfc3RhdGUs IGhkciwgaGFzaF9sb2NrKTsNCj4gIA0KPiArCQlhdG9taWNfaW5jXzMyKCZoZHItPmJfbDFoZHIu Yl9tZnVfZ2hvc3RfaGl0cyk7DQo+ICAJCUFSQ1NUQVRfQlVNUChhcmNzdGF0X21mdV9naG9zdF9o aXRzKTsNCj4gIAl9IGVsc2UgaWYgKGhkci0+Yl9sMWhkci5iX3N0YXRlID09IGFyY19sMmNfb25s eSkgew0KPiAgCQkvKg0KPiBAQCAtNTkxMyw2ICs1OTc2LDcgQEAgdG9wOg0KPiAgDQo+ICAJCQkJ RFRSQUNFX1BST0JFMShsMmFyY19faGl0LCBhcmNfYnVmX2hkcl90ICosIGhkcik7DQo+ICAJCQkJ QVJDU1RBVF9CVU1QKGFyY3N0YXRfbDJfaGl0cyk7DQo+ICsJCQkJYXRvbWljX2luY18zMigmaGRy LT5iX2wyaGRyLmJfaGl0cyk7DQo+ICANCj4gIAkJCQljYiA9IGttZW1femFsbG9jKHNpemVvZiAo bDJhcmNfcmVhZF9jYWxsYmFja190KSwNCj4gIAkJCQkgICAgS01fU0xFRVApOw0KPiANCj4gTW9k aWZpZWQ6IGhlYWQvc3lzL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy91dHMvY29tbW9uL2ZzL3pm cy9kYnVmLmMNCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3N5cy9jZGRsL2Nv bnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9mcy96ZnMvZGJ1Zi5jCVN1biBBdWcgMTINCj4g MDA6NDU6NTMgMjAxOAkocjMzNzY2OSkgKysrDQo+IGhlYWQvc3lzL2NkZGwvY29udHJpYi9vcGVu c29sYXJpcy91dHMvY29tbW9uL2ZzL3pmcy9kYnVmLmMJU3VuIEF1ZyAxMiAwMToxMDoxOA0KPiAy MDE4CShyMzM3NjcwKSBAQCAtNjQ5LDYgKzY0OSw3IEBAIHJldHJ5OiBmb3IgKGkgPSAwOyBpIDwg REJVRl9NVVRFWEVTOyBpKyspDQo+ICAJCW11dGV4X2luaXQoJmgtPmhhc2hfbXV0ZXhlc1tpXSwg TlVMTCwgTVVURVhfREVGQVVMVCwgTlVMTCk7DQo+ICANCj4gKwlkYnVmX3N0YXRzX2luaXQoaCk7 DQo+ICAJLyoNCj4gIAkgKiBTZXR1cCB0aGUgcGFyYW1ldGVycyBmb3IgdGhlIGRidWYgY2FjaGVz LiBXZSBzZXQgdGhlIHNpemVzIG9mIHRoZQ0KPiAgCSAqIGRidWYgY2FjaGUgYW5kIHRoZSBtZXRh ZGF0YSBjYWNoZSB0byAxLzMybmQgYW5kIDEvMTZ0aCAoZGVmYXVsdCkNCj4gQEAgLTY5Miw2ICs2 OTMsOCBAQCBkYnVmX2Zpbmkodm9pZCkNCj4gIHsNCj4gIAlkYnVmX2hhc2hfdGFibGVfdCAqaCA9 ICZkYnVmX2hhc2hfdGFibGU7DQo+ICAJaW50IGk7DQo+ICsNCj4gKwlkYnVmX3N0YXRzX2Rlc3Ry b3koKTsNCj4gIA0KPiAgCWZvciAoaSA9IDA7IGkgPCBEQlVGX01VVEVYRVM7IGkrKykNCj4gIAkJ bXV0ZXhfZGVzdHJveSgmaC0+aGFzaF9tdXRleGVzW2ldKTsNCj4gDQo+IEFkZGVkOiBoZWFkL3N5 cy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9mcy96ZnMvZGJ1Zl9zdGF0cy5j DQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gL2Rldi9udWxsCTAwOjAwOjAwIDE5NzAJ KGVtcHR5LCBiZWNhdXNlIGZpbGUgaXMgbmV3bHkgYWRkZWQpDQo+ICsrKyBoZWFkL3N5cy9jZGRs L2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9mcy96ZnMvZGJ1Zl9zdGF0cy5jCVN1biBB dWcgMTINCj4gMDE6MTA6MTggMjAxOAkocjMzNzY3MCkgQEAgLTAsMCArMSwyNDIgQEANCj4gKy8q DQo+ICsgKiBDRERMIEhFQURFUiBTVEFSVA0KPiArICoNCj4gKyAqIFRoZSBjb250ZW50cyBvZiB0 aGlzIGZpbGUgYXJlIHN1YmplY3QgdG8gdGhlIHRlcm1zIG9mIHRoZQ0KPiArICogQ29tbW9uIERl dmVsb3BtZW50IGFuZCBEaXN0cmlidXRpb24gTGljZW5zZSAodGhlICJMaWNlbnNlIikuDQo+ICsg KiBZb3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhl IExpY2Vuc2UuDQo+ICsgKg0KPiArICogWW91IGNhbiBvYnRhaW4gYSBjb3B5IG9mIHRoZSBsaWNl bnNlIGF0IHVzci9zcmMvT1BFTlNPTEFSSVMuTElDRU5TRQ0KPiArICogb3IgaHR0cDovL3d3dy5v cGVuc29sYXJpcy5vcmcvb3MvbGljZW5zaW5nLg0KPiArICogU2VlIHRoZSBMaWNlbnNlIGZvciB0 aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zDQo+ICsgKiBhbmQgbGlt aXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuDQo+ICsgKg0KPiArICogV2hlbiBkaXN0cmlidXRp bmcgQ292ZXJlZCBDb2RlLCBpbmNsdWRlIHRoaXMgQ0RETCBIRUFERVIgaW4gZWFjaA0KPiArICog ZmlsZSBhbmQgaW5jbHVkZSB0aGUgTGljZW5zZSBmaWxlIGF0IHVzci9zcmMvT1BFTlNPTEFSSVMu TElDRU5TRS4NCj4gKyAqIElmIGFwcGxpY2FibGUsIGFkZCB0aGUgZm9sbG93aW5nIGJlbG93IHRo aXMgQ0RETCBIRUFERVIsIHdpdGggdGhlDQo+ICsgKiBmaWVsZHMgZW5jbG9zZWQgYnkgYnJhY2tl dHMgIltdIiByZXBsYWNlZCB3aXRoIHlvdXIgb3duIGlkZW50aWZ5aW5nDQo+ICsgKiBpbmZvcm1h dGlvbjogUG9ydGlvbnMgQ29weXJpZ2h0IFt5eXl5XSBbbmFtZSBvZiBjb3B5cmlnaHQgb3duZXJd DQo+ICsgKg0KPiArICogQ0RETCBIRUFERVIgRU5EDQo+ICsgKi8NCj4gKw0KPiArI2luY2x1ZGUg PHN5cy96ZnNfY29udGV4dC5oPg0KPiArI2luY2x1ZGUgPHN5cy9kYnVmLmg+DQo+ICsjaW5jbHVk ZSA8c3lzL2RtdV9vYmpzZXQuaD4NCj4gKw0KPiArLyoNCj4gKyAqIENhbGN1bGF0ZSB0aGUgaW5k ZXggb2YgdGhlIGFyYyBoZWFkZXIgZm9yIHRoZSBzdGF0ZSwgZGlzYWJsZWQgYnkgZGVmYXVsdC4N Cj4gKyAqLw0KPiAraW50IHpmc19kYnVmX3N0YXRlX2luZGV4ID0gMDsNCj4gKw0KPiArLyoNCj4g KyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09DQo+ICsgKiBEYnVmIEhhc2ggUmVhZCBSb3V0aW5lcw0KPiAr ICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT0NCj4gKyAqLw0KPiArdHlwZWRlZiBzdHJ1Y3QgZGJ1Zl9zdGF0 c190IHsNCj4gKwlrbXV0ZXhfdAkJbG9jazsNCj4gKwlrc3RhdF90CQkJKmtzdGF0Ow0KPiArCWRi dWZfaGFzaF90YWJsZV90CSpoYXNoOw0KPiArCWludAkJCWlkeDsNCj4gK30gZGJ1Zl9zdGF0c190 Ow0KPiArDQo+ICtzdGF0aWMgZGJ1Zl9zdGF0c190IGRidWZfc3RhdHNfaGFzaF90YWJsZTsNCj4g Kw0KPiArc3RhdGljIGludA0KPiArZGJ1Zl9zdGF0c19oYXNoX3RhYmxlX2hlYWRlcnMoY2hhciAq YnVmLCBzaXplX3Qgc2l6ZSkNCj4gK3sNCj4gKwlzaXplID0gc25wcmludGYoYnVmLCBzaXplIC0g MSwNCj4gKwkgICAgIiUtODhzIHwgJS0xMjRzIHwgJXNcbiINCj4gKwkgICAgIiUtMTZzICUtOHMg JS04cyAlLThzICUtOHMgJS04cyAlLThzICUtNXMgJS01cyAlNXMgfCAiDQo+ICsJICAgICIlLTVz ICUtNXMgJS02cyAlLThzICUtNnMgJS04cyAlLTEycyAiDQo+ICsJICAgICIlLTZzICUtNnMgJS02 cyAlLTZzICUtNnMgJS04cyAlLThzICUtOHMgJS01cyB8ICINCj4gKwkgICAgIiUtNnMgJS02cyAl LThzICUtOHMgJS02cyAlLTZzICUtNXMgJS04cyAlLThzXG4iLA0KPiArCSAgICAiZGJ1ZiIsICJh cmNidWYiLCAiZG5vZGUiLCAicG9vbCIsICJvYmpzZXQiLCAib2JqZWN0IiwgImxldmVsIiwNCj4g KwkgICAgImJsa2lkIiwgIm9mZnNldCIsICJkYnNpemUiLCAibWV0YSIsICJzdGF0ZSIsICJkYmhv bGRzIiwgImxpc3QiLA0KPiArCSAgICAiYXR5cGUiLCAiaW5kZXgiLCAiZmxhZ3MiLCAiY291bnQi LCAiYXNpemUiLCAiYWNjZXNzIiwgIm1ydSIsICJnbXJ1IiwNCj4gKwkgICAgIm1mdSIsICJnbWZ1 IiwgImwyIiwgImwyX2RhdHRyIiwgImwyX2FzaXplIiwgImwyX2NvbXAiLCAiYWhvbGRzIiwNCj4g KwkgICAgImR0eXBlIiwgImJ0eXBlIiwgImRhdGFfYnMiLCAibWV0YV9icyIsICJic2l6ZSIsDQo+ ICsJICAgICJsdmxzIiwgImRob2xkcyIsICJibG9ja3MiLCAiZHNpemUiKTsNCj4gKyAgICAgICAg YnVmW3NpemVdID0gJ1wwJzsNCj4gKw0KPiArCXJldHVybiAoMCk7DQo+ICt9DQo+ICsNCj4gK2lu dA0KPiArX19kYnVmX3N0YXRzX2hhc2hfdGFibGVfZGF0YShjaGFyICpidWYsIHNpemVfdCBzaXpl LCBkbXVfYnVmX2ltcGxfdCAqZGIpDQo+ICt7DQo+ICsJYXJjX2J1Zl9pbmZvX3QgYWJpID0geyAw IH07DQo+ICsJZG11X29iamVjdF9pbmZvX3QgZG9pID0geyAwIH07DQo+ICsJZG5vZGVfdCAqZG4g PSBEQl9ETk9ERShkYik7DQo+ICsNCj4gKwlpZiAoZGItPmRiX2J1ZikNCj4gKwkJYXJjX2J1Zl9p bmZvKGRiLT5kYl9idWYsICZhYmksIHpmc19kYnVmX3N0YXRlX2luZGV4KTsNCj4gKw0KPiArCWlm IChkbikNCj4gKwkJX19kbXVfb2JqZWN0X2luZm9fZnJvbV9kbm9kZShkbiwgJmRvaSk7DQo+ICsN Cj4gKwlzaXplID0gc25wcmludGYoYnVmLCBzaXplIC0gMSwNCj4gKwkgICAgIiUtMTZzICUtOGxs dSAlLThsbGQgJS04bGxkICUtOGxsZCAlLThsbHUgJS04bGx1ICUtNWQgJS01ZCAlLTVsdSB8ICIN Cj4gKwkgICAgIiUtNWQgJS01ZCAlLTZsbGQgMHglLTZ4ICUtNmx1ICUtOGxsdSAlLTEybGx1ICIN Cj4gKwkgICAgIiUtNmx1ICUtNmx1ICUtNmx1ICUtNmx1ICUtNmx1ICUtOGxsdSAlLThsbHUgJS04 ZCAlLTVsdSB8ICINCj4gKwkgICAgIiUtNmQgJS02ZCAlLThsdSAlLThsdSAlLTZsbHUgJS02bHUg JS01bHUgJS04bGx1ICUtOGxsdVxuIiwNCj4gKwkgICAgLyogZG11X2J1Zl9pbXBsX3QgKi8NCj4g KwkgICAgc3BhX25hbWUoZG4tPmRuX29ianNldC0+b3Nfc3BhKSwNCj4gKwkgICAgKHVfbG9uZ2xv bmdfdClkbXVfb2Jqc2V0X2lkKGRiLT5kYl9vYmpzZXQpLA0KPiArCSAgICAobG9uZ2xvbmdfdClk Yi0+ZGIuZGJfb2JqZWN0LA0KPiArCSAgICAobG9uZ2xvbmdfdClkYi0+ZGJfbGV2ZWwsDQo+ICsJ ICAgIChsb25nbG9uZ190KWRiLT5kYl9ibGtpZCwNCj4gKwkgICAgKHVfbG9uZ2xvbmdfdClkYi0+ ZGIuZGJfb2Zmc2V0LA0KPiArCSAgICAodV9sb25nbG9uZ190KWRiLT5kYi5kYl9zaXplLA0KPiAr CSAgICAhIWRidWZfaXNfbWV0YWRhdGEoZGIpLA0KPiArCSAgICBkYi0+ZGJfc3RhdGUsDQo+ICsJ ICAgICh1bG9uZ190KXJlZmNvdW50X2NvdW50KCZkYi0+ZGJfaG9sZHMpLA0KPiArCSAgICAvKiBh cmNfYnVmX2luZm9fdCAqLw0KPiArCSAgICBhYmkuYWJpX3N0YXRlX3R5cGUsDQo+ICsJICAgIGFi aS5hYmlfc3RhdGVfY29udGVudHMsDQo+ICsJICAgIChsb25nbG9uZ190KWFiaS5hYmlfc3RhdGVf aW5kZXgsDQo+ICsJICAgIGFiaS5hYmlfZmxhZ3MsDQo+ICsJICAgICh1bG9uZ190KWFiaS5hYmlf YnVmY250LA0KPiArCSAgICAodV9sb25nbG9uZ190KWFiaS5hYmlfc2l6ZSwNCj4gKwkgICAgKHVf bG9uZ2xvbmdfdClhYmkuYWJpX2FjY2VzcywNCj4gKwkgICAgKHVsb25nX3QpYWJpLmFiaV9tcnVf aGl0cywNCj4gKwkgICAgKHVsb25nX3QpYWJpLmFiaV9tcnVfZ2hvc3RfaGl0cywNCj4gKwkgICAg KHVsb25nX3QpYWJpLmFiaV9tZnVfaGl0cywNCj4gKwkgICAgKHVsb25nX3QpYWJpLmFiaV9tZnVf Z2hvc3RfaGl0cywNCj4gKwkgICAgKHVsb25nX3QpYWJpLmFiaV9sMmFyY19oaXRzLA0KPiArCSAg ICAodV9sb25nbG9uZ190KWFiaS5hYmlfbDJhcmNfZGF0dHIsDQo+ICsJICAgICh1X2xvbmdsb25n X3QpYWJpLmFiaV9sMmFyY19hc2l6ZSwNCj4gKwkgICAgYWJpLmFiaV9sMmFyY19jb21wcmVzcywN Cj4gKwkgICAgKHVsb25nX3QpYWJpLmFiaV9ob2xkcywNCj4gKwkgICAgLyogZG11X29iamVjdF9p bmZvX3QgKi8NCj4gKwkgICAgZG9pLmRvaV90eXBlLA0KPiArCSAgICBkb2kuZG9pX2JvbnVzX3R5 cGUsDQo+ICsJICAgICh1bG9uZ190KWRvaS5kb2lfZGF0YV9ibG9ja19zaXplLA0KPiArCSAgICAo dWxvbmdfdClkb2kuZG9pX21ldGFkYXRhX2Jsb2NrX3NpemUsDQo+ICsJICAgICh1X2xvbmdsb25n X3QpZG9pLmRvaV9ib251c19zaXplLA0KPiArCSAgICAodWxvbmdfdClkb2kuZG9pX2luZGlyZWN0 aW9uLA0KPiArCSAgICAodWxvbmdfdClyZWZjb3VudF9jb3VudCgmZG4tPmRuX2hvbGRzKSwNCj4g KwkgICAgKHVfbG9uZ2xvbmdfdClkb2kuZG9pX2ZpbGxfY291bnQsDQo+ICsJICAgICh1X2xvbmds b25nX3QpZG9pLmRvaV9tYXhfb2Zmc2V0KTsNCj4gKyAgICAgICAgYnVmW3NpemVdID0gJ1wwJzsN Cj4gKw0KPiArCXJldHVybiAoc2l6ZSk7DQo+ICt9DQo+ICsNCj4gK3N0YXRpYyBpbnQNCj4gK2Ri dWZfc3RhdHNfaGFzaF90YWJsZV9kYXRhKGNoYXIgKmJ1Ziwgc2l6ZV90IHNpemUsIHZvaWQgKmRh dGEpDQo+ICt7DQo+ICsJZGJ1Zl9zdGF0c190ICpkc2ggPSAoZGJ1Zl9zdGF0c190ICopZGF0YTsN Cj4gKwlkYnVmX2hhc2hfdGFibGVfdCAqaCA9IGRzaC0+aGFzaDsNCj4gKwlkbXVfYnVmX2ltcGxf dCAqZGI7DQo+ICsJaW50IGxlbmd0aCwgZXJyb3IgPSAwOw0KPiArDQo+ICsJQVNTRVJUM1MoZHNo LT5pZHgsID49LCAwKTsNCj4gKwlBU1NFUlQzUyhkc2gtPmlkeCwgPD0sIGgtPmhhc2hfdGFibGVf bWFzayk7DQo+ICsJbWVtc2V0KGJ1ZiwgMCwgc2l6ZSk7DQo+ICsNCj4gKwltdXRleF9lbnRlcihE QlVGX0hBU0hfTVVURVgoaCwgZHNoLT5pZHgpKTsNCj4gKwlmb3IgKGRiID0gaC0+aGFzaF90YWJs ZVtkc2gtPmlkeF07IGRiICE9IE5VTEw7IGRiID0gZGItPmRiX2hhc2hfbmV4dCkgew0KPiArCQkv Kg0KPiArCQkgKiBSZXR1cm5pbmcgRU5PTUVNIHdpbGwgY2F1c2UgdGhlIGRhdGEgYW5kIGhlYWRl ciBmdW5jdGlvbnMNCj4gKwkJICogdG8gYmUgY2FsbGVkIHdpdGggYSBsYXJnZXIgc2NyYXRjaCBi dWZmZXJzLg0KPiArCQkgKi8NCj4gKwkJaWYgKHNpemUgPCA1MTIpIHsNCj4gKwkJCWVycm9yID0g RU5PTUVNOw0KPiArCQkJYnJlYWs7DQo+ICsJCX0NCj4gKw0KPiArCQltdXRleF9lbnRlcigmZGIt PmRiX210eCk7DQo+ICsJCW11dGV4X2V4aXQoREJVRl9IQVNIX01VVEVYKGgsIGRzaC0+aWR4KSk7 DQo+ICsNCj4gKwkJbGVuZ3RoID0gX19kYnVmX3N0YXRzX2hhc2hfdGFibGVfZGF0YShidWYsIHNp emUsIGRiKTsNCj4gKwkJYnVmICs9IGxlbmd0aDsNCj4gKwkJc2l6ZSAtPSBsZW5ndGg7DQo+ICsN Cj4gKwkJbXV0ZXhfZXhpdCgmZGItPmRiX210eCk7DQo+ICsJCW11dGV4X2VudGVyKERCVUZfSEFT SF9NVVRFWChoLCBkc2gtPmlkeCkpOw0KPiArCX0NCj4gKwltdXRleF9leGl0KERCVUZfSEFTSF9N VVRFWChoLCBkc2gtPmlkeCkpOw0KPiArDQo+ICsJcmV0dXJuIChlcnJvcik7DQo+ICt9DQo+ICsN Cj4gK3N0YXRpYyB2b2lkICoNCj4gK2RidWZfc3RhdHNfaGFzaF90YWJsZV9hZGRyKGtzdGF0X3Qg KmtzcCwgb2ZmX3QgbikNCj4gK3sNCj4gKwlkYnVmX3N0YXRzX3QgKmRzaCA9IGtzcC0+a3NfcHJp dmF0ZTsNCj4gKw0KPiArICAgICAgICBBU1NFUlQoTVVURVhfSEVMRCgmZHNoLT5sb2NrKSk7DQo+ ICsNCj4gKwlpZiAobiA8PSBkc2gtPmhhc2gtPmhhc2hfdGFibGVfbWFzaykgew0KPiArCQlkc2gt PmlkeCA9IG47DQo+ICsJCXJldHVybiAoZHNoKTsNCj4gKwl9DQo+ICsNCj4gKwlyZXR1cm4gKE5V TEwpOw0KPiArfQ0KPiArDQo+ICsjaWZuZGVmIF9fRnJlZUJTRF9fDQo+ICsvKg0KPiArICogWFhY IFRoZSBGcmVlQlNEIFNQTCBpcyBtaXNzaW5nIHN1cHBvcnQgZm9yIEtTVEFUX1RZUEVfUkFXDQo+ ICsgKiB3ZSBjYW4gZW5hYmxlIHRoaXMgYXMgc29vbiBhcyB0aGF0J3MgaW1wbGVtZW50ZWQuIFNl ZSB0aGUNCj4gKyAqIGxpbmRlYnVnZnMgbW9kdWxlIGZvciBzaW1pbGFyIGNhbGxiYWNrIHNlbWFu dGljcy4NCj4gKyAqLw0KPiArc3RhdGljIHZvaWQNCj4gK2RidWZfc3RhdHNfaGFzaF90YWJsZV9p bml0KGRidWZfaGFzaF90YWJsZV90ICpoYXNoKQ0KPiArew0KPiArCWRidWZfc3RhdHNfdCAqZHNo ID0gJmRidWZfc3RhdHNfaGFzaF90YWJsZTsNCj4gKwlrc3RhdF90ICprc3A7DQo+ICsNCj4gKwlt dXRleF9pbml0KCZkc2gtPmxvY2ssIE5VTEwsIE1VVEVYX0RFRkFVTFQsIE5VTEwpOw0KPiArCWRz aC0+aGFzaCA9IGhhc2g7DQo+ICsNCj4gKwlrc3AgPSBrc3RhdF9jcmVhdGUoInpmcyIsIDAsICJk YnVmcyIsICJtaXNjIiwNCj4gKwkgICAgS1NUQVRfVFlQRV9SQVcsIDAsIEtTVEFUX0ZMQUdfVklS VFVBTCk7DQo+ICsJZHNoLT5rc3RhdCA9IGtzcDsNCj4gKw0KPiArCWlmIChrc3ApIHsNCj4gKwkJ a3NwLT5rc19sb2NrID0gJmRzaC0+bG9jazsNCj4gKwkJa3NwLT5rc19uZGF0YSA9IFVJTlQzMl9N QVg7DQo+ICsJCWtzcC0+a3NfcHJpdmF0ZSA9IGRzaDsNCj4gKwkJa3N0YXRfc2V0X3Jhd19vcHMo a3NwLCBkYnVmX3N0YXRzX2hhc2hfdGFibGVfaGVhZGVycywNCj4gKwkJICAgIGRidWZfc3RhdHNf aGFzaF90YWJsZV9kYXRhLCBkYnVmX3N0YXRzX2hhc2hfdGFibGVfYWRkcik7DQo+ICsJCWtzdGF0 X2luc3RhbGwoa3NwKTsNCj4gKwl9DQo+ICt9DQo+ICsNCj4gK3N0YXRpYyB2b2lkDQo+ICtkYnVm X3N0YXRzX2hhc2hfdGFibGVfZGVzdHJveSh2b2lkKQ0KPiArew0KPiArCWRidWZfc3RhdHNfdCAq ZHNoID0gJmRidWZfc3RhdHNfaGFzaF90YWJsZTsNCj4gKwlrc3RhdF90ICprc3A7DQo+ICsNCj4g Kwlrc3AgPSBkc2gtPmtzdGF0Ow0KPiArCWlmIChrc3ApDQo+ICsJCWtzdGF0X2RlbGV0ZShrc3Ap Ow0KPiArDQo+ICsJbXV0ZXhfZGVzdHJveSgmZHNoLT5sb2NrKTsNCj4gK30NCj4gKyNlbHNlDQo+ ICtzdGF0aWMgdm9pZA0KPiArZGJ1Zl9zdGF0c19oYXNoX3RhYmxlX2luaXQoZGJ1Zl9oYXNoX3Rh YmxlX3QgKmhhc2gpDQo+ICt7DQo+ICt9DQo+ICsNCj4gK3N0YXRpYyB2b2lkDQo+ICtkYnVmX3N0 YXRzX2hhc2hfdGFibGVfZGVzdHJveSh2b2lkKQ0KPiArew0KPiArfQ0KPiArI2VuZGlmDQo+ICsN Cj4gK3ZvaWQNCj4gK2RidWZfc3RhdHNfaW5pdChkYnVmX2hhc2hfdGFibGVfdCAqaGFzaCkNCj4g K3sNCj4gKwlkYnVmX3N0YXRzX2hhc2hfdGFibGVfaW5pdChoYXNoKTsNCj4gK30NCj4gKw0KPiAr dm9pZA0KPiArZGJ1Zl9zdGF0c19kZXN0cm95KHZvaWQpDQo+ICt7DQo+ICsJZGJ1Zl9zdGF0c19o YXNoX3RhYmxlX2Rlc3Ryb3koKTsNCj4gK30NCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N5cy9jZGRs L2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9mcy96ZnMvZG11LmMNCj4gPT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3N5cy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRz L2NvbW1vbi9mcy96ZnMvZG11LmMJU3VuIEF1ZyAxMg0KPiAwMDo0NTo1MyAyMDE4CShyMzM3NjY5 KSArKysNCj4gaGVhZC9zeXMvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMv emZzL2RtdS5jCVN1biBBdWcgMTIgMDE6MTA6MTgNCj4gMjAxOAkocjMzNzY3MCkgQEAgLTI1MDks MTUgKzI1MDksMTAgQEAgZG11X29iamVjdF93YWl0X3N5bmNlZChvYmpzZXRfdCAqb3MsDQo+IHVp bnQ2NF90IG9iamVjdCkgfSANCj4gIHZvaWQNCj4gLWRtdV9vYmplY3RfaW5mb19mcm9tX2Rub2Rl KGRub2RlX3QgKmRuLCBkbXVfb2JqZWN0X2luZm9fdCAqZG9pKQ0KPiArX19kbXVfb2JqZWN0X2lu Zm9fZnJvbV9kbm9kZShkbm9kZV90ICpkbiwgZG11X29iamVjdF9pbmZvX3QgKmRvaSkNCj4gIHsN Cj4gLQlkbm9kZV9waHlzX3QgKmRucDsNCj4gKwlkbm9kZV9waHlzX3QgKmRucCA9IGRuLT5kbl9w aHlzOw0KPiAgDQo+IC0JcndfZW50ZXIoJmRuLT5kbl9zdHJ1Y3Rfcndsb2NrLCBSV19SRUFERVIp Ow0KPiAtCW11dGV4X2VudGVyKCZkbi0+ZG5fbXR4KTsNCj4gLQ0KPiAtCWRucCA9IGRuLT5kbl9w aHlzOw0KPiAtDQo+ICAJZG9pLT5kb2lfZGF0YV9ibG9ja19zaXplID0gZG4tPmRuX2RhdGFibGtz ejsNCj4gIAlkb2ktPmRvaV9tZXRhZGF0YV9ibG9ja19zaXplID0gZG4tPmRuX2luZGJsa3NoaWZ0 ID8NCj4gIAkgICAgMVVMTCA8PCBkbi0+ZG5faW5kYmxrc2hpZnQgOiAwOw0KPiBAQCAtMjUzNCw2 ICsyNTI5LDE1IEBAIGRtdV9vYmplY3RfaW5mb19mcm9tX2Rub2RlKGRub2RlX3QgKmRuLCBkbXVf b2JqZWN0X2luZg0KPiAgCWRvaS0+ZG9pX2ZpbGxfY291bnQgPSAwOw0KPiAgCWZvciAoaW50IGkg PSAwOyBpIDwgZG5wLT5kbl9uYmxrcHRyOyBpKyspDQo+ICAJCWRvaS0+ZG9pX2ZpbGxfY291bnQg Kz0gQlBfR0VUX0ZJTEwoJmRucC0+ZG5fYmxrcHRyW2ldKTsNCj4gK30NCj4gKw0KPiArdm9pZA0K PiArZG11X29iamVjdF9pbmZvX2Zyb21fZG5vZGUoZG5vZGVfdCAqZG4sIGRtdV9vYmplY3RfaW5m b190ICpkb2kpDQo+ICt7DQo+ICsJcndfZW50ZXIoJmRuLT5kbl9zdHJ1Y3Rfcndsb2NrLCBSV19S RUFERVIpOw0KPiArCW11dGV4X2VudGVyKCZkbi0+ZG5fbXR4KTsNCj4gKw0KPiArCV9fZG11X29i amVjdF9pbmZvX2Zyb21fZG5vZGUoZG4sIGRvaSk7DQo+ICANCj4gIAltdXRleF9leGl0KCZkbi0+ ZG5fbXR4KTsNCj4gIAlyd19leGl0KCZkbi0+ZG5fc3RydWN0X3J3bG9jayk7DQo+IA0KPiBNb2Rp ZmllZDogaGVhZC9zeXMvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZz L3N5cy9hcmMuaA0KPiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCj4gLS0tIGhlYWQvc3lzL2NkZGwv Y29udHJpYi9vcGVuc29sYXJpcy91dHMvY29tbW9uL2ZzL3pmcy9zeXMvYXJjLmgJU3VuIEF1ZyAx Mg0KPiAwMDo0NTo1MyAyMDE4CShyMzM3NjY5KSArKysNCj4gaGVhZC9zeXMvY2RkbC9jb250cmli L29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZzL3N5cy9hcmMuaAlTdW4gQXVnIDEyDQo+IDAx OjEwOjE4IDIwMTgJKHIzMzc2NzApIEBAIC0xODUsNiArMTg1LDM2IEBAIHR5cGVkZWYgZW51bSBh cmNfc3BhY2VfdHlwZQ0KPiB7IEFSQ19TUEFDRV9OVU1UWVBFUyB9IGFyY19zcGFjZV90eXBlX3Q7 DQo+ICANCj4gK3R5cGVkZWYgZW51bSBhcmNfc3RhdGVfdHlwZSB7DQo+ICsJQVJDX1NUQVRFX0FO T04sDQo+ICsJQVJDX1NUQVRFX01SVSwNCj4gKwlBUkNfU1RBVEVfTVJVX0dIT1NULA0KPiArCUFS Q19TVEFURV9NRlUsDQo+ICsJQVJDX1NUQVRFX01GVV9HSE9TVCwNCj4gKwlBUkNfU1RBVEVfTDJD X09OTFksDQo+ICsJQVJDX1NUQVRFX05VTVRZUEVTDQo+ICt9IGFyY19zdGF0ZV90eXBlX3Q7DQo+ ICsNCj4gK3R5cGVkZWYgc3RydWN0IGFyY19idWZfaW5mbyB7DQo+ICsJYXJjX3N0YXRlX3R5cGVf dAlhYmlfc3RhdGVfdHlwZTsNCj4gKwlhcmNfYnVmX2NvbnRlbnRzX3QJYWJpX3N0YXRlX2NvbnRl bnRzOw0KPiArCXVpbnQ2NF90CQlhYmlfc3RhdGVfaW5kZXg7DQo+ICsJdWludDMyX3QJCWFiaV9m bGFnczsNCj4gKwl1aW50MzJfdAkJYWJpX2J1ZmNudDsNCj4gKwl1aW50NjRfdAkJYWJpX3NpemU7 DQo+ICsJdWludDY0X3QJCWFiaV9zcGE7DQo+ICsJdWludDY0X3QJCWFiaV9hY2Nlc3M7DQo+ICsJ dWludDMyX3QJCWFiaV9tcnVfaGl0czsNCj4gKwl1aW50MzJfdAkJYWJpX21ydV9naG9zdF9oaXRz Ow0KPiArCXVpbnQzMl90CQlhYmlfbWZ1X2hpdHM7DQo+ICsJdWludDMyX3QJCWFiaV9tZnVfZ2hv c3RfaGl0czsNCj4gKwl1aW50MzJfdAkJYWJpX2wyYXJjX2hpdHM7DQo+ICsJdWludDMyX3QJCWFi aV9ob2xkczsNCj4gKwl1aW50NjRfdAkJYWJpX2wyYXJjX2RhdHRyOw0KPiArCXVpbnQ2NF90CQlh YmlfbDJhcmNfYXNpemU7DQo+ICsJZW51bSB6aW9fY29tcHJlc3MJYWJpX2wyYXJjX2NvbXByZXNz Ow0KPiArfSBhcmNfYnVmX2luZm9fdDsNCj4gKw0KPiAgdm9pZCBhcmNfc3BhY2VfY29uc3VtZSh1 aW50NjRfdCBzcGFjZSwgYXJjX3NwYWNlX3R5cGVfdCB0eXBlKTsNCj4gIHZvaWQgYXJjX3NwYWNl X3JldHVybih1aW50NjRfdCBzcGFjZSwgYXJjX3NwYWNlX3R5cGVfdCB0eXBlKTsNCj4gIGJvb2xl YW5fdCBhcmNfaXNfbWV0YWRhdGEoYXJjX2J1Zl90ICpidWYpOw0KPiBAQCAtMjAwLDYgKzIzMCw3 IEBAIGFyY19idWZfdCAqYXJjX2xvYW5fY29tcHJlc3NlZF9idWYoc3BhX3QgKnNwYSwgdWludDY0 Xw0KPiAgdm9pZCBhcmNfcmV0dXJuX2J1ZihhcmNfYnVmX3QgKmJ1Ziwgdm9pZCAqdGFnKTsNCj4g IHZvaWQgYXJjX2xvYW5faW51c2VfYnVmKGFyY19idWZfdCAqYnVmLCB2b2lkICp0YWcpOw0KPiAg dm9pZCBhcmNfYnVmX2Rlc3Ryb3koYXJjX2J1Zl90ICpidWYsIHZvaWQgKnRhZyk7DQo+ICt2b2lk IGFyY19idWZfaW5mbyhhcmNfYnVmX3QgKmJ1ZiwgYXJjX2J1Zl9pbmZvX3QgKmFiaSwgaW50IHN0 YXRlX2luZGV4KTsNCj4gIGludCBhcmNfYnVmX3NpemUoYXJjX2J1Zl90ICpidWYpOw0KPiAgaW50 IGFyY19idWZfbHNpemUoYXJjX2J1Zl90ICpidWYpOw0KPiAgdm9pZCBhcmNfYnVmX2FjY2Vzcyhh cmNfYnVmX3QgKmJ1Zik7DQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMvY2RkbC9jb250cmliL29w ZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZzL3N5cy9kYnVmLmgNCj4gPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09DQo+IC0tLSBoZWFkL3N5cy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1v bi9mcy96ZnMvc3lzL2RidWYuaAlTdW4gQXVnIDEyDQo+IDAwOjQ1OjUzIDIwMTgJKHIzMzc2Njkp ICsrKw0KPiBoZWFkL3N5cy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9mcy96 ZnMvc3lzL2RidWYuaAlTdW4gQXVnIDEyDQo+IDAxOjEwOjE4IDIwMTgJKHIzMzc2NzApIEBAIC0z MzMsNiArMzMzLDkgQEAgdm9pZCBkYnVmX2ZyZWVfcmFuZ2Uoc3RydWN0IGRub2RlDQo+ICpkbiwg dWludDY0X3Qgc3RhcnQsIHZvaWQgZGJ1Zl9uZXdfc2l6ZShkbXVfYnVmX2ltcGxfdCAqZGIsIGlu dCBzaXplLCBkbXVfdHhfdCAqdHgpOw0KPiAgDQo+ICt2b2lkIGRidWZfc3RhdHNfaW5pdChkYnVm X2hhc2hfdGFibGVfdCAqaGFzaCk7DQo+ICt2b2lkIGRidWZfc3RhdHNfZGVzdHJveSh2b2lkKTsN Cj4gKw0KPiAgI2RlZmluZQlEQl9ETk9ERShfZGIpCQkoKF9kYiktPmRiX2Rub2RlX2hhbmRsZS0+ ZG5oX2Rub2RlKQ0KPiAgI2RlZmluZQlEQl9ETk9ERV9MT0NLKF9kYikJKChfZGIpLT5kYl9kbm9k ZV9oYW5kbGUtPmRuaF96cmxvY2spDQo+ICAjZGVmaW5lCURCX0ROT0RFX0VOVEVSKF9kYikJKHpy bF9hZGQoJkRCX0ROT0RFX0xPQ0soX2RiKSkpDQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMvY2Rk bC9jb250cmliL29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZzL3N5cy9kbXUuaA0KPiA9PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT0NCj4gLS0tIGhlYWQvc3lzL2NkZGwvY29udHJpYi9vcGVuc29sYXJp cy91dHMvY29tbW9uL2ZzL3pmcy9zeXMvZG11LmgJU3VuIEF1ZyAxMg0KPiAwMDo0NTo1MyAyMDE4 CShyMzM3NjY5KSArKysNCj4gaGVhZC9zeXMvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3V0cy9j b21tb24vZnMvemZzL3N5cy9kbXUuaAlTdW4gQXVnIDEyDQo+IDAxOjEwOjE4IDIwMTgJKHIzMzc2 NzApIEBAIC04NTUsNiArODU1LDcgQEAgZXh0ZXJuIGNvbnN0DQo+IGRtdV9vYmplY3RfYnl0ZXN3 YXBfaW5mb190IGRtdV9vdF9ieXRlc3dhDQo+ICAgKiBJZiBkb2kgaXMgTlVMTCwganVzdCBpbmRp Y2F0ZXMgd2hldGhlciB0aGUgb2JqZWN0IGV4aXN0cy4NCj4gICAqLw0KPiAgaW50IGRtdV9vYmpl Y3RfaW5mbyhvYmpzZXRfdCAqb3MsIHVpbnQ2NF90IG9iamVjdCwgZG11X29iamVjdF9pbmZvX3Qg KmRvaSk7DQo+ICt2b2lkIF9fZG11X29iamVjdF9pbmZvX2Zyb21fZG5vZGUoc3RydWN0IGRub2Rl ICpkbiwgZG11X29iamVjdF9pbmZvX3QgKmRvaSk7DQo+ICAvKiBMaWtlIGRtdV9vYmplY3RfaW5m bywgYnV0IGZhc3RlciBpZiB5b3UgaGF2ZSBhIGhlbGQgZG5vZGUgaW4gaGFuZC4gKi8NCj4gIHZv aWQgZG11X29iamVjdF9pbmZvX2Zyb21fZG5vZGUoZG5vZGVfdCAqZG4sIGRtdV9vYmplY3RfaW5m b190ICpkb2kpOw0KPiAgLyogTGlrZSBkbXVfb2JqZWN0X2luZm8sIGJ1dCBmYXN0ZXIgaWYgeW91 IGhhdmUgYSBoZWxkIGRidWYgaW4gaGFuZC4gKi8NCj4gX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX18NCj4gc3ZuLXNyYy1oZWFkQGZyZWVic2Qub3JnIG1haWxp bmcgbGlzdA0KPiBodHRwczovL2xpc3RzLmZyZWVic2Qub3JnL21haWxtYW4vbGlzdGluZm8vc3Zu LXNyYy1oZWFkDQo+IFRvIHVuc3Vic2NyaWJlLCBzZW5kIGFueSBtYWlsIHRvICJzdm4tc3JjLWhl YWQtdW5zdWJzY3JpYmVAZnJlZWJzZC5vcmciDQoNCg0KVGhpcyBjb21taXQgYnJlYWtzIGtlcm5l bCBidWlsZCAob3B0aW9ucyBaRlMgd2l0aGluIGtlcm5lbCBjb25maWcgZmlsZSwgV0lUSF9NRVRB X01PREUpOg0KDQpbLi4uXQ0KbGQ6IGVycm9yOiB1bmRlZmluZWQgc3ltYm9sOiBkYnVmX3N0YXRz X2luaXQNCj4+PiByZWZlcmVuY2VkIGJ5IGRidWYuYw0KPj4+ICAgICAgICAgICAgICAgZGJ1Zi5v OihkYnVmX2luaXQpDQpsZDogZXJyb3I6IHVuZGVmaW5lZCBzeW1ib2w6IGRidWZfc3RhdHNfZGVz dHJveQ0KPj4+IHJlZmVyZW5jZWQgYnkgZGJ1Zi5jDQo+Pj4gICAgICAgICAgICAgICBkYnVmLm86 KGRidWZfZmluaSkNCg0KUmVnYXJkcywNCg0Kb2gNCi0tLS0tQkVHSU4gUEdQIFNJR05BVFVSRS0t LS0tDQoNCmlMVUVBUk1LQUIwV0lRUVpWWk16QXR3QzJULzg2VHJTNTI4ZnlGaFlsQVVDVzIvRVNn QUtDUkRTNTI4ZnlGaFkNCmxLS1VBZ0NJdC9BMWdrL2FkQ29uYnQ2WGQ0T0NZSllZVitsU2xGRUky aURTQTdGNnhQc3hkVjY0alZRS2tTbU8NCjExck1pUFpURFRhU2VILzMrVm04MG5qUG1lS05BZjRz encvSVpnRTB0aWxWTDNJVEtsUHFhZlUraGlIOFB3YncNCnRlWnQxM1EvWnB0WGk4Uml4d2ZTSm0z TzQzV1NPUS9hSkUxRFZRWjJzeWdHVmxoRVE3dUwNCj1FaWk2DQotLS0tLUVORCBQR1AgU0lHTkFU VVJFLS0tLS0NCg== From owner-svn-src-all@freebsd.org Sun Aug 12 07:47:45 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 2E6021067A99; Sun, 12 Aug 2018 07:47:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D07F57CEB7; Sun, 12 Aug 2018 07:47:44 +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 A519123273; Sun, 12 Aug 2018 07:47:44 +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 w7C7linu096248; Sun, 12 Aug 2018 07:47:44 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C7liwS096247; Sun, 12 Aug 2018 07:47:44 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808120747.w7C7liwS096247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Aug 2018 07:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337680 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 337680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 07:47:45 -0000 Author: cy Date: Sun Aug 12 07:47:44 2018 New Revision: 337680 URL: https://svnweb.freebsd.org/changeset/base/337680 Log: Chasing r337661, fix systat after arc accounting change. Modified: head/usr.bin/systat/main.c Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Sun Aug 12 03:36:09 2018 (r337679) +++ head/usr.bin/systat/main.c Sun Aug 12 07:47:44 2018 (r337680) @@ -260,6 +260,7 @@ labels(void) void display(void) { + uint64_t arc_stat; int i, j; /* Get the load average over the last minute. */ @@ -293,7 +294,11 @@ display(void) GETSYSCTL("vfs.zfs.anon_size", arc[3]); GETSYSCTL("kstat.zfs.misc.arcstats.hdr_size", arc[4]); GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", arc[5]); - GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc[6]); + GETSYSCTL("kstat.zfs.misc.arcstats.bonus_size", arc[6]); + GETSYSCTL("kstat.zfs.misc.arcstats.dnode_size", arc_stat); + arc[6] += arc_stat; + GETSYSCTL("kstat.zfs.misc.arcstats.dbuf_size", arc_stat); + arc[6] += arc_stat; wmove(wload, 0, 0); wclrtoeol(wload); for (i = 0 ; i < nitems(arc); i++) { if (arc[i] > 10llu * 1024 * 1024 * 1024 ) { From owner-svn-src-all@freebsd.org Sun Aug 12 08:42: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 A74D310691FA; Sun, 12 Aug 2018 08:42:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 589A97F1A7; Sun, 12 Aug 2018 08:42: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 3967F23C29; Sun, 12 Aug 2018 08:42: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 w7C8g7D8026830; Sun, 12 Aug 2018 08:42:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C8g6EC026827; Sun, 12 Aug 2018 08:42:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808120842.w7C8g6EC026827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Aug 2018 08:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337681 - in stable/11: . lib/ofed/libibverbs lib/ofed/libmlx5 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: . lib/ofed/libibverbs lib/ofed/libmlx5 X-SVN-Commit-Revision: 337681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 08:42:07 -0000 Author: kib Date: Sun Aug 12 08:42:06 2018 New Revision: 337681 URL: https://svnweb.freebsd.org/changeset/base/337681 Log: MFC r336568: Move OFED libraries libmlx5.so.1 and libibverbs.so.1 to /lib. Modified: stable/11/ObsoleteFiles.inc stable/11/lib/ofed/libibverbs/Makefile stable/11/lib/ofed/libmlx5/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Sun Aug 12 07:47:44 2018 (r337680) +++ stable/11/ObsoleteFiles.inc Sun Aug 12 08:42:06 2018 (r337681) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20180812: move of libmlx5.so.1 and libibverbs.so.1 +OLD_LIBS+=usr/lib/libmlx5.so.1 +OLD_LIBS+=usr/lib/libibverbs.so.1 # 20180714: new clang import which bumps version from 6.0.0 to 6.0.1. OLD_FILES+=usr/lib/clang/6.0.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/6.0.0/include/sanitizer/asan_interface.h Modified: stable/11/lib/ofed/libibverbs/Makefile ============================================================================== --- stable/11/lib/ofed/libibverbs/Makefile Sun Aug 12 07:47:44 2018 (r337680) +++ stable/11/lib/ofed/libibverbs/Makefile Sun Aug 12 08:42:06 2018 (r337681) @@ -5,7 +5,7 @@ _spath= ${SRCTOP}/contrib/ofed/libibverbs LIB= ibverbs SHLIB_MAJOR= 1 -SHLIBDIR?= /usr/lib +SHLIBDIR?= /lib MK_PROFILE= no VERSION_MAP= ${_spath}/libibverbs.map Modified: stable/11/lib/ofed/libmlx5/Makefile ============================================================================== --- stable/11/lib/ofed/libmlx5/Makefile Sun Aug 12 07:47:44 2018 (r337680) +++ stable/11/lib/ofed/libmlx5/Makefile Sun Aug 12 08:42:06 2018 (r337681) @@ -3,7 +3,7 @@ _spath= ${SRCTOP}/contrib/ofed/libmlx5 .PATH: ${_spath} -SHLIBDIR?= /usr/lib +SHLIBDIR?= /lib LIB= mlx5 SHLIB_MAJOR= 1 MK_PROFILE= no From owner-svn-src-all@freebsd.org Sun Aug 12 08:45: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 A4AB21069341; Sun, 12 Aug 2018 08:45:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59CE07F3A0; Sun, 12 Aug 2018 08:45:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AF9C23C55; Sun, 12 Aug 2018 08:45:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7C8jOBw027746; Sun, 12 Aug 2018 08:45:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7C8jNQU027742; Sun, 12 Aug 2018 08:45:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808120845.w7C8jNQU027742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Aug 2018 08:45: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: r337682 - in stable/11: share/mk tools/build/options usr.bin/ofed usr.bin/ofed/infiniband-diags X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: share/mk tools/build/options usr.bin/ofed usr.bin/ofed/infiniband-diags X-SVN-Commit-Revision: 337682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 08:45:24 -0000 Author: kib Date: Sun Aug 12 08:45:23 2018 New Revision: 337682 URL: https://svnweb.freebsd.org/changeset/base/337682 Log: MFC r336569: Move mostly useless examples binaries from OFED, as well as the Subnet Manager, under the new option WITH_OFED_EXTRA, disabled by default. Added: stable/11/tools/build/options/WITH_OFED_EXTRA - copied unchanged from r336569, head/tools/build/options/WITH_OFED_EXTRA Modified: stable/11/share/mk/src.opts.mk stable/11/usr.bin/ofed/Makefile stable/11/usr.bin/ofed/infiniband-diags/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Sun Aug 12 08:42:06 2018 (r337681) +++ stable/11/share/mk/src.opts.mk Sun Aug 12 08:45:23 2018 (r337682) @@ -197,6 +197,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FORCE_LE \ NAND \ OFED \ + OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ RPCBIND_WARMSTART_SUPPORT \ @@ -400,6 +401,10 @@ MK_NLS_CATALOGS:= no .if ${MK_OPENSSL} == "no" MK_OPENSSH:= no MK_KERBEROS:= no +.endif + +.if ${MK_OFED} == "no" +MK_OFED_EXTRA:= no .endif .if ${MK_PF} == "no" Copied: stable/11/tools/build/options/WITH_OFED_EXTRA (from r336569, head/tools/build/options/WITH_OFED_EXTRA) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITH_OFED_EXTRA Sun Aug 12 08:45:23 2018 (r337682, copy of r336569, head/tools/build/options/WITH_OFED_EXTRA) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build the non-essential components of the +.Dq "OpenFabrics Enterprise Distribution" +Infiniband software stack, mostly examples. Modified: stable/11/usr.bin/ofed/Makefile ============================================================================== --- stable/11/usr.bin/ofed/Makefile Sun Aug 12 08:42:06 2018 (r337681) +++ stable/11/usr.bin/ofed/Makefile Sun Aug 12 08:45:23 2018 (r337682) @@ -1,10 +1,13 @@ # $FreeBSD$ +.include + SUBDIR= \ libibverbs \ librdmacm \ - opensm \ infiniband-diags + +SUBDIR.${MK_OFED_EXTRA}+= opensm SUBDIR_PARALLEL= Modified: stable/11/usr.bin/ofed/infiniband-diags/Makefile ============================================================================== --- stable/11/usr.bin/ofed/infiniband-diags/Makefile Sun Aug 12 08:42:06 2018 (r337681) +++ stable/11/usr.bin/ofed/infiniband-diags/Makefile Sun Aug 12 08:45:23 2018 (r337682) @@ -1,27 +1,33 @@ # $FreeBSD$ +.include + SUBDIR= \ -dump_fts \ -ibaddr \ -ibcacheedit \ -ibccconfig \ -ibccquery \ -iblinkinfo \ -ibmirror \ -ibnetdiscover \ -ibping \ -ibportstate \ -ibqueryerrors \ -ibroute \ -ibstat \ -ibsysstat \ -ibtracert \ -perfquery \ -saquery \ -sminfo \ -smpdump \ -smpquery \ -vendstat + ibstat + +.if ${MK_OFED_EXTRA} != "no" +SUBDIR+= \ + dump_fts \ + ibaddr \ + ibcacheedit \ + ibccconfig \ + ibccquery \ + iblinkinfo \ + ibmirror \ + ibnetdiscover \ + ibping \ + ibportstate \ + ibqueryerrors \ + ibroute \ + ibsysstat \ + ibtracert \ + perfquery \ + saquery \ + sminfo \ + smpdump \ + smpquery \ + vendstat +.endif SUBDIR_PARALLEL= From owner-svn-src-all@freebsd.org Sun Aug 12 12:10: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 77A00106E78D; Sun, 12 Aug 2018 12:10:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2497184F0A; Sun, 12 Aug 2018 12:10:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01DEC25CF4; Sun, 12 Aug 2018 12:10:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7CCAX6W029897; Sun, 12 Aug 2018 12:10:33 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CCAXB7029893; Sun, 12 Aug 2018 12:10:33 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808121210.w7CCAXB7029893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 12 Aug 2018 12:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337683 - in vendor/tzdb: . dist X-SVN-Group: vendor X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in vendor/tzdb: . dist X-SVN-Commit-Revision: 337683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 12:10:34 -0000 Author: eadler Date: Sun Aug 12 12:10:33 2018 New Revision: 337683 URL: https://svnweb.freebsd.org/changeset/base/337683 Log: vendor/tzdb: reimport IANA database+code in a standard layout I am using a new directory since the layout of both the vendor area and contrib/ need to be changed. Added: vendor/tzdb/ vendor/tzdb/dist/ vendor/tzdb/dist/CONTRIBUTING vendor/tzdb/dist/LICENSE vendor/tzdb/dist/Makefile (contents, props changed) vendor/tzdb/dist/NEWS vendor/tzdb/dist/README vendor/tzdb/dist/africa vendor/tzdb/dist/antarctica vendor/tzdb/dist/asctime.c (contents, props changed) vendor/tzdb/dist/asia vendor/tzdb/dist/australasia vendor/tzdb/dist/backward vendor/tzdb/dist/backzone vendor/tzdb/dist/calendars vendor/tzdb/dist/checklinks.awk (contents, props changed) vendor/tzdb/dist/checktab.awk (contents, props changed) vendor/tzdb/dist/date.1 (contents, props changed) vendor/tzdb/dist/date.1.txt (contents, props changed) vendor/tzdb/dist/date.c (contents, props changed) vendor/tzdb/dist/difftime.c (contents, props changed) vendor/tzdb/dist/etcetera vendor/tzdb/dist/europe vendor/tzdb/dist/factory vendor/tzdb/dist/iso3166.tab vendor/tzdb/dist/leap-seconds.list vendor/tzdb/dist/leapseconds vendor/tzdb/dist/leapseconds.awk (contents, props changed) vendor/tzdb/dist/localtime.c (contents, props changed) vendor/tzdb/dist/newctime.3 (contents, props changed) vendor/tzdb/dist/newctime.3.txt (contents, props changed) vendor/tzdb/dist/newstrftime.3 (contents, props changed) vendor/tzdb/dist/newstrftime.3.txt (contents, props changed) vendor/tzdb/dist/newtzset.3 (contents, props changed) vendor/tzdb/dist/newtzset.3.txt (contents, props changed) vendor/tzdb/dist/northamerica vendor/tzdb/dist/pacificnew vendor/tzdb/dist/private.h (contents, props changed) vendor/tzdb/dist/southamerica vendor/tzdb/dist/strftime.c (contents, props changed) vendor/tzdb/dist/systemv vendor/tzdb/dist/theory.html (contents, props changed) vendor/tzdb/dist/time2posix.3 (contents, props changed) vendor/tzdb/dist/time2posix.3.txt (contents, props changed) vendor/tzdb/dist/to2050.tzs vendor/tzdb/dist/tz-art.html (contents, props changed) vendor/tzdb/dist/tz-how-to.html (contents, props changed) vendor/tzdb/dist/tz-link.html (contents, props changed) vendor/tzdb/dist/tzdata.zi vendor/tzdb/dist/tzfile.5 (contents, props changed) vendor/tzdb/dist/tzfile.5.txt (contents, props changed) vendor/tzdb/dist/tzfile.h (contents, props changed) vendor/tzdb/dist/tzselect.8 (contents, props changed) vendor/tzdb/dist/tzselect.8.txt (contents, props changed) vendor/tzdb/dist/tzselect.ksh vendor/tzdb/dist/version vendor/tzdb/dist/workman.sh (contents, props changed) vendor/tzdb/dist/yearistype.sh (contents, props changed) vendor/tzdb/dist/zdump.8 (contents, props changed) vendor/tzdb/dist/zdump.8.txt (contents, props changed) vendor/tzdb/dist/zdump.c (contents, props changed) vendor/tzdb/dist/zic.8 (contents, props changed) vendor/tzdb/dist/zic.8.txt (contents, props changed) vendor/tzdb/dist/zic.c (contents, props changed) vendor/tzdb/dist/ziguard.awk (contents, props changed) vendor/tzdb/dist/zishrink.awk (contents, props changed) vendor/tzdb/dist/zone.tab vendor/tzdb/dist/zone1970.tab vendor/tzdb/dist/zoneinfo2tdf.pl (contents, props changed) Added: vendor/tzdb/dist/CONTRIBUTING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/tzdb/dist/CONTRIBUTING Sun Aug 12 12:10:33 2018 (r337683) @@ -0,0 +1,89 @@ +Contributing to the tz code and data + +The time zone database is by no means authoritative: governments +change timekeeping rules erratically and sometimes with little +warning, the data entries do not cover all of civil time before +1970, and undoubtedly errors remain in the code and data. Feel +free to fill gaps or fix mistakes, and please email improvements +to tz@iana.org for use in the future. In your email, please give +reliable sources that reviewers can check. + +----- + +Developers can contribute technical changes to the source code and +data as follows. + +To email small changes, please run a POSIX shell command like +'diff -u old/europe new/europe >myfix.patch', and attach +myfix.patch to the email. + +For more-elaborate changes, please read the theory.html file and browse +the mailing list archives for +examples of patches that tend to work well. Additions to +data should contain commentary citing reliable sources as +justification. Citations should use https: URLs if available. + +Please submit changes against either the latest release in + or the master branch of the development +repository. The latter is preferred. If you use Git the following +workflow may be helpful: + + * Copy the development repository. + + git clone https://github.com/eggert/tz.git + cd tz + + * Get current with the master branch. + + git checkout master + git pull + + * Switch to a new branch for the changes. Choose a different + branch name for each change set. + + git checkout -b mybranch + + * Sleuth by using 'git blame'. For example, when fixing data for + Africa/Sao_Tome, if the command 'git blame africa' outputs a line + '2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone + Africa/Sao_Tome 0:26:56 - LMT 1884', commit 2951fa3b should + provide some justification for the 'Zone Africa/Sao_Tome' line. + + * Edit source files. Include commentary that justifies the + changes by citing reliable sources. + + * Debug the changes, e.g.: + + make check + make install + ./zdump -v America/Los_Angeles + + * For each separable change, commit it in the new branch, e.g.: + + git add northamerica + git commit + + See recent 'git log' output for the commit-message style. + + * Create patch files 0001-*, 0002-*, ... + + git format-patch master + + * After reviewing the patch files, send the patches to tz@iana.org + for others to review. + + git send-email master + + For an archived example of such an email, see + . + + * Start anew by getting current with the master branch again + (the second step above). + +Please do not create issues or pull requests on GitHub, as the +proper procedure for proposing and distributing patches is via +email as illustrated above. + +----- + +This file is in the public domain. Added: vendor/tzdb/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/tzdb/dist/LICENSE Sun Aug 12 12:10:33 2018 (r337683) @@ -0,0 +1,5 @@ +Unless specified below, all files in the tz code and data (including +this LICENSE file) are in the public domain. + +If the files date.c, newstrftime.3, and strftime.c are present, they +contain material derived from BSD and use the BSD 3-clause license. Added: vendor/tzdb/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/tzdb/dist/Makefile Sun Aug 12 12:10:33 2018 (r337683) @@ -0,0 +1,1013 @@ +# This file is in the public domain, so clarified as of +# 2009-05-17 by Arthur David Olson. + +# Package name for the code distribution. +PACKAGE= tzcode + +# Version number for the distribution, overridden in the 'tarballs' rule below. +VERSION= unknown + +# Email address for bug reports. +BUGEMAIL= tz@iana.org + +# Choose source data features. To get new features right away, use: +# DATAFORM= vanguard +# To wait a while before using new features, to give downstream users +# time to upgrade zic (the default), use: +# DATAFORM= main +# To wait even longer for new features, use: +# DATAFORM= rearguard +DATAFORM= main + +# Change the line below for your time zone (after finding the zone you want in +# the time zone files, or adding it to a time zone file). +# Alternatively, if you discover you've got the wrong time zone, you can just +# zic -l rightzone +# to correct things. +# Use the command +# make zonenames +# to get a list of the values you can use for LOCALTIME. + +LOCALTIME= GMT + +# If you want something other than Eastern United States time as a template +# for handling POSIX-style time zone environment variables, +# change the line below (after finding the zone you want in the +# time zone files, or adding it to a time zone file). +# When a POSIX-style environment variable is handled, the rules in the +# template file are used to determine "spring forward" and "fall back" days and +# times; the environment variable itself specifies UT offsets of standard and +# daylight saving time. +# Alternatively, if you discover you've got the wrong time zone, you can just +# zic -p rightzone +# to correct things. +# Use the command +# make zonenames +# to get a list of the values you can use for POSIXRULES. +# If you want POSIX compatibility, use "America/New_York". + +POSIXRULES= America/New_York + +# Also see TZDEFRULESTRING below, which takes effect only +# if the time zone files cannot be accessed. + + +# Installation locations. +# +# The defaults are suitable for Debian, except that if REDO is +# posix_right or right_posix then files that Debian puts under +# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead +# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, +# respectively. Problems with the Debian approach are discussed in +# the commentary for the right_posix rule (below). + +# Destination directory, which can be used for staging. +# 'make DESTDIR=/stage install' installs under /stage (e.g., to +# /stage/etc/localtime instead of to /etc/localtime). Files under +# /stage are not intended to work as-is, but can be copied by hand to +# the root directory later. If DESTDIR is empty, 'make install' does +# not stage, but installs directly into production locations. +DESTDIR = + +# Everything is installed into subdirectories of TOPDIR, and used there. +# TOPDIR should be empty (meaning the root directory), +# or a directory name that does not end in "/". +# TOPDIR should be empty or an absolute name unless you're just testing. +TOPDIR = + +# The default local time zone is taken from the file TZDEFAULT. +TZDEFAULT = $(TOPDIR)/etc/localtime + +# The subdirectory containing installed program and data files, and +# likewise for installed files that can be shared among architectures. +# These should be relative file names. +USRDIR = usr +USRSHAREDIR = $(USRDIR)/share + +# "Compiled" time zone information is placed in the "TZDIR" directory +# (and subdirectories). +# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. +TZDIR_BASENAME= zoneinfo +TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) + +# The "tzselect" and (if you do "make INSTALL") "date" commands go in: +BINDIR = $(TOPDIR)/$(USRDIR)/bin + +# The "zdump" command goes in: +ZDUMPDIR = $(BINDIR) + +# The "zic" command goes in: +ZICDIR = $(TOPDIR)/$(USRDIR)/sbin + +# Manual pages go in subdirectories of. . . +MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man + +# Library functions are put in an archive in LIBDIR. +LIBDIR = $(TOPDIR)/$(USRDIR)/lib + + +# Types to try, as an alternative to time_t. int64_t should be first. +TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t + +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use +# REDO= posix_only +# below. If you want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use +# REDO= right_only +# below. If you want both sets of data available, with leap seconds not +# counted normally, use +# REDO= posix_right +# below. If you want both sets of data available, with leap seconds counted +# normally, use +# REDO= right_posix +# below. POSIX mandates that leap seconds not be counted; for compatibility +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). + +REDO= posix_right + +# To install data in text form that has all the information of the binary data, +# (optionally incorporating leap second information), use +# TZDATA_TEXT= tzdata.zi leapseconds +# To install text data without leap second information (e.g., because +# REDO='posix_only'), use +# TZDATA_TEXT= tzdata.zi +# To avoid installing text data, use +# TZDATA_TEXT= + +TZDATA_TEXT= leapseconds tzdata.zi + +# For backward-compatibility links for old zone names, use +# BACKWARD= backward +# If you also want the link US/Pacific-New, even though it is confusing +# and is planned to be removed from the database eventually, use +# BACKWARD= backward pacificnew +# To omit these links, use +# BACKWARD= + +BACKWARD= backward + +# If you want out-of-scope and often-wrong data from the file 'backzone', use +# PACKRATDATA= backzone +# To omit this data, use +# PACKRATDATA= + +PACKRATDATA= + +# The name of a locale using the UTF-8 encoding, used during self-tests. +# The tests are skipped if the name does not appear to work on this system. + +UTF8_LOCALE= en_US.utf8 + +# Since "." may not be in PATH... + +YEARISTYPE= ./yearistype + +# Non-default libraries needed to link. +LDLIBS= + +# Add the following to the end of the "CFLAGS=" line as needed to override +# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". +# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c) +# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime +# formats that generate only the last two digits of year numbers +# -DEPOCH_LOCAL if the 'time' function returns local time not UT +# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater +# than what POSIX specifies, assuming local time is UT. +# For example, N is 252460800 on AmigaOS. +# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r +# -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DIRECT_H if mkdir needs (MS-Windows) +# -DHAVE_GENERIC=0 if _Generic does not work +# -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris) +# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares +# ctime_r and asctime_r incompatibly with the POSIX standard +# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). +# -DHAVE_INTTYPES_H if you have a non-C99 compiler with +# -DHAVE_LINK=0 if your system lacks a link function +# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function +# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz +# localtime_rz can make zdump significantly faster, but is nonstandard. +# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare +# functions like 'link' or variables like 'tzname' required by POSIX +# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function +# -DHAVE_STDBOOL_H if you have a non-C99 compiler with +# -DHAVE_STDINT_H if you have a non-C99 compiler with +# -DHAVE_STRFTIME_L if declares locale_t and strftime_l +# -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function +# -DHAVE_SYMLINK=0 if your system lacks the symlink function +# -DHAVE_SYS_STAT_H=0 if your compiler lacks a +# -DHAVE_SYS_WAIT_H=0 if your compiler lacks a +# -DHAVE_TZSET=0 if your system lacks a tzset function +# -DHAVE_UNISTD_H=0 if your compiler lacks a +# -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers +# with external linkage, e.g., applications cannot define 'localtime'. +# -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has +# security implications and is not recommended for general use +# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; +# not needed by the main-program tz code, which is single-threaded. +# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. +# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t +# This is intended for internal use only; it mangles external names. +# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" +# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; +# the default is system-supplied, typically "/usr/lib/locale" +# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified +# DST transitions if the time zone files cannot be accessed +# -DUNINIT_TRAP if reading uninitialized storage can cause problems +# other than simply getting garbage data +# -DUSE_LTZ=0 to build zdump with the system time zone library +# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_MAX_ABBR_LEN_WO_WARN=3 +# (or some other number) to set the maximum time zone abbreviation length +# that zic will accept without a warning (the default is 6) +# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking +# Select instrumentation via "make GCC_INSTRUMENT='whatever'". +GCC_INSTRUMENT = \ + -fsanitize=undefined -fsanitize-address-use-after-scope \ + -fsanitize-undefined-trap-on-error -fstack-protector +GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ + $(GCC_INSTRUMENT) \ + -Wall -Wextra \ + -Walloc-size-larger-than=100000 -Warray-bounds=2 \ + -Wbad-function-cast -Wcast-align=strict -Wdate-time \ + -Wdeclaration-after-statement -Wdouble-promotion \ + -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ + -Winit-self -Wjump-misses-init -Wlogical-op \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wold-style-definition -Woverlength-strings -Wpointer-arith \ + -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=4 \ + -Wstringop-truncation -Wsuggest-attribute=cold \ + -Wsuggest-attribute=const -Wsuggest-attribute=format \ + -Wsuggest-attribute=malloc \ + -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ + -Wtrampolines -Wundef -Wuninitialized -Wunused \ + -Wvariadic-macros -Wvla -Wwrite-strings \ + -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ + -Wno-type-limits -Wno-unused-parameter +# +# If your system has a "GMT offset" field in its "struct tm"s +# (or if you decide to add such a field in your system's "time.h" file), +# add the name to a define such as +# -DTM_GMTOFF=tm_gmtoff +# to the end of the "CFLAGS=" line. If not defined, the code attempts to +# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. +# Similarly, if your system has a "zone abbreviation" field, define +# -DTM_ZONE=tm_zone +# and define NO_TM_ZONE to suppress any guessing. These two fields are not +# required by POSIX, but are widely available on GNU/Linux and BSD systems. +# +# The next batch of options control support for external variables +# exported by tzcode. In practice these variables are less useful +# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. +# # +# # To omit or support the external variable "tzname", add one of: +# # -DHAVE_TZNAME=0 +# # -DHAVE_TZNAME=1 +# # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later. +# # If not defined, the code attempts to guess HAVE_TZNAME from other macros. +# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause +# # crashes when combined with some platforms' standard libraries, +# # presumably due to memory allocation issues. +# # +# # To omit or support the external variables "timezone" and "daylight", add +# # -DUSG_COMPAT=0 +# # -DUSG_COMPAT=1 +# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by +# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later. +# # If not defined, the code attempts to guess USG_COMPAT from other macros. +# # +# # To support the external variable "altzone", add +# # -DALTZONE +# # to the end of the "CFLAGS=" line; although "altzone" appeared in +# # System V Release 3.1 it has not been standardized. +# +# If you want functions that were inspired by early versions of X3J11's work, +# add +# -DSTD_INSPIRED +# to the end of the "CFLAGS=" line. This arranges for the functions +# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff", +# "posix2time", and "time2posix" to be added to the time conversion library. +# "tzsetwall" is like "tzset" except that it arranges for local wall clock +# time (rather than the time specified in the TZ environment variable) +# to be used. +# "offtime" is like "gmtime" except that it accepts a second (long) argument +# that gives an offset to add to the time_t when converting it. +# "timelocal" is equivalent to "mktime". +# "timegm" is like "timelocal" except that it turns a struct tm into +# a time_t using UT (rather than local time as "timelocal" does). +# "timeoff" is like "timegm" except that it accepts a second (long) argument +# that gives an offset to use when converting to a time_t. +# "posix2time" and "time2posix" are described in an included manual page. +# X3J11's work does not describe any of these functions. +# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0. +# These functions may well disappear in future releases of the time +# conversion package. +# +# If you don't want functions that were inspired by NetBSD, add +# -DNETBSD_INSPIRED=0 +# to the end of the "CFLAGS=" line. Otherwise, the functions +# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the +# time library, and if STD_INSPIRED is also defined the functions +# "posix2time_z" and "time2posix_z" are added as well. +# The functions ending in "_z" (or "_rz") are like their unsuffixed +# (or suffixed-by-"_r") counterparts, except with an extra first +# argument of opaque type timezone_t that specifies the time zone. +# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. +# +# If you want to allocate state structures in localtime, add +# -DALL_STATE +# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. +# +# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put +# out by the National Institute of Standards and Technology +# which claims to test C and Posix conformance. If you want to pass PCTS, add +# -DPCTS +# to the end of the "CFLAGS=" line. +# +# If you want strict compliance with XPG4 as of 1994-04-09, add +# -DXPG4_1994_04_09 +# to the end of the "CFLAGS=" line. This causes "strftime" to always return +# 53 as a week number (rather than 52 or 53) for January days before +# January's first Monday when a "%V" format is used and January 1 +# falls on a Friday, Saturday, or Sunday. + +CFLAGS= + +# Linker flags. Default to $(LFLAGS) for backwards compatibility +# to release 2012h and earlier. + +LDFLAGS= $(LFLAGS) + +# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in +# submake command lines. The default is no leap seconds. + +LEAPSECONDS= + +# The zic command and its arguments. + +zic= ./zic +ZIC= $(zic) $(ZFLAGS) + +ZFLAGS= + +# How to use zic to install tz binary files. + +ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) + +# The name of a Posix-compliant 'awk' on your system. +AWK= awk + +# The full path name of a Posix-compliant shell, preferably one that supports +# the Korn shell's 'select' statement as an extension. +# These days, Bash is the most popular. +# It should be OK to set this to /bin/sh, on platforms where /bin/sh +# lacks 'select' or doesn't completely conform to Posix, but /bin/bash +# is typically nicer if it works. +KSHELL= /bin/bash + +# 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. +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. +# See for a validator, and +# for a validation library. +# Set VALIDATE=':' if you do not have such a program. +VALIDATE = nsgmls +VALIDATE_FLAGS = -s -B -wall -wno-unused-param +VALIDATE_ENV = \ + SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \ + SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \ + SP_CHARSET_FIXED=YES \ + SP_ENCODING=UTF-8 + +# This expensive test requires USE_LTZ. +# To suppress it, define this macro to be empty. +CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives + +# SAFE_CHAR is a regular expression that matches a safe character. +# Some parts of this distribution are limited to safe characters; +# others can use any UTF-8 character. +# For now, the safe characters are a safe subset of ASCII. +# The caller must set the shell variable 'sharp' to the character '#', +# since Makefile macros cannot contain '#'. +# TAB_CHAR is a single tab character, in single quotes. +TAB_CHAR= ' ' +SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' +SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' +SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' +SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) +SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' + +# Non-ASCII non-letters that OK_CHAR allows, as these characters are +# useful in commentary. XEmacs 21.5.34 displays them correctly, +# presumably because they are Latin-1. +UNUSUAL_OK_CHARSET= °±½¾× + +# OK_CHAR matches any character allowed in the distributed files. +# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and +# multibyte letters are also allowed so that commentary can contain a +# few safe symbols and people's names and can quote non-English sources. +# Other non-letters are limited to ASCII renderings for the +# convenience of maintainers using XEmacs 21.5.34, which by default +# mishandles Unicode characters U+0100 and greater. +OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' + +# SAFE_LINE matches a line of safe characters. +# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; +# this is so that comments can contain non-ASCII characters. +# OK_LINE matches a line of OK characters. +SAFE_LINE= '^'$(SAFE_CHAR)'*$$' +SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' +OK_LINE= '^'$(OK_CHAR)'*$$' + +# Flags to give 'tar' when making a distribution. +# Try to use flags appropriate for GNU tar. +GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name +TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ + then echo $(GNUTARFLAGS); \ + else :; \ + fi` + +# Flags to give 'gzip' when making a distribution. +GZIPFLAGS= -9n + +############################################################################### + +#MAKE= make + +cc= cc +CC= $(cc) -DTZDIR='"$(TZDIR)"' + +AR= ar + +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : + +TZCOBJS= zic.o +TZDOBJS= zdump.o localtime.o asctime.o strftime.o +DATEOBJS= date.o localtime.o strftime.o asctime.o +LIBSRCS= localtime.c asctime.c difftime.c +LIBOBJS= localtime.o asctime.o difftime.o +HEADERS= tzfile.h private.h +NONLIBSRCS= zic.c zdump.c +NEWUCBSRCS= date.c strftime.c +SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ + tzselect.ksh workman.sh +MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ + tzfile.5 tzselect.8 zic.8 zdump.8 +MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ + time2posix.3.txt \ + tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ + date.1.txt +COMMON= calendars CONTRIBUTING LICENSE Makefile \ + NEWS README theory.html version +WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) +PRIMARY_YDATA= africa antarctica asia australasia \ + europe northamerica southamerica +YDATA= $(PRIMARY_YDATA) etcetera +NDATA= systemv factory +TDATA_TO_CHECK= $(YDATA) $(NDATA) backward pacificnew +TDATA= $(YDATA) $(NDATA) $(BACKWARD) +ZONETABLES= zone1970.tab zone.tab +TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) +LEAP_DEPS= leapseconds.awk leap-seconds.list +TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA) +DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) +DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ + leapseconds yearistype.sh $(ZONETABLES) +AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ + ziguard.awk zishrink.awk +MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl +TZS_YEAR= 2050 +TZS= to$(TZS_YEAR).tzs +TZS_NEW= to$(TZS_YEAR)new.tzs +TZS_DEPS= $(PRIMARY_YDATA) asctime.c localtime.c \ + private.h tzfile.h zdump.c zic.c +ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi + +# Consult these files when deciding whether to rebuild the 'version' file. +# This list is not the same as the output of 'git ls-files', since +# .gitignore is not distributed. +VERSION_DEPS= \ + calendars CONTRIBUTING LICENSE Makefile NEWS README \ + africa antarctica asctime.c asia australasia \ + backward backzone \ + checklinks.awk checktab.awk \ + date.1 date.c difftime.c \ + etcetera europe factory iso3166.tab \ + leap-seconds.list leapseconds.awk localtime.c \ + newctime.3 newstrftime.3 newtzset.3 northamerica \ + pacificnew private.h \ + southamerica strftime.c systemv theory.html \ + time2posix.3 tz-art.html tz-how-to.html tz-link.html \ + tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ + workman.sh yearistype.sh \ + zdump.8 zdump.c zic.8 zic.c \ + ziguard.awk zishrink.awk \ + zone.tab zone1970.tab zoneinfo2tdf.pl + +# And for the benefit of csh users on systems that assume the user +# shell should be used to handle commands in Makefiles. . . + +SHELL= /bin/sh + +all: tzselect yearistype zic zdump libtz.a $(TABDATA) \ + vanguard.zi main.zi rearguard.zi + +ALL: all date $(ENCHILADA) + +install: all $(DATA) $(REDO) $(MANS) + mkdir -p '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ + '$(DESTDIR)$(LIBDIR)' \ + '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ + '$(DESTDIR)$(MANDIR)/man8' + $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \ + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' + cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' + cp zic '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' + cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' + cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' + +INSTALL: ALL install date.1 + mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' + cp date '$(DESTDIR)$(BINDIR)/.' + cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' + +version: $(VERSION_DEPS) + { (type git) >/dev/null 2>&1 && \ + V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ + --abbrev=7 --dirty` || \ + V='$(VERSION)'; } && \ + printf '%s\n' "$$V" >$@.out + mv $@.out $@ + +# These files can be tailored by setting BACKWARD, PACKRATDATA, etc. +vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) + $(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \ + $(TDATA) $(PACKRATDATA) >$@.out + mv $@.out $@ +tzdata.zi: $(DATAFORM).zi version + version=`sed 1q version` && \ + LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \ + $(DATAFORM).zi >$@.out + mv $@.out $@ + +version.h: version + VERSION=`cat version` && printf '%s\n' \ + 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ + "static char const TZVERSION[]=\"$$VERSION\";" \ + 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ + >$@.out + mv $@.out $@ + +zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + +yearistype: yearistype.sh + cp yearistype.sh yearistype + chmod +x yearistype + +leapseconds: $(LEAP_DEPS) + $(AWK) -f leapseconds.awk leap-seconds.list >$@.out + mv $@.out $@ + +# Arguments to pass to submakes of install_data. +# They can be overridden by later submake arguments. +INSTALLARGS = \ + BACKWARD='$(BACKWARD)' \ + DESTDIR='$(DESTDIR)' \ + LEAPSECONDS='$(LEAPSECONDS)' \ + PACKRATDATA='$(PACKRATDATA)' \ + TZDEFAULT='$(TZDEFAULT)' \ + TZDIR='$(TZDIR)' \ + YEARISTYPE='$(YEARISTYPE)' \ + ZIC='$(ZIC)' + +# 'make install_data' installs one set of tz binary files. +install_data: zic leapseconds yearistype tzdata.zi + $(ZIC_INSTALL) tzdata.zi + +posix_only: + $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data + +right_only: + $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ + install_data + +# In earlier versions of this makefile, the other two directories were +# subdirectories of $(TZDIR). However, this led to configuration errors. +# For example, with posix_right under the earlier scheme, +# TZ='right/Australia/Adelaide' got you localtime with leap seconds, +# but gmtime without leap seconds, which led to problems with applications +# like sendmail that subtract gmtime from localtime. +# Therefore, the other two directories are now siblings of $(TZDIR). +# You must replace all of $(TZDIR) to switch from not using leap seconds +# to using them, or vice versa. +right_posix: right_only + rm -fr '$(DESTDIR)$(TZDIR)-leaps' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + +posix_right: posix_only + rm -fr '$(DESTDIR)$(TZDIR)-posix' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + +# This obsolescent rule is present for backwards compatibility with +# tz releases 2014g through 2015g. It should go away eventually. +posix_packrat: + $(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only + +zones: $(REDO) + +# dummy.zd is not a real file; it is mentioned here only so that the +# top-level 'make' does not have a syntax error. +ZDS = dummy.zd +# Rule used only by submakes invoked by the $(TZS_NEW) rule. +# It is separate so that GNU 'make -j' can run instances in parallel. +$(ZDS): zdump + ./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@ : '\(.*\).zd') >$@ + +$(TZS_NEW): tzdata.zi zdump zic + rm -fr tzs.dir + mkdir tzs.dir + $(zic) -d tzs.dir tzdata.zi + $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ + tzdata.zi | LC_ALL=C sort >$@.out + wd=`pwd` && \ + set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \ + | LC_ALL=C sort -t . -k 2,2` && \ + shift && \ + ZDS=$$* && \ + $(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs.dir + mv $@.out $@ + +# If $(TZS) does not already exist (e.g., old-format tarballs), create it. +# If it exists but 'make check_tzs' fails, a maintainer should inspect the +# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. +$(TZS): + $(MAKE) force_tzs + +force_tzs: $(TZS_NEW) + cp $(TZS_NEW) $(TZS) + +libtz.a: $(LIBOBJS) + rm -f $@ + $(AR) -rc $@ $(LIBOBJS) + $(RANLIB) $@ + +date: $(DATEOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + +tzselect: tzselect.ksh version + VERSION=`cat version` && sed \ + -e 's|#!/bin/bash|#!$(KSHELL)|g' \ + -e 's|AWK=[^}]*|AWK=$(AWK)|g' \ + -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ + -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ + -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ + -e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \ + <$@.ksh >$@.out + chmod +x $@.out + mv $@.out $@ + +check: check_character_set check_white_space check_links \ + check_name_lengths check_sorted \ + check_tables check_web check_zishrink check_tzs + +check_character_set: $(ENCHILADA) + test ! '$(UTF8_LOCALE)' || \ + ! printf 'A\304\200B\n' | \ + LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \ + LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \ + sharp='#' && \ + ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ + $(MISC) $(SOURCES) $(WEB_PAGES) \ + CONTRIBUTING LICENSE README \ + version tzdata.zi && \ + ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \ + Makefile && \ + ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ + leapseconds yearistype.sh zone.tab && \ + ! grep -Env $(OK_LINE) $(ENCHILADA); \ + } + +check_white_space: $(ENCHILADA) + patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ + ! grep -En "$$pat" $(ENCHILADA) + ! grep -n '[[:space:]]$$' \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) + +PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+ +FILE_NAME_COMPONENT_TOO_LONG = \ + $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15} + +check_name_lengths: $(TDATA_TO_CHECK) backzone + ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ + $(TDATA_TO_CHECK) backzone + +CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } + +check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab + $(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu + $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu + $(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu + $(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c + $(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \ + LC_ALL=C sort -c + $(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \ + LC_ALL=C sort -cu + +check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi + $(AWK) -f checklinks.awk $(TDATA_TO_CHECK) + $(AWK) -f checklinks.awk tzdata.zi + +check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES) + for tab in $(ZONETABLES); do \ + $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \ + || exit; \ + done + +check_tzs: $(TZS) $(TZS_NEW) + diff -u $(TZS) $(TZS_NEW) + +# This checks only the HTML 4.01 strict page. +# To check the the other pages, use . +check_web: tz-how-to.html + $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html + +# Check that zishrink.awk does not alter the data, and that ziguard.awk +# preserves main-format data. +check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \ + $(DATAFORM).zi tzdata.zi + for type in posix right; do \ + mkdir -p time_t.dir/$$type time_t.dir/$$type-t \ + time_t.dir/$$type-shrunk && \ + case $$type in \ + right) leap='-L leapseconds';; \ + *) leap=;; \ + esac && \ + $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \ + case $(DATAFORM) in \ + main) \ + $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \ + $(AWK) '/^Rule/' $(TDATA) | \ + $(ZIC) $$leap -d time_t.dir/$$type-t - \ + $(PACKRATDATA) && \ + diff -r time_t.dir/$$type time_t.dir/$$type-t;; \ + esac && \ + $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \ + diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \ + done + rm -fr time_t.dir + +clean_misc: + rm -f core *.o *.out \ + date tzselect version.h zdump zic yearistype libtz.a +clean: clean_misc + rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW) + +maintainer-clean: clean + @echo 'This command is intended for maintainers to use; it' + @echo 'deletes files that may need special tools to rebuild.' + rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.* + +names: + @echo $(ENCHILADA) + +public: check check_public $(CHECK_TIME_T_ALTERNATIVES) \ + tarballs signatures + +date.1.txt: date.1 +newctime.3.txt: newctime.3 +newstrftime.3.txt: newstrftime.3 +newtzset.3.txt: newtzset.3 +time2posix.3.txt: time2posix.3 +tzfile.5.txt: tzfile.5 +tzselect.8.txt: tzselect.8 +zdump.8.txt: zdump.8 +zic.8.txt: zic.8 + +$(MANTXTS): workman.sh + LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out + mv $@.out $@ + +# Set the time stamps to those of the git repository, if available, +# and if the files have not changed since then. +# This uses GNU 'touch' syntax 'touch -d@N FILE', +# where N is the number of seconds since 1970. +# If git or GNU 'touch' is absent, don't bother to sync with git timestamps. +# Also, set the timestamp of each prebuilt file like 'leapseconds' +# to be the maximum of the files it depends on. +set-timestamps.out: $(ENCHILADA) + rm -f $@ + if (type git) >/dev/null 2>&1 && \ + files=`git ls-files $(ENCHILADA)` && \ + touch -md @1 test.out; then \ + rm -f test.out && \ + for file in $$files; do \ + if git diff --quiet $$file; then \ + time=`git log -1 --format='tformat:%ct' $$file` && \ + touch -cmd @$$time $$file; \ + else \ + echo >&2 "$$file: warning: does not match repository"; \ + fi || exit; \ + done; \ + fi + touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds + for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \ + touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \ + exit; \ + done + touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi + touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS) + touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version + touch $@ + +# The zics below ensure that each data file can stand on its own. +# We also do an all-files run to catch links to links. + +check_public: + $(MAKE) maintainer-clean + $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL + mkdir -p public.dir + for i in $(TDATA_TO_CHECK) tzdata.zi; do \ + $(zic) -v -d public.dir $$i 2>&1 || exit; \ + done + $(zic) -v -d public.dir $(TDATA_TO_CHECK) + rm -fr public.dir + +# Check that the code works under various alternative +# implementations of time_t. +check_time_t_alternatives: + if diff -q Makefile Makefile 2>/dev/null; then \ + quiet_option='-q'; \ + else \ + quiet_option=''; \ + fi && \ + wd=`pwd` && \ + zones=`$(AWK) '/^[^#]/ { print $$3 }' 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 B09A9106E7F4; Sun, 12 Aug 2018 12:11:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67215850CD; Sun, 12 Aug 2018 12:11:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ECE325D3A; Sun, 12 Aug 2018 12:11:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7CCBUvk033832; Sun, 12 Aug 2018 12:11:30 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CCBURq033831; Sun, 12 Aug 2018 12:11:30 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808121211.w7CCBURq033831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 12 Aug 2018 12:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337684 - vendor/tzdb/2018e X-SVN-Group: vendor X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: vendor/tzdb/2018e X-SVN-Commit-Revision: 337684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 12:11:30 -0000 Author: eadler Date: Sun Aug 12 12:11:29 2018 New Revision: 337684 URL: https://svnweb.freebsd.org/changeset/base/337684 Log: tzdb: tag 2018e Added: vendor/tzdb/2018e/ - copied from r337683, vendor/tzdb/dist/ From owner-svn-src-all@freebsd.org Sun Aug 12 12:40: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 70A5B106F611; Sun, 12 Aug 2018 12:40:39 +0000 (UTC) (envelope-from philip@trouble.is) 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)) by mx1.freebsd.org (Postfix) with ESMTPS id EE8D786243; Sun, 12 Aug 2018 12:40:35 +0000 (UTC) (envelope-from philip@trouble.is) Received: from rincewind.trouble.is (rincewind.trouble.is [IPv6:2a01:4f8:a0:10e6::1:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 41pJNz1bV1z3C1f; Sun, 12 Aug 2018 12:40:35 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, from userid 1001) id 41pJNy6B2rzC8b; Sun, 12 Aug 2018 12:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trouble.is; s=20180707; t=1534077634; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UNPykB6cblkunbGmobP2u/ZGyp1aqtie5//0/aeLfOc=; b=eZMakbRdpJeiMzGjSE127PG10yJZKvOpYGXhmJoiHmjozYmpInyfF2GxAunu2EEMyjXjuq UE8CH89kCQrcJeNZCxMph/bJnEqdrGCWBCml+aWAAAPqqm+bDzM4YCrdoAg0IhREw/OfQx wTrQAO7qyayZieF5bJduerL0xz0dIbgk+o3Wrq9gsZfxJHSKlpMAmDoI4TE/FT4AlhsYUK O55vhM9BQC8dnlu4Qy83NQ1VHMqdBdYpT35ja5bvID4FQsQ3AJYtOI31YpqLQzjCHgGBZ3 bfzzPKfQ2ESjfk35cFaaDcKfuZaC61szjHNUNmiDCQQ+ybbpd/DhbiiYWoYDWQ== Date: Sun, 12 Aug 2018 20:40:34 +0800 From: Philip Paeps To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r337683 - in vendor/tzdb: . dist Message-ID: <20180812124034.GB30769@rincewind.trouble.is> Mail-Followup-To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org References: <201808121210.w7CCAXB7029893@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <201808121210.w7CCAXB7029893@repo.freebsd.org> X-PGP-Fingerprint: 2CD1 92C2 6EE7 B7D1 F552 6619 31AE B9B5 FDBB CB0E X-Date: Today is Prickle-Prickle, the 5th day of Bureaucracy in the YOLD 3184 X-Phase-of-Moon: The Moon is Waxing Crescent (2% of Full) X-Clacks-Overhead: GNU Terry Pratchett Organization: Happily Disorganized User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 12:40:39 -0000 On 2018-08-12 12:10:33 (+0000), Eitan Adler wrote: >Author: eadler >Date: Sun Aug 12 12:10:33 2018 >New Revision: 337683 >URL: https://svnweb.freebsd.org/changeset/base/337683 > >Log: > vendor/tzdb: reimport IANA database+code in a standard layout > > I am using a new directory since the layout of both the vendor area and > contrib/ need to be changed. > I would have *strongly* preferred you to import tzcode separately from tzdata so as not to frustrate future updates of the tzdata. The IANA tzdb project releases tzdata and tzcode in separate tarballs. tzdata updates happen comparatively frequently and we like to issue errata notices for them. tzcode doesn't change very often. Would you mind backing this out and importing tzcode separately? Thank you. Philip -- Philip Paeps Senior Reality Engineer Ministry of Information From owner-svn-src-all@freebsd.org Sun Aug 12 12:46: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 A3148106F866; Sun, 12 Aug 2018 12:46:30 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A77D867D5; Sun, 12 Aug 2018 12:46:30 +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 112A118F22; Sun, 12 Aug 2018 12:46:30 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from rincewind.trouble.is (rincewind.trouble.is [88.198.44.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 41pJWm659Wz3C1f; Sun, 12 Aug 2018 12:46:28 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, authenticated sender philip) id 41pJWk4z0KzC8g; Sun, 12 Aug 2018 12:46:26 +0000 (UTC) From: "Philip Paeps" To: "Eitan Adler" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r337683 - in vendor/tzdb: . dist Date: Sun, 12 Aug 2018 20:46:22 +0800 X-Clacks-Overhead: GNU Terry Pratchett X-Mailer: MailMate (1.11.3r5511) Message-ID: In-Reply-To: <20180812124034.GB30769@rincewind.trouble.is> References: <201808121210.w7CCAXB7029893@repo.freebsd.org> <20180812124034.GB30769@rincewind.trouble.is> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 12:46:30 -0000 On 2018-08-12 20:40:34 (+0800), Philip Paeps wrote: > On 2018-08-12 12:10:33 (+0000), Eitan Adler wrote: >> Author: eadler >> Date: Sun Aug 12 12:10:33 2018 >> New Revision: 337683 >> URL: https://svnweb.freebsd.org/changeset/base/337683 >> >> Log: >> vendor/tzdb: reimport IANA database+code in a standard layout >> >> I am using a new directory since the layout of both the vendor area >> and >> contrib/ need to be changed. >> > > I would have *strongly* preferred you to import tzcode separately from > tzdata so as not to frustrate future updates of the tzdata. > > The IANA tzdb project releases tzdata and tzcode in separate tarballs. > > tzdata updates happen comparatively frequently and we like to issue > errata notices for them. tzcode doesn't change very often. > > Would you mind backing this out and importing tzcode separately? To clarify: please import the tzcode tarball into vendor/tzcode (https://data.iana.org/time-zones/releases/tzcode2018e.tar.gz) and svn rm vendor/tzdb. The tzdata code is kept in vendor/tzdata and is up to date with the latest upstream (and I intend to keep it that way, getting errata notices issued as necessary). Many thanks. Philip -- Philip Paeps Senior Reality Engineer Ministry of Information From owner-svn-src-all@freebsd.org Sun Aug 12 12:58: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 CDEC1106FB80; Sun, 12 Aug 2018 12:58:06 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7357986C1B; Sun, 12 Aug 2018 12:58:06 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 461BB264E4; Sun, 12 Aug 2018 12:58:06 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7CCw5kU055859; Sun, 12 Aug 2018 12:58:05 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CCw5xM055858; Sun, 12 Aug 2018 12:58:05 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201808121258.w7CCw5xM055858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sun, 12 Aug 2018 12:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337685 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 337685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 12:58:07 -0000 Author: lwhsu Date: Sun Aug 12 12:58:05 2018 New Revision: 337685 URL: https://svnweb.freebsd.org/changeset/base/337685 Log: Adding myself to committers-src.dot Approved by: markj (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Aug 12 12:11:29 2018 (r337684) +++ head/share/misc/committers-src.dot Sun Aug 12 12:58:05 2018 (r337685) @@ -240,6 +240,7 @@ lidl [label="Kurt Lidl\nlidl@FreeBSD.org\n2015/10/21"] loos [label="Luiz Otavio O Souza\nloos@FreeBSD.org\n2013/07/03"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] luporl [label="Leandro Lupori\nluporl@FreeBSD.org\n2018/05/21"] +lwhsu [label="Li-Wen Hsu\nlwhsu@FreeBSD.org\n2018/08/09"] manu [label="Emmanuel Vadot\nmanu@FreeBSD.org\n2016/04/24"] marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] marius [label="Marius Strobl\nmarius@FreeBSD.org\n2004/04/17"] @@ -499,6 +500,7 @@ emaste -> achim emaste -> bwidawsk emaste -> dteske emaste -> kevans +emaste -> lwhsu emaste -> markj emaste -> rstone @@ -684,6 +686,7 @@ marcel -> nwhitehorn marcel -> sjg markj -> cem +markj -> lwhsu markj -> rlibby markm -> jasone From owner-svn-src-all@freebsd.org Sun Aug 12 13:24: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 BE09D10701FA; Sun, 12 Aug 2018 13:24:54 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74073880DD; Sun, 12 Aug 2018 13:24:54 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 512E6269AC; Sun, 12 Aug 2018 13:24:54 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7CDOsxW071456; Sun, 12 Aug 2018 13:24:54 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CDOrqi071453; Sun, 12 Aug 2018 13:24:53 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808121324.w7CDOrqi071453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sun, 12 Aug 2018 13:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337686 - in head: etc etc/newsyslog.conf.d usr.sbin/newsyslog usr.sbin/newsyslog/newsyslog.conf.d X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc etc/newsyslog.conf.d usr.sbin/newsyslog usr.sbin/newsyslog/newsyslog.conf.d X-SVN-Commit-Revision: 337686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 13:24:55 -0000 Author: brd Date: Sun Aug 12 13:24:53 2018 New Revision: 337686 URL: https://svnweb.freebsd.org/changeset/base/337686 Log: Move all the newsyslog related configs to usr.sbin/newsyslog/ This is related to pkgbase and changes these to use CONFS so that these are tagged as config files. Approved by: AllanJude (mentor) Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16694 Added: head/usr.sbin/newsyslog/newsyslog.conf - copied unchanged from r337685, head/etc/newsyslog.conf head/usr.sbin/newsyslog/newsyslog.conf.d/ - copied from r337685, head/etc/newsyslog.conf.d/ Deleted: head/etc/newsyslog.conf head/etc/newsyslog.conf.d/ Modified: head/etc/Makefile head/usr.sbin/newsyslog/Makefile head/usr.sbin/newsyslog/newsyslog.conf.d/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Aug 12 12:58:05 2018 (r337685) +++ head/etc/Makefile Sun Aug 12 13:24:53 2018 (r337686) @@ -31,7 +31,6 @@ BIN1= crontab \ motd \ netconfig \ networks \ - newsyslog.conf \ nsswitch.conf \ phones \ profile \ @@ -170,7 +169,6 @@ distribution: ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install - ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt Modified: head/usr.sbin/newsyslog/Makefile ============================================================================== --- head/usr.sbin/newsyslog/Makefile Sun Aug 12 12:58:05 2018 (r337685) +++ head/usr.sbin/newsyslog/Makefile Sun Aug 12 13:24:53 2018 (r337686) @@ -2,6 +2,7 @@ .include +CONFS= newsyslog.conf PROG= newsyslog MAN= newsyslog.8 newsyslog.conf.5 SRCS= newsyslog.c ptimes.c @@ -9,5 +10,6 @@ LIBADD= sbuf HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +SUBDIR+= newsyslog.conf.d .include Copied: head/usr.sbin/newsyslog/newsyslog.conf (from r337685, head/etc/newsyslog.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/newsyslog/newsyslog.conf Sun Aug 12 13:24:53 2018 (r337686, copy of r337685, head/etc/newsyslog.conf) @@ -0,0 +1,35 @@ +# configuration file for newsyslog +# $FreeBSD$ +# +# Entries which do not specify the '/pid_file' field will cause the +# syslogd process to be signalled when that log file is rotated. This +# action is only appropriate for log files which are written to by the +# syslogd process (ie, files listed in /etc/syslog.conf). If there +# is no process which needs to be signalled when a given log file is +# rotated, then the entry for that file should include the 'N' flag. +# +# Note: some sites will want to select more restrictive protections than the +# defaults. In particular, it may be desirable to switch many of the 644 +# entries to 640 or 600. For example, some sites will consider the +# contents of maillog, messages, and lpd-errs to be confidential. In the +# future, these defaults may change to more conservative ones. +# +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +/var/log/all.log 600 7 * @T00 J +/var/log/auth.log 600 7 1000 @0101T JC +/var/log/console.log 600 5 1000 * J +/var/log/cron 600 3 1000 * JC +/var/log/daily.log 640 7 * @T00 JN +/var/log/debug.log 600 7 1000 * JC +/var/log/init.log 644 3 1000 * J +/var/log/kerberos.log 600 7 1000 * J +/var/log/maillog 640 7 * @T00 JC +/var/log/messages 644 5 1000 @0101T JC +/var/log/monthly.log 640 12 * $M1D0 JN +/var/log/devd.log 644 3 1000 * JC +/var/log/security 600 10 1000 * JC +/var/log/utx.log 644 3 * @01T05 B +/var/log/weekly.log 640 5 * $W6D0 JN + + /etc/newsyslog.conf.d/* + /usr/local/etc/newsyslog.conf.d/* Modified: head/usr.sbin/newsyslog/newsyslog.conf.d/Makefile ============================================================================== --- head/etc/newsyslog.conf.d/Makefile Sun Aug 12 12:58:05 2018 (r337685) +++ head/usr.sbin/newsyslog/newsyslog.conf.d/Makefile Sun Aug 12 13:24:53 2018 (r337686) @@ -2,36 +2,36 @@ .include -BINDIR= /etc/newsyslog.conf.d +CONFSDIR= /etc/newsyslog.conf.d -FILES= +CONFS= .if ${MK_AMD} != "no" -FILES+= amd.conf +CONFS+= amd.conf .endif .if ${MK_FTP} != "no" -FILES+= ftp.conf +CONFS+= ftp.conf .endif .if ${MK_LPR} != "no" -FILES+= lpr.conf +CONFS+= lpr.conf .endif .if ${MK_OFED} != "no" -FILES+= opensm.conf +CONFS+= opensm.conf .endif .if ${MK_PF} != "no" -FILES+= pf.conf +CONFS+= pf.conf .endif .if ${MK_PPP} != "no" -FILES+= ppp.conf +CONFS+= ppp.conf .endif .if ${MK_SENDMAIL} != "no" -FILES+= sendmail.conf +CONFS+= sendmail.conf .endif .include From owner-svn-src-all@freebsd.org Sun Aug 12 13:29: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 1E55D107034D; Sun, 12 Aug 2018 13:29:42 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD4E788302; Sun, 12 Aug 2018 13:29:41 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 781D1269B3; Sun, 12 Aug 2018 13:29:41 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7CDTf6i071792; Sun, 12 Aug 2018 13:29:41 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CDTe7P071789; Sun, 12 Aug 2018 13:29:40 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808121329.w7CDTe7P071789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sun, 12 Aug 2018 13:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337687 - in head: etc usr.sbin/inetd X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc usr.sbin/inetd X-SVN-Commit-Revision: 337687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 13:29:42 -0000 Author: brd Date: Sun Aug 12 13:29:40 2018 New Revision: 337687 URL: https://svnweb.freebsd.org/changeset/base/337687 Log: Move inetd.conf to usr.sbin/inetd/ This is pkgbase related as it uses CONFS to tag the file as a config file Approved by: AllanJude (mentor) Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16693 Added: head/usr.sbin/inetd/inetd.conf - copied unchanged from r337686, head/etc/inetd.conf Deleted: head/etc/inetd.conf Modified: head/etc/Makefile head/usr.sbin/inetd/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Aug 12 13:24:53 2018 (r337686) +++ head/etc/Makefile Sun Aug 12 13:29:40 2018 (r337687) @@ -63,10 +63,6 @@ BIN1+= amd.map BIN1+= ftpusers .endif -.if ${MK_INETD} != "no" -BIN1+= inetd.conf -.endif - .if ${MK_LOCATE} != "no" BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc .endif Modified: head/usr.sbin/inetd/Makefile ============================================================================== --- head/usr.sbin/inetd/Makefile Sun Aug 12 13:24:53 2018 (r337686) +++ head/usr.sbin/inetd/Makefile Sun Aug 12 13:29:40 2018 (r337687) @@ -3,6 +3,7 @@ .include +CONFS= inetd.conf PROG= inetd MAN= inetd.8 MLINKS= inetd.8 inetd.conf.5 Copied: head/usr.sbin/inetd/inetd.conf (from r337686, head/etc/inetd.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/inetd/inetd.conf Sun Aug 12 13:29:40 2018 (r337687, copy of r337686, head/etc/inetd.conf) @@ -0,0 +1,123 @@ +# $FreeBSD$ +# +# Internet server configuration database +# +# Define *both* IPv4 and IPv6 entries for dual-stack support. +# To disable a service, comment it out by prefixing the line with '#'. +# To enable a service, remove the '#' at the beginning of the line. +# +#ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l +#ftp stream tcp6 nowait root /usr/libexec/ftpd ftpd -l +#ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4 +#ssh stream tcp6 nowait root /usr/sbin/sshd sshd -i -6 +#telnet stream tcp nowait root /usr/libexec/telnetd telnetd +#telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd +#shell stream tcp nowait root /usr/local/sbin/rshd rshd +#shell stream tcp6 nowait root /usr/local/sbin/rshd rshd +#login stream tcp nowait root /usr/local/sbin/rlogind rlogind +#login stream tcp6 nowait root /usr/local/sbin/rlogind rlogind +#finger stream tcp nowait/3/10 nobody /usr/libexec/fingerd fingerd -k -s +#finger stream tcp6 nowait/3/10 nobody /usr/libexec/fingerd fingerd -k -s +# +# run comsat as root to be able to print partial mailbox contents w/ biff, +# or use the safer tty:tty to just print that new mail has been received. +#comsat dgram udp wait tty:tty /usr/libexec/comsat comsat +# +# ntalk is required for the 'talk' utility to work correctly +#ntalk dgram udp wait tty:tty /usr/libexec/ntalkd ntalkd +#tftp dgram udp wait root /usr/libexec/tftpd tftpd -l -s /tftpboot +#tftp dgram udp6 wait root /usr/libexec/tftpd tftpd -l -s /tftpboot +#bootps dgram udp wait root /usr/libexec/bootpd bootpd +# +# "Small servers" -- used to be standard on, but we're more conservative +# about things due to Internet security concerns. Only turn on what you +# need. +# +#daytime stream tcp nowait root internal +#daytime stream tcp6 nowait root internal +#daytime dgram udp wait root internal +#daytime dgram udp6 wait root internal +#time stream tcp nowait root internal +#time stream tcp6 nowait root internal +#time dgram udp wait root internal +#time dgram udp6 wait root internal +#echo stream tcp nowait root internal +#echo stream tcp6 nowait root internal +#echo dgram udp wait root internal +#echo dgram udp6 wait root internal +#discard stream tcp nowait root internal +#discard stream tcp6 nowait root internal +#discard dgram udp wait root internal +#discard dgram udp6 wait root internal +#chargen stream tcp nowait root internal +#chargen stream tcp6 nowait root internal +#chargen dgram udp wait root internal +#chargen dgram udp6 wait root internal +# +# CVS servers - for master CVS repositories only! You must set the +# --allow-root path correctly or you open a trivial to exploit but +# deadly security hole. +# +#cvspserver stream tcp nowait root /usr/local/bin/cvs cvs --allow-root=/your/cvsroot/here pserver +#cvspserver stream tcp nowait root /usr/local/bin/cvs cvs --allow-root=/your/cvsroot/here kserver +# +# RPC based services (you MUST have rpcbind running to use these) +# +#rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd +#rusersd/1-2 dgram rpc/udp wait root /usr/libexec/rpc.rusersd rpc.rusersd +#walld/1 dgram rpc/udp wait root /usr/libexec/rpc.rwalld rpc.rwalld +#pcnfsd/1-2 dgram rpc/udp wait root /usr/local/libexec/rpc.pcnfsd rpc.pcnfsd +#rquotad/1 dgram rpc/udp wait root /usr/libexec/rpc.rquotad rpc.rquotad +#rquotad/1 dgram rpc/udp6 wait root /usr/libexec/rpc.rquotad rpc.rquotad +#sprayd/1 dgram rpc/udp wait root /usr/libexec/rpc.sprayd rpc.sprayd +# +# example entry for the optional pop3 server +# +#pop3 stream tcp nowait root /usr/local/libexec/popper popper +# +# example entry for the optional imap4 server +# +#imap4 stream tcp nowait root /usr/local/libexec/imapd imapd +# +# example entry for the optional nntp server +# +#nntp stream tcp nowait news /usr/local/libexec/nntpd nntpd +# +# example entry for the optional uucpd server +# +#uucpd stream tcp nowait root /usr/local/libexec/uucpd uucpd +# +# Return error for all "ident" requests +# +#auth stream tcp nowait root internal +#auth stream tcp6 nowait root internal +# +# Provide internally a real "ident" service which provides ~/.fakeid support, +# provides ~/.noident support, reports UNKNOWN as the operating system type +# and times out after 30 seconds. +# +#auth stream tcp nowait root internal auth -r -f -n -o UNKNOWN -t 30 +#auth stream tcp6 nowait root internal auth -r -f -n -o UNKNOWN -t 30 +# +# Example entry for an external ident server +# +#auth stream tcp wait root /usr/local/sbin/identd identd -w -t120 +# +# Example entry for the optional qmail MTA +# NOTE: This is no longer the correct way to handle incoming SMTP +# connections for qmail. Use tcpserver (http://cr.yp.to/ucspi-tcp.html) +# instead. +# +#smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env tcp-env /var/qmail/bin/qmail-smtpd +# +# Enable the following two entries to enable samba startup from inetd +# (from the Samba documentation). Enable the third entry to enable the swat +# samba configuration tool. +# +#netbios-ssn stream tcp nowait root /usr/local/sbin/smbd smbd +#netbios-ns dgram udp wait root /usr/local/sbin/nmbd nmbd +#swat stream tcp nowait/400 root /usr/local/sbin/swat swat +# +# Example entry for the Prometheus sysctl metrics exporter +# +#prom-sysctl stream tcp nowait nobody /usr/sbin/prometheus_sysctl_exporter prometheus_sysctl_exporter -dgh From owner-svn-src-all@freebsd.org Sun Aug 12 14:05:16 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 A5DAE1071543; Sun, 12 Aug 2018 14:05:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A86389B86; Sun, 12 Aug 2018 14:05:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 385842700E; Sun, 12 Aug 2018 14:05:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7CE5GbH092582; Sun, 12 Aug 2018 14:05:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CE5GBH092581; Sun, 12 Aug 2018 14:05:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201808121405.w7CE5GBH092581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 12 Aug 2018 14:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337688 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 14:05:16 -0000 Author: tuexen Date: Sun Aug 12 14:05:15 2018 New Revision: 337688 URL: https://svnweb.freebsd.org/changeset/base/337688 Log: Add explicit cast to silence a warning for the userland stack. Thanks to Felix Weinrank for providing the patch. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Aug 12 13:29:40 2018 (r337687) +++ head/sys/netinet/sctp_output.c Sun Aug 12 14:05:15 2018 (r337688) @@ -4396,7 +4396,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, } else { ip6h->ip6_nxt = IPPROTO_SCTP; } - ip6h->ip6_plen = htons(packet_length - sizeof(struct ip6_hdr)); + ip6h->ip6_plen = htons((uint16_t)(packet_length - sizeof(struct ip6_hdr))); ip6h->ip6_dst = sin6->sin6_addr; /* @@ -11258,7 +11258,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad #endif #ifdef INET6 case AF_INET6: - ip6->ip6_plen = htons(len - sizeof(struct ip6_hdr)); + ip6->ip6_plen = htons((uint16_t)(len - sizeof(struct ip6_hdr))); if (port) { shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); From owner-svn-src-all@freebsd.org Sun Aug 12 15:51: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 68AA71074A27; Sun, 12 Aug 2018 15:51:00 +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 C10E68DA77; Sun, 12 Aug 2018 15:50:59 +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 w7CFovnW033113; Sun, 12 Aug 2018 08:50:57 -0700 (PDT) (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 w7CFovDw033112; Sun, 12 Aug 2018 08:50:57 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808121550.w7CFovDw033112@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337682 - in stable/11: share/mk tools/build/options usr.bin/ofed usr.bin/ofed/infiniband-diags In-Reply-To: <201808120845.w7C8jNQU027742@repo.freebsd.org> To: Konstantin Belousov Date: Sun, 12 Aug 2018 08:50:57 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 15:51:00 -0000 > Author: kib > Date: Sun Aug 12 08:45:23 2018 > New Revision: 337682 > URL: https://svnweb.freebsd.org/changeset/base/337682 > > Log: > MFC r336569: > Move mostly useless examples binaries from OFED, as well as the Subnet > Manager, under the new option WITH_OFED_EXTRA, disabled by default. I never got a response on putting opensm out from under _EXTRA. > Added: > stable/11/tools/build/options/WITH_OFED_EXTRA > - copied unchanged from r336569, head/tools/build/options/WITH_OFED_EXTRA > Modified: > stable/11/share/mk/src.opts.mk > stable/11/usr.bin/ofed/Makefile > stable/11/usr.bin/ofed/infiniband-diags/Makefile > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/share/mk/src.opts.mk > ============================================================================== > --- stable/11/share/mk/src.opts.mk Sun Aug 12 08:42:06 2018 (r337681) > +++ stable/11/share/mk/src.opts.mk Sun Aug 12 08:45:23 2018 (r337682) > @@ -197,6 +197,7 @@ __DEFAULT_NO_OPTIONS = \ > LOADER_FORCE_LE \ > NAND \ > OFED \ > + OFED_EXTRA \ > OPENLDAP \ > REPRODUCIBLE_BUILD \ > RPCBIND_WARMSTART_SUPPORT \ > @@ -400,6 +401,10 @@ MK_NLS_CATALOGS:= no > .if ${MK_OPENSSL} == "no" > MK_OPENSSH:= no > MK_KERBEROS:= no > +.endif > + > +.if ${MK_OFED} == "no" > +MK_OFED_EXTRA:= no > .endif > > .if ${MK_PF} == "no" > > Copied: stable/11/tools/build/options/WITH_OFED_EXTRA (from r336569, head/tools/build/options/WITH_OFED_EXTRA) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/11/tools/build/options/WITH_OFED_EXTRA Sun Aug 12 08:45:23 2018 (r337682, copy of r336569, head/tools/build/options/WITH_OFED_EXTRA) > @@ -0,0 +1,4 @@ > +.\" $FreeBSD$ > +Set to build the non-essential components of the > +.Dq "OpenFabrics Enterprise Distribution" > +Infiniband software stack, mostly examples. > > Modified: stable/11/usr.bin/ofed/Makefile > ============================================================================== > --- stable/11/usr.bin/ofed/Makefile Sun Aug 12 08:42:06 2018 (r337681) > +++ stable/11/usr.bin/ofed/Makefile Sun Aug 12 08:45:23 2018 (r337682) > @@ -1,10 +1,13 @@ > # $FreeBSD$ > > +.include > + > SUBDIR= \ > libibverbs \ > librdmacm \ > - opensm \ > infiniband-diags > + > +SUBDIR.${MK_OFED_EXTRA}+= opensm > > SUBDIR_PARALLEL= > > > Modified: stable/11/usr.bin/ofed/infiniband-diags/Makefile > ============================================================================== > --- stable/11/usr.bin/ofed/infiniband-diags/Makefile Sun Aug 12 08:42:06 2018 (r337681) > +++ stable/11/usr.bin/ofed/infiniband-diags/Makefile Sun Aug 12 08:45:23 2018 (r337682) > @@ -1,27 +1,33 @@ > # $FreeBSD$ > > +.include > + > SUBDIR= \ > -dump_fts \ > -ibaddr \ > -ibcacheedit \ > -ibccconfig \ > -ibccquery \ > -iblinkinfo \ > -ibmirror \ > -ibnetdiscover \ > -ibping \ > -ibportstate \ > -ibqueryerrors \ > -ibroute \ > -ibstat \ > -ibsysstat \ > -ibtracert \ > -perfquery \ > -saquery \ > -sminfo \ > -smpdump \ > -smpquery \ > -vendstat > + ibstat > + > +.if ${MK_OFED_EXTRA} != "no" > +SUBDIR+= \ > + dump_fts \ > + ibaddr \ > + ibcacheedit \ > + ibccconfig \ > + ibccquery \ > + iblinkinfo \ > + ibmirror \ > + ibnetdiscover \ > + ibping \ > + ibportstate \ > + ibqueryerrors \ > + ibroute \ > + ibsysstat \ > + ibtracert \ > + perfquery \ > + saquery \ > + sminfo \ > + smpdump \ > + smpquery \ > + vendstat > +.endif > > SUBDIR_PARALLEL= > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Aug 12 15:54: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 282011074EA7; Sun, 12 Aug 2018 15:54:18 +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 8B6278E004; Sun, 12 Aug 2018 15:54:17 +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 w7CFsGCD033131; Sun, 12 Aug 2018 08:54:16 -0700 (PDT) (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 w7CFsGXX033130; Sun, 12 Aug 2018 08:54:16 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808121554.w7CFsGXX033130@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337682 - in stable/11: share/mk tools/build/options usr.bin/ofed usr.bin/ofed/infiniband-diags In-Reply-To: <201808120845.w7C8jNQU027742@repo.freebsd.org> To: Konstantin Belousov Date: Sun, 12 Aug 2018 08:54:15 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 15:54:18 -0000 > Author: kib > Date: Sun Aug 12 08:45:23 2018 > New Revision: 337682 > URL: https://svnweb.freebsd.org/changeset/base/337682 > > Log: > MFC r336569: > Move mostly useless examples binaries from OFED, as well as the Subnet > Manager, under the new option WITH_OFED_EXTRA, disabled by default. > > Added: > stable/11/tools/build/options/WITH_OFED_EXTRA > - copied unchanged from r336569, head/tools/build/options/WITH_OFED_EXTRA This is also now kinda a POLA issue for those who have been building on stable/11 with just OFED defined, on our next builds a bunch of stuff is gona go missing. The needs an UPDATING entry, and defanitly a ReleaseNotes: Yes > Modified: > stable/11/share/mk/src.opts.mk > stable/11/usr.bin/ofed/Makefile > stable/11/usr.bin/ofed/infiniband-diags/Makefile > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/share/mk/src.opts.mk > ============================================================================== > --- stable/11/share/mk/src.opts.mk Sun Aug 12 08:42:06 2018 (r337681) > +++ stable/11/share/mk/src.opts.mk Sun Aug 12 08:45:23 2018 (r337682) > @@ -197,6 +197,7 @@ __DEFAULT_NO_OPTIONS = \ > LOADER_FORCE_LE \ > NAND \ > OFED \ > + OFED_EXTRA \ > OPENLDAP \ > REPRODUCIBLE_BUILD \ > RPCBIND_WARMSTART_SUPPORT \ > @@ -400,6 +401,10 @@ MK_NLS_CATALOGS:= no > .if ${MK_OPENSSL} == "no" > MK_OPENSSH:= no > MK_KERBEROS:= no > +.endif > + > +.if ${MK_OFED} == "no" > +MK_OFED_EXTRA:= no > .endif > > .if ${MK_PF} == "no" > > Copied: stable/11/tools/build/options/WITH_OFED_EXTRA (from r336569, head/tools/build/options/WITH_OFED_EXTRA) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/11/tools/build/options/WITH_OFED_EXTRA Sun Aug 12 08:45:23 2018 (r337682, copy of r336569, head/tools/build/options/WITH_OFED_EXTRA) > @@ -0,0 +1,4 @@ > +.\" $FreeBSD$ > +Set to build the non-essential components of the > +.Dq "OpenFabrics Enterprise Distribution" > +Infiniband software stack, mostly examples. > > Modified: stable/11/usr.bin/ofed/Makefile > ============================================================================== > --- stable/11/usr.bin/ofed/Makefile Sun Aug 12 08:42:06 2018 (r337681) > +++ stable/11/usr.bin/ofed/Makefile Sun Aug 12 08:45:23 2018 (r337682) > @@ -1,10 +1,13 @@ > # $FreeBSD$ > > +.include > + > SUBDIR= \ > libibverbs \ > librdmacm \ > - opensm \ > infiniband-diags > + > +SUBDIR.${MK_OFED_EXTRA}+= opensm > > SUBDIR_PARALLEL= > > > Modified: stable/11/usr.bin/ofed/infiniband-diags/Makefile > ============================================================================== > --- stable/11/usr.bin/ofed/infiniband-diags/Makefile Sun Aug 12 08:42:06 2018 (r337681) > +++ stable/11/usr.bin/ofed/infiniband-diags/Makefile Sun Aug 12 08:45:23 2018 (r337682) > @@ -1,27 +1,33 @@ > # $FreeBSD$ > > +.include > + > SUBDIR= \ > -dump_fts \ > -ibaddr \ > -ibcacheedit \ > -ibccconfig \ > -ibccquery \ > -iblinkinfo \ > -ibmirror \ > -ibnetdiscover \ > -ibping \ > -ibportstate \ > -ibqueryerrors \ > -ibroute \ > -ibstat \ > -ibsysstat \ > -ibtracert \ > -perfquery \ > -saquery \ > -sminfo \ > -smpdump \ > -smpquery \ > -vendstat > + ibstat > + > +.if ${MK_OFED_EXTRA} != "no" > +SUBDIR+= \ > + dump_fts \ > + ibaddr \ > + ibcacheedit \ > + ibccconfig \ > + ibccquery \ > + iblinkinfo \ > + ibmirror \ > + ibnetdiscover \ > + ibping \ > + ibportstate \ > + ibqueryerrors \ > + ibroute \ > + ibsysstat \ > + ibtracert \ > + perfquery \ > + saquery \ > + sminfo \ > + smpdump \ > + smpquery \ > + vendstat > +.endif > > SUBDIR_PARALLEL= > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Aug 12 20:33:56 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 BBF60107B797; Sun, 12 Aug 2018 20:33:56 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DC0878295; Sun, 12 Aug 2018 20:33:56 +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 3ED012AF09; Sun, 12 Aug 2018 20:33:56 +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 w7CKXu0d096336; Sun, 12 Aug 2018 20:33:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CKXu6i096335; Sun, 12 Aug 2018 20:33:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201808122033.w7CKXu6i096335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 12 Aug 2018 20:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337689 - head/sys/dev/ipmi X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/ipmi X-SVN-Commit-Revision: 337689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 20:33:56 -0000 Author: jhibbits Date: Sun Aug 12 20:33:55 2018 New Revision: 337689 URL: https://svnweb.freebsd.org/changeset/base/337689 Log: ipmi/opal: Enable polled mode and proper callback Fix a NULL dereference that would occur any time an ioctl() was done, due to a missing ipmi_enqueue_request callback. Just use the default for now, until we decide to properly enable IPMI interrupts. Reported by: kbowling Modified: head/sys/dev/ipmi/ipmi_opal.c Modified: head/sys/dev/ipmi/ipmi_opal.c ============================================================================== --- head/sys/dev/ipmi/ipmi_opal.c Sun Aug 12 14:05:15 2018 (r337688) +++ head/sys/dev/ipmi/ipmi_opal.c Sun Aug 12 20:33:55 2018 (r337689) @@ -210,6 +210,8 @@ opal_ipmi_attach(device_t dev) } sc->ipmi.ipmi_startup = opal_ipmi_startup; sc->ipmi.ipmi_driver_request = opal_ipmi_driver_request; + sc->ipmi.ipmi_enqueue_request = ipmi_polled_enqueue_request; + sc->ipmi.ipmi_driver_requests_polled = 1; sc->ipmi.ipmi_dev = dev; sc->sc_msg = malloc(sizeof(struct opal_ipmi_msg) + IPMI_MAX_RX, M_IPMI, From owner-svn-src-all@freebsd.org Sun Aug 12 21:04: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 390DC107C791; Sun, 12 Aug 2018 21:04:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E307979B50; Sun, 12 Aug 2018 21:04:53 +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 C42572B3B1; Sun, 12 Aug 2018 21:04:53 +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 w7CL4rnt011387; Sun, 12 Aug 2018 21:04:53 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CL4rge011386; Sun, 12 Aug 2018 21:04:53 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808122104.w7CL4rge011386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 12 Aug 2018 21:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337690 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 337690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 21:04:54 -0000 Author: mmacy Date: Sun Aug 12 21:04:53 2018 New Revision: 337690 URL: https://svnweb.freebsd.org/changeset/base/337690 Log: fix static ZFS linking Static linking of ZFS is a newish option and LINT doesn't include it Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Aug 12 20:33:55 2018 (r337689) +++ head/sys/conf/files Sun Aug 12 21:04:53 2018 (r337690) @@ -171,6 +171,7 @@ cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c cddl/contrib/opensolaris/uts/common/fs/zfs/bqueue.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/cityhash.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf_stats.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c optional zfs compile-with "${ZFS_C}" From owner-svn-src-all@freebsd.org Sun Aug 12 21:10:22 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 7DA49107CC00; Sun, 12 Aug 2018 21:10:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f196.google.com (mail-io0-f196.google.com [209.85.223.196]) (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 08F9B7A00D; Sun, 12 Aug 2018 21:10:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f196.google.com with SMTP id y10-v6so12592023ioa.10; Sun, 12 Aug 2018 14:10:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=BzWJBlmDLX3s5XEud91dXpqdDoTRskJHdiA1/pzi4Yc=; b=JR4bgotH84/9+7v7652Wajg/fg2H9aoUzauzHKyOGHFlKZGbYdS6RsAR4qtO7PBjCp bzwyLUhFX+6kkv4gD92SjRe+Yb7xnb53j4Bdqv2d5JTU0cNr5Gv8vsoFO2cThQ6jwhNd bk9+mXoWHNnMoUMrV3MUW71i2m4tNPdLDR9Y3Az6jnM3Ac9ve9OYLz+Rz5d3V5CkKXne aqepn1kGPHFd+rngKn27/tKR+ZFtF8oUpgY9I0BJtWBR0AA37dLPx3rX8pkiixCRZuZ8 MSaY77bC7nwNQ2aXWFyjxvRF+e/MhSqQOJyn9UYlVzvD0q4QCw5bIQB3cptPEbsk5tIY oWEw== X-Gm-Message-State: AOUpUlFEl6xHeMd7bTvlNWQydpfsRipILZXu6tgCz4q7u4wkqzdSm7cZ 6aTfaoAak+pNnyRbK2eceQ+yDIYb X-Google-Smtp-Source: AA+uWPwpV5yGgACQC7LZ+PurGVv62Z5HEINk/4MuO9ENjn/mu6iBRe10vcnEmDhUuiTTYXDmUPls9w== X-Received: by 2002:a6b:8f4e:: with SMTP id r75-v6mr13071410iod.252.1534107869273; Sun, 12 Aug 2018 14:04:29 -0700 (PDT) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id c2-v6sm5176750iob.41.2018.08.12.14.04.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Aug 2018 14:04:28 -0700 (PDT) Received: by mail-io0-f181.google.com with SMTP id i18-v6so12573460ioj.13; Sun, 12 Aug 2018 14:04:28 -0700 (PDT) X-Received: by 2002:a6b:be46:: with SMTP id o67-v6mr12264959iof.143.1534107868794; Sun, 12 Aug 2018 14:04:28 -0700 (PDT) MIME-Version: 1.0 References: <201808091217.w79CH3gO096411@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 9 Aug 2018 19:44:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337535 - head/sbin/init To: Benjamin Kaduk Cc: "cem@FreeBSD.org" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 21:10:22 -0000 Then maybe don=E2=80=99t keep bringing it up? Especially when it=E2=80=99s = totally irrelevant, like here. FreeBSD has certain assumptions of supported platforms beyond the guarantees of standard C that have nothing whatsoever to do with the boogeyman of a patched compiler. On Thu, Aug 9, 2018 at 2:42 PM Benjamin Kaduk wrote: > On Thu, Aug 9, 2018 at 11:03 AM, Conrad Meyer wrote: > >> On Thu, Aug 9, 2018 at 5:52 AM, Benjamin Kaduk wrote= : >> > On Thu, Aug 9, 2018 at 7:17 AM, Edward Tomasz Napierala < >> trasz@freebsd.org> >> > wrote: >> >> Use NULLs instead of casted zeroes, for consistency. >> > >> > It's probably helpful to note explicitly that these are not in >> arguments to >> > varargs functions, >> >> I don't think it's helpful. >> >> > in which case the explicit cast is needed in order to produce a progra= m >> that >> > will have >> > correct behavior on all compliant compilers/systems. >> >> Here "compliant" means "minimally compliant to the C standard." Use >> of NULL in varargs is functionally correct on all FreeBSD systems. >> >> > (We do define NULL to >> > be a zero-with-cast, >> > but programs >> >> (Ones that care about portability to weird systems.) I don't think >> BSD's 500 line init =E2=80=94 hyper local to FreeBSD =E2=80=94 is a stro= ng candidate >> for portability. >> >> > should not assume that NULL will be of pointer type -- "An >> > integer constant >> > expression with the value 0, or such an expression cast to type void *= , >> is >> > called a null pointer constant".) >> >> Right. The problem only arises when both conditions are met: >> >> 1. The system's varargs representation is smaller than the pointer >> representation, and >> 2. The runtime headers do not defined NULL as a pointer-typed value. >> (3. The function being invoked is actually varargs?) >> >> Neither is true on FreeBSD and v7-style init is not a useful place to >> call for portability. >> > > I don't really feel a need to continue the discussion that was already > started in response > to r336835 (in addition to the current thread), so I'll limit myself to > asking whether we > want to be writing standard C or a FreeBSD-specific dialect of C. My > understanding was > that we had some experience with the latter (e.g., heavy patching of the > compiler) and > it ended up with us in a bad place, which would tend to support writing > standard C or > as close to it as we can. (Yes, I know that we have non-standard printf > specifiers and the like.) > > -Ben > From owner-svn-src-all@freebsd.org Sun Aug 12 21:42:22 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 F2D7C107D50E; Sun, 12 Aug 2018 21:42:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8FA77AEB5; Sun, 12 Aug 2018 21:42:21 +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 8B81E2B909; Sun, 12 Aug 2018 21:42:21 +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 w7CLgLl8030913; Sun, 12 Aug 2018 21:42:21 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CLgL2I030912; Sun, 12 Aug 2018 21:42:21 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808122142.w7CLgL2I030912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 12 Aug 2018 21:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337691 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 337691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 21:42:22 -0000 Author: delphij Date: Sun Aug 12 21:42:21 2018 New Revision: 337691 URL: https://svnweb.freebsd.org/changeset/base/337691 Log: Remove mention of FreeBSD 9.x which is EoL'ed now. Modified: stable/11/etc/portsnap.conf Modified: stable/11/etc/portsnap.conf ============================================================================== --- stable/11/etc/portsnap.conf Sun Aug 12 21:04:53 2018 (r337690) +++ stable/11/etc/portsnap.conf Sun Aug 12 21:42:21 2018 (r337691) @@ -30,6 +30,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3 # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -#INDEX INDEX-9 DESCRIBE.9 #INDEX INDEX-10 DESCRIBE.10 INDEX INDEX-11 DESCRIBE.11 From owner-svn-src-all@freebsd.org Sun Aug 12 21:44: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 C7518107D852; Sun, 12 Aug 2018 21:44:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ABFB7B219; Sun, 12 Aug 2018 21:44:00 +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 5CB6E2BA28; Sun, 12 Aug 2018 21:44:00 +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 w7CLi0t5031747; Sun, 12 Aug 2018 21:44:00 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CLi0Xv031746; Sun, 12 Aug 2018 21:44:00 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808122144.w7CLi0Xv031746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 12 Aug 2018 21:44:00 +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: r337692 - stable/10/etc X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/etc X-SVN-Commit-Revision: 337692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 21:44:01 -0000 Author: delphij Date: Sun Aug 12 21:43:59 2018 New Revision: 337692 URL: https://svnweb.freebsd.org/changeset/base/337692 Log: Remove mention of FreeBSD 9.x which is EoL'ed now. Modified: stable/10/etc/portsnap.conf Modified: stable/10/etc/portsnap.conf ============================================================================== --- stable/10/etc/portsnap.conf Sun Aug 12 21:42:21 2018 (r337691) +++ stable/10/etc/portsnap.conf Sun Aug 12 21:43:59 2018 (r337692) @@ -30,5 +30,4 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3 # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-9 DESCRIBE.9 INDEX INDEX-10 DESCRIBE.10 From owner-svn-src-all@freebsd.org Sun Aug 12 22:03: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 2BE07107DEFA for ; Sun, 12 Aug 2018 22:03:38 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFF367BC66 for ; Sun, 12 Aug 2018 22:03:37 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw1-f47.google.com (mail-yw1-f47.google.com [209.85.161.47]) (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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 955E21C7DB for ; Sun, 12 Aug 2018 22:03:37 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw1-f47.google.com with SMTP id r184-v6so12309045ywg.6 for ; Sun, 12 Aug 2018 15:03:37 -0700 (PDT) X-Gm-Message-State: AOUpUlG7DqwOuwIA6x2PGJ0CVszwur479QndQ0DqTZ7pr/uWo7bSJLOs ZENn8x/TNX4s1ncJ++NjLm3Iu+3GBKp3Jc+Z1Nm/mQ== X-Google-Smtp-Source: AA+uWPxDSqanw9+l9vyDpzGXEMDXrcLxkZ4Jby5M+vtnNlji9H+eBsFwBov+0QP1aJCOf7MtFk1zw7FtZSw8WapZCvE= X-Received: by 2002:a25:22c1:: with SMTP id i184-v6mr7907697ybi.479.1534111416984; Sun, 12 Aug 2018 15:03:36 -0700 (PDT) MIME-Version: 1.0 References: <201808121210.w7CCAXB7029893@repo.freebsd.org> <20180812124034.GB30769@rincewind.trouble.is> In-Reply-To: From: Eitan Adler Date: Sun, 12 Aug 2018 15:03:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337683 - in vendor/tzdb: . dist To: Philip Paeps Cc: src-committers , svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 22:03:38 -0000 On Sun, 12 Aug 2018 at 05:46, Philip Paeps wrote: > > On 2018-08-12 20:40:34 (+0800), Philip Paeps wrote: > > > On 2018-08-12 12:10:33 (+0000), Eitan Adler wrote: > >> Author: eadler > >> Date: Sun Aug 12 12:10:33 2018 > >> New Revision: 337683 > >> URL: https://svnweb.freebsd.org/changeset/base/337683 > >> > >> Log: > >> vendor/tzdb: reimport IANA database+code in a standard layout > >> > >> I am using a new directory since the layout of both the vendor area > >> and > >> contrib/ need to be changed. > >> > > > > I would have *strongly* preferred you to import tzcode separately from > > tzdata so as not to frustrate future updates of the tzdata. > > > > The IANA tzdb project releases tzdata and tzcode in separate tarballs. > > > > tzdata updates happen comparatively frequently and we like to issue > > errata notices for them. tzcode doesn't change very often. > > > > Would you mind backing this out and importing tzcode separately? > > To clarify: please import the tzcode tarball into vendor/tzcode > (https://data.iana.org/time-zones/releases/tzcode2018e.tar.gz) and svn > rm vendor/tzdb. > > The tzdata code is kept in vendor/tzdata and is up to date with the > latest upstream (and I intend to keep it that way, getting errata > notices issued as necessary). Will do and will keep future responses on the -arch thread. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Sun Aug 12 22:04: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 B64DD107DF5C; Sun, 12 Aug 2018 22:04:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD347BD92; Sun, 12 Aug 2018 22:04:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 306982BD4C; Sun, 12 Aug 2018 22:04:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7CM4TZJ041992; Sun, 12 Aug 2018 22:04:29 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CM4TJI041991; Sun, 12 Aug 2018 22:04:29 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808122204.w7CM4TJI041991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 12 Aug 2018 22:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337693 - in vendor/tzdb: 2018e dist X-SVN-Group: vendor X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in vendor/tzdb: 2018e dist X-SVN-Commit-Revision: 337693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 22:04:29 -0000 Author: eadler Date: Sun Aug 12 22:04:28 2018 New Revision: 337693 URL: https://svnweb.freebsd.org/changeset/base/337693 Log: vendor/tzdb: clear in preperation for reimporting only code Deleted: vendor/tzdb/2018e/ vendor/tzdb/dist/ From owner-svn-src-all@freebsd.org Sun Aug 12 22:05: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 8B1B2107DFEF; Sun, 12 Aug 2018 22:05:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (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 272B77BF37; Sun, 12 Aug 2018 22:05:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f175.google.com with SMTP id l7-v6so8850801iok.6; Sun, 12 Aug 2018 15:05:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=iqyXkiNth+5yU2w/lV/IBOMmbKA4Sp1VL9C+Dn8agDI=; b=bSoUw7nyvscN+tkc9HuFwPSXN4lNPG9ESCcNuWEZtWPzAbLWumS3G+2HBXLQ4Tv5o2 xlKpYIaYOkb6fHiyUcVTRjwKJk7XvDjax8bIz+5TXQ38mdDRZ4vnMmJ3KXxre6LJsLOz AOAjicdiX8DHCtCF3XRf7vT8gqy4lp/SEQ3klemc8EoTeQkiRzIVbZpp7M8XqzLE0fks GC0knjZDX7jyOZovbJ6vTcJ0FEDevLHkAmMdPpb9HEl/1g/tgR3ZGBsKG29MWlnR3VLl +o2VHCduMvbY4SYspj4YojlpCmSzZB55YtXdvi2QGeUwmS9jLPLENPOdVxnBqejlhiM/ /SMg== X-Gm-Message-State: AOUpUlFavGkAwYpfA8IO8sHbPH45TGsN5b2ekf1v1wBHM6c/QsOnAPBj WVrb1zo5h+tdllIphQ15KKD6/qH3 X-Google-Smtp-Source: AA+uWPyPxbe8MEgFzG4BHnW/tmo5I+OAJZ4GkR3n+7bwul+e4FY2royudTPXDB6AnfpuEj3GncYCvg== X-Received: by 2002:a6b:a508:: with SMTP id o8-v6mr11824852ioe.41.1534107869470; Sun, 12 Aug 2018 14:04:29 -0700 (PDT) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com. [209.85.223.178]) by smtp.gmail.com with ESMTPSA id l13-v6sm5319975itb.43.2018.08.12.14.04.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Aug 2018 14:04:28 -0700 (PDT) Received: by mail-io0-f178.google.com with SMTP id y10-v6so12582150ioa.10; Sun, 12 Aug 2018 14:04:28 -0700 (PDT) X-Received: by 2002:a6b:b0c5:: with SMTP id z188-v6mr12414476ioe.220.1534107868784; Sun, 12 Aug 2018 14:04:28 -0700 (PDT) MIME-Version: 1.0 References: <201808092153.w79LrWEZ097986@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 9 Aug 2018 19:41:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337554 - in head/sys/cam: . ata nvme scsi To: Scott Long Cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 22:05:24 -0000 I had two functional changes in mind for after this part (which I hoped would be non controversial) that you would be included on the review. Markj pointed me at the related D15592. I=E2=80=99m not sure that approach= was the correct one and hope to continue discussion there. Once that=E2=80=99s rea= ched consensus, I may need to revisit my subsequent change. If it ends up that ultimately this particular patch isn=E2=80=99t used, backing it out is triv= ial. Until then, it=E2=80=99s pretty harmless. Thanks, Conrad On Thu, Aug 9, 2018 at 2:56 PM Scott Long wrote: > > > > On Aug 9, 2018, at 3:53 PM, Conrad Meyer wrote: > > > > Author: cem > > Date: Thu Aug 9 21:53:32 2018 > > New Revision: 337554 > > URL: https://svnweb.freebsd.org/changeset/base/337554 > > > > Log: > > cam(4): Add an xpt-neutral flag indicating a valid panic CCB > > > > No functional change. > > > > Note that this change is careful to set the CCB header xflags after > > foo_fill_bar() routines, which generally zero existing flags. An > earlier > > version of this patch mistakenly set the flag before the fill routines= . > > > > Submitted by: Scott Ferris , jhibbits@ > > Reviewed by: bdrewery@, markj@, and non-committer FreeBSD contributor > Anton Rang > > Sponsored by: Dell EMC Isilon > > What=E2=80=99s the purpose of this flag? I see it gets set in plenty of = places, > but never checked. > > Scott > > From owner-svn-src-all@freebsd.org Sun Aug 12 22:06:37 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 15C7310550C0; Sun, 12 Aug 2018 22:06:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC21A7C0C1; Sun, 12 Aug 2018 22:06:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98EB02BD4D; Sun, 12 Aug 2018 22:06:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7CM6avd042135; Sun, 12 Aug 2018 22:06:36 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CM6aiq042131; Sun, 12 Aug 2018 22:06:36 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808122206.w7CM6aiq042131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 12 Aug 2018 22:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337694 - vendor/tzdb/dist X-SVN-Group: vendor X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: vendor/tzdb/dist X-SVN-Commit-Revision: 337694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 22:06:37 -0000 Author: eadler Date: Sun Aug 12 22:06:35 2018 New Revision: 337694 URL: https://svnweb.freebsd.org/changeset/base/337694 Log: vendor/tzdb: reimport IANA database+code in a standard layout I am using a new directory since the layout of both the vendor area and contrib/ need to be changed. This is a recommit of r337683 with only code. Added: vendor/tzdb/dist/ vendor/tzdb/dist/CONTRIBUTING vendor/tzdb/dist/LICENSE vendor/tzdb/dist/Makefile (contents, props changed) vendor/tzdb/dist/NEWS vendor/tzdb/dist/README vendor/tzdb/dist/asctime.c (contents, props changed) vendor/tzdb/dist/calendars vendor/tzdb/dist/date.1 (contents, props changed) vendor/tzdb/dist/date.1.txt (contents, props changed) vendor/tzdb/dist/date.c (contents, props changed) vendor/tzdb/dist/difftime.c (contents, props changed) vendor/tzdb/dist/localtime.c (contents, props changed) vendor/tzdb/dist/newctime.3 (contents, props changed) vendor/tzdb/dist/newctime.3.txt (contents, props changed) vendor/tzdb/dist/newstrftime.3 (contents, props changed) vendor/tzdb/dist/newstrftime.3.txt (contents, props changed) vendor/tzdb/dist/newtzset.3 (contents, props changed) vendor/tzdb/dist/newtzset.3.txt (contents, props changed) vendor/tzdb/dist/private.h (contents, props changed) vendor/tzdb/dist/strftime.c (contents, props changed) vendor/tzdb/dist/theory.html (contents, props changed) vendor/tzdb/dist/time2posix.3 (contents, props changed) vendor/tzdb/dist/time2posix.3.txt (contents, props changed) vendor/tzdb/dist/tz-art.html (contents, props changed) vendor/tzdb/dist/tz-how-to.html (contents, props changed) vendor/tzdb/dist/tz-link.html (contents, props changed) vendor/tzdb/dist/tzfile.5 (contents, props changed) vendor/tzdb/dist/tzfile.5.txt (contents, props changed) vendor/tzdb/dist/tzfile.h (contents, props changed) vendor/tzdb/dist/tzselect.8 (contents, props changed) vendor/tzdb/dist/tzselect.8.txt (contents, props changed) vendor/tzdb/dist/tzselect.ksh vendor/tzdb/dist/version vendor/tzdb/dist/workman.sh (contents, props changed) vendor/tzdb/dist/zdump.8 (contents, props changed) vendor/tzdb/dist/zdump.8.txt (contents, props changed) vendor/tzdb/dist/zdump.c (contents, props changed) vendor/tzdb/dist/zic.8 (contents, props changed) vendor/tzdb/dist/zic.8.txt (contents, props changed) vendor/tzdb/dist/zic.c (contents, props changed) Added: vendor/tzdb/dist/CONTRIBUTING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/tzdb/dist/CONTRIBUTING Sun Aug 12 22:06:35 2018 (r337694) @@ -0,0 +1,89 @@ +Contributing to the tz code and data + +The time zone database is by no means authoritative: governments +change timekeeping rules erratically and sometimes with little +warning, the data entries do not cover all of civil time before +1970, and undoubtedly errors remain in the code and data. Feel +free to fill gaps or fix mistakes, and please email improvements +to tz@iana.org for use in the future. In your email, please give +reliable sources that reviewers can check. + +----- + +Developers can contribute technical changes to the source code and +data as follows. + +To email small changes, please run a POSIX shell command like +'diff -u old/europe new/europe >myfix.patch', and attach +myfix.patch to the email. + +For more-elaborate changes, please read the theory.html file and browse +the mailing list archives for +examples of patches that tend to work well. Additions to +data should contain commentary citing reliable sources as +justification. Citations should use https: URLs if available. + +Please submit changes against either the latest release in + or the master branch of the development +repository. The latter is preferred. If you use Git the following +workflow may be helpful: + + * Copy the development repository. + + git clone https://github.com/eggert/tz.git + cd tz + + * Get current with the master branch. + + git checkout master + git pull + + * Switch to a new branch for the changes. Choose a different + branch name for each change set. + + git checkout -b mybranch + + * Sleuth by using 'git blame'. For example, when fixing data for + Africa/Sao_Tome, if the command 'git blame africa' outputs a line + '2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone + Africa/Sao_Tome 0:26:56 - LMT 1884', commit 2951fa3b should + provide some justification for the 'Zone Africa/Sao_Tome' line. + + * Edit source files. Include commentary that justifies the + changes by citing reliable sources. + + * Debug the changes, e.g.: + + make check + make install + ./zdump -v America/Los_Angeles + + * For each separable change, commit it in the new branch, e.g.: + + git add northamerica + git commit + + See recent 'git log' output for the commit-message style. + + * Create patch files 0001-*, 0002-*, ... + + git format-patch master + + * After reviewing the patch files, send the patches to tz@iana.org + for others to review. + + git send-email master + + For an archived example of such an email, see + . + + * Start anew by getting current with the master branch again + (the second step above). + +Please do not create issues or pull requests on GitHub, as the +proper procedure for proposing and distributing patches is via +email as illustrated above. + +----- + +This file is in the public domain. Added: vendor/tzdb/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/tzdb/dist/LICENSE Sun Aug 12 22:06:35 2018 (r337694) @@ -0,0 +1,5 @@ +Unless specified below, all files in the tz code and data (including +this LICENSE file) are in the public domain. + +If the files date.c, newstrftime.3, and strftime.c are present, they +contain material derived from BSD and use the BSD 3-clause license. Added: vendor/tzdb/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/tzdb/dist/Makefile Sun Aug 12 22:06:35 2018 (r337694) @@ -0,0 +1,1013 @@ +# This file is in the public domain, so clarified as of +# 2009-05-17 by Arthur David Olson. + +# Package name for the code distribution. +PACKAGE= tzcode + +# Version number for the distribution, overridden in the 'tarballs' rule below. +VERSION= unknown + +# Email address for bug reports. +BUGEMAIL= tz@iana.org + +# Choose source data features. To get new features right away, use: +# DATAFORM= vanguard +# To wait a while before using new features, to give downstream users +# time to upgrade zic (the default), use: +# DATAFORM= main +# To wait even longer for new features, use: +# DATAFORM= rearguard +DATAFORM= main + +# Change the line below for your time zone (after finding the zone you want in +# the time zone files, or adding it to a time zone file). +# Alternatively, if you discover you've got the wrong time zone, you can just +# zic -l rightzone +# to correct things. +# Use the command +# make zonenames +# to get a list of the values you can use for LOCALTIME. + +LOCALTIME= GMT + +# If you want something other than Eastern United States time as a template +# for handling POSIX-style time zone environment variables, +# change the line below (after finding the zone you want in the +# time zone files, or adding it to a time zone file). +# When a POSIX-style environment variable is handled, the rules in the +# template file are used to determine "spring forward" and "fall back" days and +# times; the environment variable itself specifies UT offsets of standard and +# daylight saving time. +# Alternatively, if you discover you've got the wrong time zone, you can just +# zic -p rightzone +# to correct things. +# Use the command +# make zonenames +# to get a list of the values you can use for POSIXRULES. +# If you want POSIX compatibility, use "America/New_York". + +POSIXRULES= America/New_York + +# Also see TZDEFRULESTRING below, which takes effect only +# if the time zone files cannot be accessed. + + +# Installation locations. +# +# The defaults are suitable for Debian, except that if REDO is +# posix_right or right_posix then files that Debian puts under +# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead +# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, +# respectively. Problems with the Debian approach are discussed in +# the commentary for the right_posix rule (below). + +# Destination directory, which can be used for staging. +# 'make DESTDIR=/stage install' installs under /stage (e.g., to +# /stage/etc/localtime instead of to /etc/localtime). Files under +# /stage are not intended to work as-is, but can be copied by hand to +# the root directory later. If DESTDIR is empty, 'make install' does +# not stage, but installs directly into production locations. +DESTDIR = + +# Everything is installed into subdirectories of TOPDIR, and used there. +# TOPDIR should be empty (meaning the root directory), +# or a directory name that does not end in "/". +# TOPDIR should be empty or an absolute name unless you're just testing. +TOPDIR = + +# The default local time zone is taken from the file TZDEFAULT. +TZDEFAULT = $(TOPDIR)/etc/localtime + +# The subdirectory containing installed program and data files, and +# likewise for installed files that can be shared among architectures. +# These should be relative file names. +USRDIR = usr +USRSHAREDIR = $(USRDIR)/share + +# "Compiled" time zone information is placed in the "TZDIR" directory +# (and subdirectories). +# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. +TZDIR_BASENAME= zoneinfo +TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) + +# The "tzselect" and (if you do "make INSTALL") "date" commands go in: +BINDIR = $(TOPDIR)/$(USRDIR)/bin + +# The "zdump" command goes in: +ZDUMPDIR = $(BINDIR) + +# The "zic" command goes in: +ZICDIR = $(TOPDIR)/$(USRDIR)/sbin + +# Manual pages go in subdirectories of. . . +MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man + +# Library functions are put in an archive in LIBDIR. +LIBDIR = $(TOPDIR)/$(USRDIR)/lib + + +# Types to try, as an alternative to time_t. int64_t should be first. +TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t + +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use +# REDO= posix_only +# below. If you want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use +# REDO= right_only +# below. If you want both sets of data available, with leap seconds not +# counted normally, use +# REDO= posix_right +# below. If you want both sets of data available, with leap seconds counted +# normally, use +# REDO= right_posix +# below. POSIX mandates that leap seconds not be counted; for compatibility +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). + +REDO= posix_right + +# To install data in text form that has all the information of the binary data, +# (optionally incorporating leap second information), use +# TZDATA_TEXT= tzdata.zi leapseconds +# To install text data without leap second information (e.g., because +# REDO='posix_only'), use +# TZDATA_TEXT= tzdata.zi +# To avoid installing text data, use +# TZDATA_TEXT= + +TZDATA_TEXT= leapseconds tzdata.zi + +# For backward-compatibility links for old zone names, use +# BACKWARD= backward +# If you also want the link US/Pacific-New, even though it is confusing +# and is planned to be removed from the database eventually, use +# BACKWARD= backward pacificnew +# To omit these links, use +# BACKWARD= + +BACKWARD= backward + +# If you want out-of-scope and often-wrong data from the file 'backzone', use +# PACKRATDATA= backzone +# To omit this data, use +# PACKRATDATA= + +PACKRATDATA= + +# The name of a locale using the UTF-8 encoding, used during self-tests. +# The tests are skipped if the name does not appear to work on this system. + +UTF8_LOCALE= en_US.utf8 + +# Since "." may not be in PATH... + +YEARISTYPE= ./yearistype + +# Non-default libraries needed to link. +LDLIBS= + +# Add the following to the end of the "CFLAGS=" line as needed to override +# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". +# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c) +# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime +# formats that generate only the last two digits of year numbers +# -DEPOCH_LOCAL if the 'time' function returns local time not UT +# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater +# than what POSIX specifies, assuming local time is UT. +# For example, N is 252460800 on AmigaOS. +# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r +# -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DIRECT_H if mkdir needs (MS-Windows) +# -DHAVE_GENERIC=0 if _Generic does not work +# -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris) +# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares +# ctime_r and asctime_r incompatibly with the POSIX standard +# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). +# -DHAVE_INTTYPES_H if you have a non-C99 compiler with +# -DHAVE_LINK=0 if your system lacks a link function +# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function +# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz +# localtime_rz can make zdump significantly faster, but is nonstandard. +# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare +# functions like 'link' or variables like 'tzname' required by POSIX +# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function +# -DHAVE_STDBOOL_H if you have a non-C99 compiler with +# -DHAVE_STDINT_H if you have a non-C99 compiler with +# -DHAVE_STRFTIME_L if declares locale_t and strftime_l +# -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function +# -DHAVE_SYMLINK=0 if your system lacks the symlink function +# -DHAVE_SYS_STAT_H=0 if your compiler lacks a +# -DHAVE_SYS_WAIT_H=0 if your compiler lacks a +# -DHAVE_TZSET=0 if your system lacks a tzset function +# -DHAVE_UNISTD_H=0 if your compiler lacks a +# -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers +# with external linkage, e.g., applications cannot define 'localtime'. +# -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has +# security implications and is not recommended for general use +# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; +# not needed by the main-program tz code, which is single-threaded. +# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. +# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t +# This is intended for internal use only; it mangles external names. +# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" +# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; +# the default is system-supplied, typically "/usr/lib/locale" +# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified +# DST transitions if the time zone files cannot be accessed +# -DUNINIT_TRAP if reading uninitialized storage can cause problems +# other than simply getting garbage data +# -DUSE_LTZ=0 to build zdump with the system time zone library +# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_MAX_ABBR_LEN_WO_WARN=3 +# (or some other number) to set the maximum time zone abbreviation length +# that zic will accept without a warning (the default is 6) +# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking +# Select instrumentation via "make GCC_INSTRUMENT='whatever'". +GCC_INSTRUMENT = \ + -fsanitize=undefined -fsanitize-address-use-after-scope \ + -fsanitize-undefined-trap-on-error -fstack-protector +GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ + $(GCC_INSTRUMENT) \ + -Wall -Wextra \ + -Walloc-size-larger-than=100000 -Warray-bounds=2 \ + -Wbad-function-cast -Wcast-align=strict -Wdate-time \ + -Wdeclaration-after-statement -Wdouble-promotion \ + -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ + -Winit-self -Wjump-misses-init -Wlogical-op \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wold-style-definition -Woverlength-strings -Wpointer-arith \ + -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=4 \ + -Wstringop-truncation -Wsuggest-attribute=cold \ + -Wsuggest-attribute=const -Wsuggest-attribute=format \ + -Wsuggest-attribute=malloc \ + -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ + -Wtrampolines -Wundef -Wuninitialized -Wunused \ + -Wvariadic-macros -Wvla -Wwrite-strings \ + -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ + -Wno-type-limits -Wno-unused-parameter +# +# If your system has a "GMT offset" field in its "struct tm"s +# (or if you decide to add such a field in your system's "time.h" file), +# add the name to a define such as +# -DTM_GMTOFF=tm_gmtoff +# to the end of the "CFLAGS=" line. If not defined, the code attempts to +# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. +# Similarly, if your system has a "zone abbreviation" field, define +# -DTM_ZONE=tm_zone +# and define NO_TM_ZONE to suppress any guessing. These two fields are not +# required by POSIX, but are widely available on GNU/Linux and BSD systems. +# +# The next batch of options control support for external variables +# exported by tzcode. In practice these variables are less useful +# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. +# # +# # To omit or support the external variable "tzname", add one of: +# # -DHAVE_TZNAME=0 +# # -DHAVE_TZNAME=1 +# # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later. +# # If not defined, the code attempts to guess HAVE_TZNAME from other macros. +# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause +# # crashes when combined with some platforms' standard libraries, +# # presumably due to memory allocation issues. +# # +# # To omit or support the external variables "timezone" and "daylight", add +# # -DUSG_COMPAT=0 +# # -DUSG_COMPAT=1 +# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by +# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later. +# # If not defined, the code attempts to guess USG_COMPAT from other macros. +# # +# # To support the external variable "altzone", add +# # -DALTZONE +# # to the end of the "CFLAGS=" line; although "altzone" appeared in +# # System V Release 3.1 it has not been standardized. +# +# If you want functions that were inspired by early versions of X3J11's work, +# add +# -DSTD_INSPIRED +# to the end of the "CFLAGS=" line. This arranges for the functions +# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff", +# "posix2time", and "time2posix" to be added to the time conversion library. +# "tzsetwall" is like "tzset" except that it arranges for local wall clock +# time (rather than the time specified in the TZ environment variable) +# to be used. +# "offtime" is like "gmtime" except that it accepts a second (long) argument +# that gives an offset to add to the time_t when converting it. +# "timelocal" is equivalent to "mktime". +# "timegm" is like "timelocal" except that it turns a struct tm into +# a time_t using UT (rather than local time as "timelocal" does). +# "timeoff" is like "timegm" except that it accepts a second (long) argument +# that gives an offset to use when converting to a time_t. +# "posix2time" and "time2posix" are described in an included manual page. +# X3J11's work does not describe any of these functions. +# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0. +# These functions may well disappear in future releases of the time +# conversion package. +# +# If you don't want functions that were inspired by NetBSD, add +# -DNETBSD_INSPIRED=0 +# to the end of the "CFLAGS=" line. Otherwise, the functions +# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the +# time library, and if STD_INSPIRED is also defined the functions +# "posix2time_z" and "time2posix_z" are added as well. +# The functions ending in "_z" (or "_rz") are like their unsuffixed +# (or suffixed-by-"_r") counterparts, except with an extra first +# argument of opaque type timezone_t that specifies the time zone. +# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. +# +# If you want to allocate state structures in localtime, add +# -DALL_STATE +# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. +# +# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put +# out by the National Institute of Standards and Technology +# which claims to test C and Posix conformance. If you want to pass PCTS, add +# -DPCTS +# to the end of the "CFLAGS=" line. +# +# If you want strict compliance with XPG4 as of 1994-04-09, add +# -DXPG4_1994_04_09 +# to the end of the "CFLAGS=" line. This causes "strftime" to always return +# 53 as a week number (rather than 52 or 53) for January days before +# January's first Monday when a "%V" format is used and January 1 +# falls on a Friday, Saturday, or Sunday. + +CFLAGS= + +# Linker flags. Default to $(LFLAGS) for backwards compatibility +# to release 2012h and earlier. + +LDFLAGS= $(LFLAGS) + +# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in +# submake command lines. The default is no leap seconds. + +LEAPSECONDS= + +# The zic command and its arguments. + +zic= ./zic +ZIC= $(zic) $(ZFLAGS) + +ZFLAGS= + +# How to use zic to install tz binary files. + +ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) + +# The name of a Posix-compliant 'awk' on your system. +AWK= awk + +# The full path name of a Posix-compliant shell, preferably one that supports +# the Korn shell's 'select' statement as an extension. +# These days, Bash is the most popular. +# It should be OK to set this to /bin/sh, on platforms where /bin/sh +# lacks 'select' or doesn't completely conform to Posix, but /bin/bash +# is typically nicer if it works. +KSHELL= /bin/bash + +# 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. +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. +# See for a validator, and +# for a validation library. +# Set VALIDATE=':' if you do not have such a program. +VALIDATE = nsgmls +VALIDATE_FLAGS = -s -B -wall -wno-unused-param +VALIDATE_ENV = \ + SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \ + SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \ + SP_CHARSET_FIXED=YES \ + SP_ENCODING=UTF-8 + +# This expensive test requires USE_LTZ. +# To suppress it, define this macro to be empty. +CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives + +# SAFE_CHAR is a regular expression that matches a safe character. +# Some parts of this distribution are limited to safe characters; +# others can use any UTF-8 character. +# For now, the safe characters are a safe subset of ASCII. +# The caller must set the shell variable 'sharp' to the character '#', +# since Makefile macros cannot contain '#'. +# TAB_CHAR is a single tab character, in single quotes. +TAB_CHAR= ' ' +SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' +SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' +SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' +SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) +SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' + +# Non-ASCII non-letters that OK_CHAR allows, as these characters are +# useful in commentary. XEmacs 21.5.34 displays them correctly, +# presumably because they are Latin-1. +UNUSUAL_OK_CHARSET= °±½¾× + +# OK_CHAR matches any character allowed in the distributed files. +# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and +# multibyte letters are also allowed so that commentary can contain a +# few safe symbols and people's names and can quote non-English sources. +# Other non-letters are limited to ASCII renderings for the +# convenience of maintainers using XEmacs 21.5.34, which by default +# mishandles Unicode characters U+0100 and greater. +OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' + +# SAFE_LINE matches a line of safe characters. +# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; +# this is so that comments can contain non-ASCII characters. +# OK_LINE matches a line of OK characters. +SAFE_LINE= '^'$(SAFE_CHAR)'*$$' +SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' +OK_LINE= '^'$(OK_CHAR)'*$$' + +# Flags to give 'tar' when making a distribution. +# Try to use flags appropriate for GNU tar. +GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name +TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ + then echo $(GNUTARFLAGS); \ + else :; \ + fi` + +# Flags to give 'gzip' when making a distribution. +GZIPFLAGS= -9n + +############################################################################### + +#MAKE= make + +cc= cc +CC= $(cc) -DTZDIR='"$(TZDIR)"' + +AR= ar + +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : + +TZCOBJS= zic.o +TZDOBJS= zdump.o localtime.o asctime.o strftime.o +DATEOBJS= date.o localtime.o strftime.o asctime.o +LIBSRCS= localtime.c asctime.c difftime.c +LIBOBJS= localtime.o asctime.o difftime.o +HEADERS= tzfile.h private.h +NONLIBSRCS= zic.c zdump.c +NEWUCBSRCS= date.c strftime.c +SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ + tzselect.ksh workman.sh +MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ + tzfile.5 tzselect.8 zic.8 zdump.8 +MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ + time2posix.3.txt \ + tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ + date.1.txt +COMMON= calendars CONTRIBUTING LICENSE Makefile \ + NEWS README theory.html version +WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) +PRIMARY_YDATA= africa antarctica asia australasia \ + europe northamerica southamerica +YDATA= $(PRIMARY_YDATA) etcetera +NDATA= systemv factory +TDATA_TO_CHECK= $(YDATA) $(NDATA) backward pacificnew +TDATA= $(YDATA) $(NDATA) $(BACKWARD) +ZONETABLES= zone1970.tab zone.tab +TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) +LEAP_DEPS= leapseconds.awk leap-seconds.list +TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA) +DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) +DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ + leapseconds yearistype.sh $(ZONETABLES) +AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ + ziguard.awk zishrink.awk +MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl +TZS_YEAR= 2050 +TZS= to$(TZS_YEAR).tzs +TZS_NEW= to$(TZS_YEAR)new.tzs +TZS_DEPS= $(PRIMARY_YDATA) asctime.c localtime.c \ + private.h tzfile.h zdump.c zic.c +ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi + +# Consult these files when deciding whether to rebuild the 'version' file. +# This list is not the same as the output of 'git ls-files', since +# .gitignore is not distributed. +VERSION_DEPS= \ + calendars CONTRIBUTING LICENSE Makefile NEWS README \ + africa antarctica asctime.c asia australasia \ + backward backzone \ + checklinks.awk checktab.awk \ + date.1 date.c difftime.c \ + etcetera europe factory iso3166.tab \ + leap-seconds.list leapseconds.awk localtime.c \ + newctime.3 newstrftime.3 newtzset.3 northamerica \ + pacificnew private.h \ + southamerica strftime.c systemv theory.html \ + time2posix.3 tz-art.html tz-how-to.html tz-link.html \ + tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ + workman.sh yearistype.sh \ + zdump.8 zdump.c zic.8 zic.c \ + ziguard.awk zishrink.awk \ + zone.tab zone1970.tab zoneinfo2tdf.pl + +# And for the benefit of csh users on systems that assume the user +# shell should be used to handle commands in Makefiles. . . + +SHELL= /bin/sh + +all: tzselect yearistype zic zdump libtz.a $(TABDATA) \ + vanguard.zi main.zi rearguard.zi + +ALL: all date $(ENCHILADA) + +install: all $(DATA) $(REDO) $(MANS) + mkdir -p '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ + '$(DESTDIR)$(LIBDIR)' \ + '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ + '$(DESTDIR)$(MANDIR)/man8' + $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \ + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' + cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' + cp zic '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' + cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' + cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' + +INSTALL: ALL install date.1 + mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' + cp date '$(DESTDIR)$(BINDIR)/.' + cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' + +version: $(VERSION_DEPS) + { (type git) >/dev/null 2>&1 && \ + V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ + --abbrev=7 --dirty` || \ + V='$(VERSION)'; } && \ + printf '%s\n' "$$V" >$@.out + mv $@.out $@ + +# These files can be tailored by setting BACKWARD, PACKRATDATA, etc. +vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) + $(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \ + $(TDATA) $(PACKRATDATA) >$@.out + mv $@.out $@ +tzdata.zi: $(DATAFORM).zi version + version=`sed 1q version` && \ + LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \ + $(DATAFORM).zi >$@.out + mv $@.out $@ + +version.h: version + VERSION=`cat version` && printf '%s\n' \ + 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ + "static char const TZVERSION[]=\"$$VERSION\";" \ + 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ + >$@.out + mv $@.out $@ + +zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + +yearistype: yearistype.sh + cp yearistype.sh yearistype + chmod +x yearistype + +leapseconds: $(LEAP_DEPS) + $(AWK) -f leapseconds.awk leap-seconds.list >$@.out + mv $@.out $@ + +# Arguments to pass to submakes of install_data. +# They can be overridden by later submake arguments. +INSTALLARGS = \ + BACKWARD='$(BACKWARD)' \ + DESTDIR='$(DESTDIR)' \ + LEAPSECONDS='$(LEAPSECONDS)' \ + PACKRATDATA='$(PACKRATDATA)' \ + TZDEFAULT='$(TZDEFAULT)' \ + TZDIR='$(TZDIR)' \ + YEARISTYPE='$(YEARISTYPE)' \ + ZIC='$(ZIC)' + +# 'make install_data' installs one set of tz binary files. +install_data: zic leapseconds yearistype tzdata.zi + $(ZIC_INSTALL) tzdata.zi + +posix_only: + $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data + +right_only: + $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ + install_data + +# In earlier versions of this makefile, the other two directories were +# subdirectories of $(TZDIR). However, this led to configuration errors. +# For example, with posix_right under the earlier scheme, +# TZ='right/Australia/Adelaide' got you localtime with leap seconds, +# but gmtime without leap seconds, which led to problems with applications +# like sendmail that subtract gmtime from localtime. +# Therefore, the other two directories are now siblings of $(TZDIR). +# You must replace all of $(TZDIR) to switch from not using leap seconds +# to using them, or vice versa. +right_posix: right_only + rm -fr '$(DESTDIR)$(TZDIR)-leaps' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + +posix_right: posix_only + rm -fr '$(DESTDIR)$(TZDIR)-posix' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + +# This obsolescent rule is present for backwards compatibility with +# tz releases 2014g through 2015g. It should go away eventually. +posix_packrat: + $(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only + +zones: $(REDO) + +# dummy.zd is not a real file; it is mentioned here only so that the +# top-level 'make' does not have a syntax error. +ZDS = dummy.zd +# Rule used only by submakes invoked by the $(TZS_NEW) rule. +# It is separate so that GNU 'make -j' can run instances in parallel. +$(ZDS): zdump + ./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@ : '\(.*\).zd') >$@ + +$(TZS_NEW): tzdata.zi zdump zic + rm -fr tzs.dir + mkdir tzs.dir + $(zic) -d tzs.dir tzdata.zi + $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ + tzdata.zi | LC_ALL=C sort >$@.out + wd=`pwd` && \ + set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \ + | LC_ALL=C sort -t . -k 2,2` && \ + shift && \ + ZDS=$$* && \ + $(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs.dir + mv $@.out $@ + +# If $(TZS) does not already exist (e.g., old-format tarballs), create it. +# If it exists but 'make check_tzs' fails, a maintainer should inspect the +# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. +$(TZS): + $(MAKE) force_tzs + +force_tzs: $(TZS_NEW) + cp $(TZS_NEW) $(TZS) + +libtz.a: $(LIBOBJS) + rm -f $@ + $(AR) -rc $@ $(LIBOBJS) + $(RANLIB) $@ + +date: $(DATEOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + +tzselect: tzselect.ksh version + VERSION=`cat version` && sed \ + -e 's|#!/bin/bash|#!$(KSHELL)|g' \ + -e 's|AWK=[^}]*|AWK=$(AWK)|g' \ + -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ + -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ + -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ + -e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \ + <$@.ksh >$@.out + chmod +x $@.out + mv $@.out $@ + +check: check_character_set check_white_space check_links \ + check_name_lengths check_sorted \ + check_tables check_web check_zishrink check_tzs + +check_character_set: $(ENCHILADA) + test ! '$(UTF8_LOCALE)' || \ + ! printf 'A\304\200B\n' | \ + LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \ + LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \ + sharp='#' && \ + ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ + $(MISC) $(SOURCES) $(WEB_PAGES) \ + CONTRIBUTING LICENSE README \ + version tzdata.zi && \ + ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \ + Makefile && \ + ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ + leapseconds yearistype.sh zone.tab && \ + ! grep -Env $(OK_LINE) $(ENCHILADA); \ + } + +check_white_space: $(ENCHILADA) + patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ + ! grep -En "$$pat" $(ENCHILADA) + ! grep -n '[[:space:]]$$' \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) + +PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+ +FILE_NAME_COMPONENT_TOO_LONG = \ + $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15} + +check_name_lengths: $(TDATA_TO_CHECK) backzone + ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ + $(TDATA_TO_CHECK) backzone + +CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } + +check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab + $(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu + $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu + $(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu + $(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c + $(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \ + LC_ALL=C sort -c + $(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \ + LC_ALL=C sort -cu + +check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi + $(AWK) -f checklinks.awk $(TDATA_TO_CHECK) + $(AWK) -f checklinks.awk tzdata.zi + +check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES) + for tab in $(ZONETABLES); do \ + $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \ + || exit; \ + done + +check_tzs: $(TZS) $(TZS_NEW) + diff -u $(TZS) $(TZS_NEW) + +# This checks only the HTML 4.01 strict page. +# To check the the other pages, use . +check_web: tz-how-to.html + $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html + +# Check that zishrink.awk does not alter the data, and that ziguard.awk +# preserves main-format data. +check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \ + $(DATAFORM).zi tzdata.zi + for type in posix right; do \ + mkdir -p time_t.dir/$$type time_t.dir/$$type-t \ + time_t.dir/$$type-shrunk && \ + case $$type in \ + right) leap='-L leapseconds';; \ + *) leap=;; \ + esac && \ + $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \ + case $(DATAFORM) in \ + main) \ + $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \ + $(AWK) '/^Rule/' $(TDATA) | \ + $(ZIC) $$leap -d time_t.dir/$$type-t - \ + $(PACKRATDATA) && \ + diff -r time_t.dir/$$type time_t.dir/$$type-t;; \ + esac && \ + $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \ + diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \ + done + rm -fr time_t.dir + +clean_misc: + rm -f core *.o *.out \ + date tzselect version.h zdump zic yearistype libtz.a +clean: clean_misc + rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW) + +maintainer-clean: clean + @echo 'This command is intended for maintainers to use; it' + @echo 'deletes files that may need special tools to rebuild.' + rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.* + +names: + @echo $(ENCHILADA) + +public: check check_public $(CHECK_TIME_T_ALTERNATIVES) \ + tarballs signatures + +date.1.txt: date.1 +newctime.3.txt: newctime.3 +newstrftime.3.txt: newstrftime.3 +newtzset.3.txt: newtzset.3 +time2posix.3.txt: time2posix.3 +tzfile.5.txt: tzfile.5 +tzselect.8.txt: tzselect.8 +zdump.8.txt: zdump.8 +zic.8.txt: zic.8 + +$(MANTXTS): workman.sh + LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out + mv $@.out $@ + +# Set the time stamps to those of the git repository, if available, +# and if the files have not changed since then. +# This uses GNU 'touch' syntax 'touch -d@N FILE', +# where N is the number of seconds since 1970. +# If git or GNU 'touch' is absent, don't bother to sync with git timestamps. +# Also, set the timestamp of each prebuilt file like 'leapseconds' +# to be the maximum of the files it depends on. +set-timestamps.out: $(ENCHILADA) + rm -f $@ + if (type git) >/dev/null 2>&1 && \ + files=`git ls-files $(ENCHILADA)` && \ + touch -md @1 test.out; then \ + rm -f test.out && \ + for file in $$files; do \ + if git diff --quiet $$file; then \ + time=`git log -1 --format='tformat:%ct' $$file` && \ + touch -cmd @$$time $$file; \ + else \ + echo >&2 "$$file: warning: does not match repository"; \ + fi || exit; \ + done; \ + fi + touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds + for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \ + touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \ + exit; \ + done + touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi + touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS) + touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version + touch $@ + +# The zics below ensure that each data file can stand on its own. +# We also do an all-files run to catch links to links. + +check_public: + $(MAKE) maintainer-clean + $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL + mkdir -p public.dir + for i in $(TDATA_TO_CHECK) tzdata.zi; do \ + $(zic) -v -d public.dir $$i 2>&1 || exit; \ + done + $(zic) -v -d public.dir $(TDATA_TO_CHECK) + rm -fr public.dir + +# Check that the code works under various alternative +# implementations of time_t. +check_time_t_alternatives: + if diff -q Makefile Makefile 2>/dev/null; then \ + quiet_option='-q'; \ + else \ + quiet_option=''; \ + fi && \ + wd=`pwd` && \ + zones=`$(AWK) '/^[^#]/ { print $$3 }' 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 EE95A105513B; Sun, 12 Aug 2018 22:07:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A567C7C1FA; Sun, 12 Aug 2018 22:07:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DB1D2BD4E; Sun, 12 Aug 2018 22:07:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7CM7Dld042200; Sun, 12 Aug 2018 22:07:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7CM7DEh042199; Sun, 12 Aug 2018 22:07:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808122207.w7CM7DEh042199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 12 Aug 2018 22:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337695 - vendor/tzdb/tzcode2018e X-SVN-Group: vendor X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: vendor/tzdb/tzcode2018e X-SVN-Commit-Revision: 337695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 22:07:14 -0000 Author: eadler Date: Sun Aug 12 22:07:13 2018 New Revision: 337695 URL: https://svnweb.freebsd.org/changeset/base/337695 Log: tzdb: tag tzcode2018e Added: vendor/tzdb/tzcode2018e/ - copied from r337694, vendor/tzdb/dist/ From owner-svn-src-all@freebsd.org Sun Aug 12 23:24: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 A63291059768; Sun, 12 Aug 2018 23:24:35 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 519767F596; Sun, 12 Aug 2018 23:24:35 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from weatherwax.trouble.is (weatherwax.trouble.is [176.58.93.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "weatherwax.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1B8801D003; Sun, 12 Aug 2018 23:24:35 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from rincewind.trouble.is (rincewind.trouble.is [IPv6:2a01:4f8:a0:10e6::1:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 41pZh15rFdz3C1g; Sun, 12 Aug 2018 23:24:33 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, from userid 1001) id 41pZgz5mhczCFs; Sun, 12 Aug 2018 23:24:31 +0000 (UTC) Date: Mon, 13 Aug 2018 07:24:31 +0800 From: Philip Paeps To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r337683 - in vendor/tzdb: . dist Message-ID: <20180812232431.GC30769@rincewind.trouble.is> Mail-Followup-To: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-vendor@freebsd.org References: <201808121210.w7CCAXB7029893@repo.freebsd.org> <20180812124034.GB30769@rincewind.trouble.is> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-PGP-Fingerprint: 2CD1 92C2 6EE7 B7D1 F552 6619 31AE B9B5 FDBB CB0E X-Date: Today is Setting Orange, the 6th day of Bureaucracy in the YOLD 3184 X-Phase-of-Moon: The Moon is Waxing Crescent (4% of Full) X-Clacks-Overhead: GNU Terry Pratchett Organization: Happily Disorganized User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2018 23:24:35 -0000 On 2018-08-12 15:03:22 (-0700), Eitan Adler wrote: >On Sun, 12 Aug 2018 at 05:46, Philip Paeps wrote: >> >> On 2018-08-12 20:40:34 (+0800), Philip Paeps wrote: >> >> > On 2018-08-12 12:10:33 (+0000), Eitan Adler wrote: >> >> Author: eadler >> >> Date: Sun Aug 12 12:10:33 2018 >> >> New Revision: 337683 >> >> URL: https://svnweb.freebsd.org/changeset/base/337683 >> >> >> >> Log: >> >> vendor/tzdb: reimport IANA database+code in a standard layout >> >> >> >> I am using a new directory since the layout of both the vendor area >> >> and >> >> contrib/ need to be changed. >> >> >> > >> > I would have *strongly* preferred you to import tzcode separately from >> > tzdata so as not to frustrate future updates of the tzdata. >> > >> > The IANA tzdb project releases tzdata and tzcode in separate tarballs. >> > >> > tzdata updates happen comparatively frequently and we like to issue >> > errata notices for them. tzcode doesn't change very often. >> > >> > Would you mind backing this out and importing tzcode separately? >> >> To clarify: please import the tzcode tarball into vendor/tzcode >> (https://data.iana.org/time-zones/releases/tzcode2018e.tar.gz) and svn >> rm vendor/tzdb. >> >> The tzdata code is kept in vendor/tzdata and is up to date with the >> latest upstream (and I intend to keep it that way, getting errata >> notices issued as necessary). > >Will do and will keep future responses on the -arch thread. Thanks Eitan. Philip -- Philip Paeps Senior Reality Engineer Ministry of Information From owner-svn-src-all@freebsd.org Mon Aug 13 03:38: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 CF7841063D39; Mon, 13 Aug 2018 03:38:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 756AD86EAD; Mon, 13 Aug 2018 03:38:33 +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 511CA2F24F; Mon, 13 Aug 2018 03:38:33 +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 w7D3cXcL011596; Mon, 13 Aug 2018 03:38:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D3cWPf011593; Mon, 13 Aug 2018 03:38:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808130338.w7D3cWPf011593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Aug 2018 03:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337696 - in head: cddl/lib/libnvpair cddl/lib/libzfs_core include X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: cddl/lib/libnvpair cddl/lib/libzfs_core include X-SVN-Commit-Revision: 337696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 03:38:34 -0000 Author: kevans Date: Mon Aug 13 03:38:32 2018 New Revision: 337696 URL: https://svnweb.freebsd.org/changeset/base/337696 Log: Use INCS for non-sys/ libnvpair and libzfs_core includes While nothing was wrong with libnvpair.h, libzfs_core.h was only guarded by MK_CDDL rather than MK_CDDL && MK_ZFS. Rather than ugl'if'ying include/Makefile to impose the extra restriction, just move the non-sys/ includes into INCS with the respect lib builds. This has the added bonus of allowing third party packagers to try and split these libs out of the FreeBSD-runtime package, if they are so inclined. The sys/ include was left alone- generally userland libraries shouldn't install kernel headers. MFC after: 1 week Modified: head/cddl/lib/libnvpair/Makefile head/cddl/lib/libzfs_core/Makefile head/include/Makefile Modified: head/cddl/lib/libnvpair/Makefile ============================================================================== --- head/cddl/lib/libnvpair/Makefile Sun Aug 12 22:07:13 2018 (r337695) +++ head/cddl/lib/libnvpair/Makefile Mon Aug 13 03:38:32 2018 (r337696) @@ -5,6 +5,7 @@ LIB= nvpair +INCS= libnvpair.h SRCS= libnvpair.c \ nvpair_alloc_system.c \ nvpair_json.c \ Modified: head/cddl/lib/libzfs_core/Makefile ============================================================================== --- head/cddl/lib/libzfs_core/Makefile Sun Aug 12 22:07:13 2018 (r337695) +++ head/cddl/lib/libzfs_core/Makefile Mon Aug 13 03:38:32 2018 (r337696) @@ -9,6 +9,7 @@ LIB= zfs_core LIBADD= nvpair +INCS= libzfs_core.h SRCS= libzfs_core.c \ libzfs_core_compat.c \ zfs_ioctl_compat.c Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Aug 12 22:07:13 2018 (r337695) +++ head/include/Makefile Mon Aug 13 03:38:32 2018 (r337696) @@ -246,12 +246,6 @@ copies: .PHONY .META ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \ ${SDESTDIR}${INCLUDEDIR}/teken .if ${MK_CDDL} != "no" - cd ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common; \ - ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libzfs_core.h \ - ${SDESTDIR}${INCLUDEDIR} - cd ${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair; \ - ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libnvpair.h \ - ${SDESTDIR}${INCLUDEDIR} cd ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nvpair.h \ ${SDESTDIR}${INCLUDEDIR}/sys From owner-svn-src-all@freebsd.org Mon Aug 13 03:42:16 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 10A271063F2B; Mon, 13 Aug 2018 03:42:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6486872A8; Mon, 13 Aug 2018 03:42:15 +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 7DA352F3E6; Mon, 13 Aug 2018 03:42:15 +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 w7D3gFj3015505; Mon, 13 Aug 2018 03:42:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D3gFSh015502; Mon, 13 Aug 2018 03:42:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808130342.w7D3gFSh015502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Aug 2018 03:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337697 - in head: lib/libbe sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libbe sbin/bectl X-SVN-Commit-Revision: 337697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 03:42:16 -0000 Author: kevans Date: Mon Aug 13 03:42:14 2018 New Revision: 337697 URL: https://svnweb.freebsd.org/changeset/base/337697 Log: libbe(3): Fix be_import to delete temp snapshot Deleting the temp snapshot isn't immediately possible because it's the origin of the newly imported boot environment. However, this is trivially solved by opening the new boot environment and promoting it. The roles are now reversed and the temp snapshot/dataset may be completely destroyed. Remove the BUGS from libbe(3) and bectl(8). Modified: head/lib/libbe/be.c head/lib/libbe/libbe.3 head/sbin/bectl/bectl.8 Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Aug 13 03:38:32 2018 (r337696) +++ head/lib/libbe/be.c Mon Aug 13 03:42:14 2018 (r337697) @@ -720,11 +720,27 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in err = zfs_clone(zfs, buf, props); zfs_close(zfs); - nvlist_free(props); - /* XXX TODO: Figure out how to destroy the ghost... */ - return (BE_ERR_SUCCESS); + if (err != 0) + return (set_error(lbh, BE_ERR_UNKNOWN)); + + /* + * Finally, we open up the dataset we just cloned the snapshot to so that + * we may promote it. This is necessary in order to clean up the ghost + * snapshot that doesn't need to be seen. + */ + if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) + return (set_error(lbh, BE_ERR_ZFSOPEN)); + + err = zfs_promote(zfs); + zfs_close(zfs); + + if (err != 0) + return (set_error(lbh, BE_ERR_UNKNOWN)); + + /* Clean up the temporary snapshot */ + return (be_destroy(lbh, nbuf, 0)); } #if SOON Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Mon Aug 13 03:38:32 2018 (r337696) +++ head/lib/libbe/libbe.3 Mon Aug 13 03:42:14 2018 (r337697) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2018 +.Dd August 12, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -455,9 +455,3 @@ were written as a 2017 Google Summer of Code project w as a mentor. Later work was done by .An Kyle Evans Aq Mt kevans@FreeBSD.org . -.Sh BUGS -The -.Fn be_import -function does not destroy the temporary boot environment it creates for import, -because the snapshot created to do the import may not be deleted since it is the -origin of the new boot environment. Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Mon Aug 13 03:38:32 2018 (r337696) +++ head/sbin/bectl/bectl.8 Mon Aug 13 03:42:14 2018 (r337697) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2018 +.Dd August 12, 2018 .Dt BECTL 8 .Os .Sh NAME @@ -271,9 +271,3 @@ Wrote the original .Xr beadm 1 manual page that this one is derived from. .El -.Sh BUGS -.Nm -import -does not destroy the temporary boot environment it creates for import, because -the snapshot created to do the import may not be deleted since it is the -origin of the new boot environment. From owner-svn-src-all@freebsd.org Mon Aug 13 03:43: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 597451064178; Mon, 13 Aug 2018 03:43:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07AE087445; Mon, 13 Aug 2018 03:43:50 +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 DBF9A2F3FE; Mon, 13 Aug 2018 03:43:49 +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 w7D3hnX0016301; Mon, 13 Aug 2018 03:43:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D3hn1I016300; Mon, 13 Aug 2018 03:43:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808130343.w7D3hn1I016300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Aug 2018 03:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337698 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 337698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 03:43:50 -0000 Author: kevans Date: Mon Aug 13 03:43:49 2018 New Revision: 337698 URL: https://svnweb.freebsd.org/changeset/base/337698 Log: libbe(3): Light typo fix/word addition Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Aug 13 03:42:14 2018 (r337697) +++ head/lib/libbe/be.c Mon Aug 13 03:43:49 2018 (r337698) @@ -726,9 +726,10 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in return (set_error(lbh, BE_ERR_UNKNOWN)); /* - * Finally, we open up the dataset we just cloned the snapshot to so that + * Finally, we open up the dataset we just cloned the snapshot so that * we may promote it. This is necessary in order to clean up the ghost - * snapshot that doesn't need to be seen. + * snapshot that doesn't need to be seen after the operation is + * complete. */ if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) return (set_error(lbh, BE_ERR_ZFSOPEN)); From owner-svn-src-all@freebsd.org Mon Aug 13 05:01: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 21F8E1065B04; Mon, 13 Aug 2018 05:01:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF2D88992E; Mon, 13 Aug 2018 05:01:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A04BF7B; Mon, 13 Aug 2018 05:01:20 +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 w7D51KTS055155; Mon, 13 Aug 2018 05:01:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D51KJD055153; Mon, 13 Aug 2018 05:01:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808130501.w7D51KJD055153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Aug 2018 05:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337699 - in head: cddl/lib/libbe sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: cddl/lib/libbe sbin/bectl X-SVN-Commit-Revision: 337699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 05:01:21 -0000 Author: kevans Date: Mon Aug 13 05:01:19 2018 New Revision: 337699 URL: https://svnweb.freebsd.org/changeset/base/337699 Log: libbe(3)/bectl(8): Remove now-redundant include paths These were previously necessary because the libnvpair and libzfs_core includes were not installed into the SYSROOT, being a part of the copies target in include/Makefile rather than being installed with the library. This was fixed in r337696 and the headers are now installed properly, so we may let go of the cruft. Modified: head/cddl/lib/libbe/Makefile head/sbin/bectl/Makefile Modified: head/cddl/lib/libbe/Makefile ============================================================================== --- head/cddl/lib/libbe/Makefile Mon Aug 13 03:43:49 2018 (r337698) +++ head/cddl/lib/libbe/Makefile Mon Aug 13 05:01:19 2018 (r337699) @@ -17,9 +17,7 @@ LIBADD+= zfs LIBADD+= nvpair CFLAGS+= -I${LIBBE_SRC} -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem Modified: head/sbin/bectl/Makefile ============================================================================== --- head/sbin/bectl/Makefile Mon Aug 13 03:43:49 2018 (r337698) +++ head/sbin/bectl/Makefile Mon Aug 13 05:01:19 2018 (r337699) @@ -13,7 +13,6 @@ LIBADD+= util CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair CFLAGS+= -DNEED_SOLARIS_BOOLEAN From owner-svn-src-all@freebsd.org Mon Aug 13 05:16:28 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 CC1C21065FF4; Mon, 13 Aug 2018 05:16:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 739858A0BB; Mon, 13 Aug 2018 05:16:28 +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 4624E290; Mon, 13 Aug 2018 05:16:28 +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 w7D5GRYD062324; Mon, 13 Aug 2018 05:16:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D5GRTa062323; Mon, 13 Aug 2018 05:16:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808130516.w7D5GRTa062323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Aug 2018 05:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337700 - head/include X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 337700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 05:16:29 -0000 Author: kevans Date: Mon Aug 13 05:16:27 2018 New Revision: 337700 URL: https://svnweb.freebsd.org/changeset/base/337700 Log: Install symlink for sys/nvpair.h in include/Makefile symlinks target Noticed while fixing the install/sysroot situation for libnvpair and libzfs_core- if one uses the symlinks target, libzfs_core.h is not installed. Modified: head/include/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Mon Aug 13 05:01:19 2018 (r337699) +++ head/include/Makefile Mon Aug 13 05:16:27 2018 (r337700) @@ -384,6 +384,11 @@ symlinks: .PHONY .META ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/rpc/$$h \ ${SDESTDIR}${INCLUDEDIR}/rpc; \ done +.if ${MK_CDDL} != "no" + ${INSTALL_SYMLINK} ${TAG_ARGS} \ + ../../../sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h \ + ${SDESTDIR}${INCLUDEDIR}/sys +.endif .if ${MK_MLX5TOOL} != "no" ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/mlx5/mlx5io.h \ ${SDESTDIR}${INCLUDEDIR}/dev/mlx5 From owner-svn-src-all@freebsd.org Mon Aug 13 05:44: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 2FB221066C66; Mon, 13 Aug 2018 05:44:18 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9F998B6CF; Mon, 13 Aug 2018 05:44:17 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.5] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 1D24C1F663; Mon, 13 Aug 2018 05:44:17 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.f.0.180709 Date: Sun, 12 Aug 2018 22:44:13 -0700 Subject: Re: svn commit: r337663 - in head: . cddl/lib cddl/lib/libbe contrib/mdocml lib/libbe sbin sbin/bectl share/mk From: Ravi Pokala To: Kyle Evans , , , Message-ID: <2F95BCD1-0C8A-4D65-9C44-6F391D4F2F68@panasas.com> Thread-Topic: svn commit: r337663 - in head: . cddl/lib cddl/lib/libbe contrib/mdocml lib/libbe sbin sbin/bectl share/mk References: <201808112350.w7BNo9t8047126@repo.freebsd.org> In-Reply-To: <201808112350.w7BNo9t8047126@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 05:44:18 -0000 -----Original Message----- From: on behalf of Kyle Evans Date: 2018-08-11, Saturday at 16:50 To: , , Subject: svn commit: r337663 - in head: . cddl/lib cddl/lib/libbe contrib/mdocml lib/libbe sbin sbin/bectl share/mk > Author: kevans > Date: Sat Aug 11 23:50:09 2018 > New Revision: 337663 > URL: https://svnweb.freebsd.org/changeset/base/337663 > > Log: > Merge libbe(3)/bectl(8) from projects/bectl into head > > bectl(8) is an administrative interface for working with ZFS boot > environments, intended to provide a superset of the functionality provided > by sysutils/beadm. > > libbe(3) is the back-end library that the required functionality has been > pulled out into for later reuse. > > These were originally written for GSoC 2017 under the mentorship of > allanjude@. Originally written by who? -Ravi (rpokala@) > > bectl(8) has proven pretty stable in my testing, with the known bug > documented in the man page. > > Relnotes: yes From owner-svn-src-all@freebsd.org Mon Aug 13 05:54:02 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 F0F6C1066ECA; Mon, 13 Aug 2018 05:54:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 905A78BAF0; Mon, 13 Aug 2018 05:54:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BA238F0; Mon, 13 Aug 2018 05:54:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7D5s1H2082523; Mon, 13 Aug 2018 05:54:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D5rswd082486; Mon, 13 Aug 2018 05:53:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808130553.w7D5rswd082486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 13 Aug 2018 05:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337701 - in vendor/device-tree/dist: Bindings Bindings/arm Bindings/arm/altera Bindings/arm/bcm Bindings/arm/mediatek Bindings/arm/mrvl Bindings/arm/msm Bindings/arm/omap Bindings/arm/... X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in vendor/device-tree/dist: Bindings Bindings/arm Bindings/arm/altera Bindings/arm/bcm Bindings/arm/mediatek Bindings/arm/mrvl Bindings/arm/msm Bindings/arm/omap Bindings/arm/samsung Bindings/arm/stm3... X-SVN-Commit-Revision: 337701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 05:54:02 -0000 Author: manu Date: Mon Aug 13 05:53:54 2018 New Revision: 337701 URL: https://svnweb.freebsd.org/changeset/base/337701 Log: Import latest DTS files from Linux 4.18 Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,g3dsys.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/stm32/ vendor/device-tree/dist/Bindings/arm/stm32/stm32-syscon.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/stm32/stm32.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/actions,s900-cmu.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/nuvoton,npcm750-clk.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/qcom,rpmh-clk.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/qcom,videocc.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/bridge/cdns,dsi.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/bridge/thine,thc63lvd1024.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/sunxi/sun6i-dsi.txt (contents, props changed) vendor/device-tree/dist/Bindings/edac/socfpga-eccmgr.txt (contents, props changed) vendor/device-tree/dist/Bindings/fpga/lattice-machxo2-spi.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpu/brcm,bcm-v3d.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpu/samsung-scaler.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/ltc2990.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/samsung,exynos-adc.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/afe/ vendor/device-tree/dist/Bindings/iio/afe/current-sense-amplifier.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/afe/current-sense-shunt.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/afe/voltage-divider.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/dac/ti,dac5571.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/mtk-pmic-keys.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/sprd,sc27xx-vibra.txt (contents, props changed) vendor/device-tree/dist/Bindings/ipmi/npcm7xx-kcs-bmc.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/backlight/zii,rave-sp-backlight.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-cr0014114.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-lm3601x.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-sc27xx-bltc.txt (contents, props changed) vendor/device-tree/dist/Bindings/mailbox/stm32-ipcc.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/cdns,csi2rx.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/cdns,csi2tx.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/ov7251.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/ov772x.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/panasonic,amg88xx.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/renesas,rcar-csi2.txt (contents, props changed) vendor/device-tree/dist/Bindings/memory-controllers/nvidia,tegra20-mc.txt (contents, props changed) vendor/device-tree/dist/Bindings/mmc/bluefield-dw-mshc.txt (contents, props changed) vendor/device-tree/dist/Bindings/mmc/jz4740.txt (contents, props changed) vendor/device-tree/dist/Bindings/mtd/ibm,ndfc.txt (contents, props changed) vendor/device-tree/dist/Bindings/mtd/partitions/ vendor/device-tree/dist/Bindings/mtd/partitions/brcm,bcm947xx-cfe-partitions.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/ibm,emac.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/microchip,lan78xx.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/mscc-miim.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/mscc-ocelot.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/qualcomm-bluetooth.txt (contents, props changed) vendor/device-tree/dist/Bindings/nvmem/zii,rave-sp-eeprom.txt (contents, props changed) vendor/device-tree/dist/Bindings/opp/kryo-cpufreq.txt (contents, props changed) vendor/device-tree/dist/Bindings/pci/mobiveil-pcie.txt (contents, props changed) vendor/device-tree/dist/Bindings/pci/rockchip-pcie-ep.txt (contents, props changed) vendor/device-tree/dist/Bindings/pci/rockchip-pcie-host.txt (contents, props changed) vendor/device-tree/dist/Bindings/phy/phy-mtk-xsphy.txt (contents, props changed) vendor/device-tree/dist/Bindings/ptp/ptp-qoriq.txt (contents, props changed) vendor/device-tree/dist/Bindings/regulator/rohm,bd71837-regulator.txt (contents, props changed) vendor/device-tree/dist/Bindings/regulator/sy8106a-regulator.txt (contents, props changed) vendor/device-tree/dist/Bindings/reserved-memory/qcom,cmd-db.txt (contents, props changed) vendor/device-tree/dist/Bindings/rng/samsung,exynos4-rng.txt (contents, props changed) vendor/device-tree/dist/Bindings/rng/sparc_sun_oracle_rng.txt (contents, props changed) vendor/device-tree/dist/Bindings/soc/qcom/qcom,apr.txt (contents, props changed) vendor/device-tree/dist/Bindings/soc/qcom/qcom,geni-se.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/adi,ssm2305.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/atmel-i2s.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/mt6351.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/mt6797-afe-pcm.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/mt6797-mt6351.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/qcom,apq8096.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/qcom,q6adm.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/qcom,q6afe.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/qcom,q6asm.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/qcom,q6core.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/rt5668.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/tscs454.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/altr,timer-1.0.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/arm,arch_timer.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/arm,armv7m-systick.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/arm,global_timer.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/arm,twd.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/fsl,gtm.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/mrvl,mmp-timer.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/qcom,msm-timer.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/st,spear-timer.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/ti,c64x+timer64.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/ti,timer.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/via,vt8500-timer.txt (contents, props changed) vendor/device-tree/dist/Bindings/usb/hisilicon,histb-xhci.txt (contents, props changed) vendor/device-tree/dist/Bindings/usb/richtek,rt1711h.txt (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/actions,s900-cmu.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/axg-aoclkc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/nuvoton,npcm7xx-clock.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8998.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-sdm845.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/qcom,rpmh.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/qcom,videocc-sdm845.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/r8a77470-cpg-mssr.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/r8a77990-cpg-mssr.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/sun50i-h6-r-ccu.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/dma/jz4780-dma.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/memory/tegra20-mc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/net/microchip-lan78xx.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/phy/phy-qcom-qusb2.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/px30-power.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/r8a77470-sysc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/r8a77990-sysc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/rk3036-power.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/rk3128-power.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/rk3228-power.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/axg-aoclkc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/sun50i-h6-r-ccu.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/soc/qcom,apr.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/sound/qcom,q6afe.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/sound/qcom,q6asm.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/sound/rt5640.h (contents, props changed) vendor/device-tree/dist/src/arm/am335x-osd335x-common.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/am335x-pocketbeagle.dts (contents, props changed) vendor/device-tree/dist/src/arm/am3517-som.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/aspeed-bmc-intel-s2600wf.dts (contents, props changed) vendor/device-tree/dist/src/arm/aspeed-bmc-opp-lanyang.dts (contents, props changed) vendor/device-tree/dist/src/arm/aspeed-bmc-portwell-neptune.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm2837-rpi-3-b-plus.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm283x-rpi-lan7515.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/bcm47094-luxul-xap-1610.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm47094-luxul-xwr-3150-v1.dts (contents, props changed) vendor/device-tree/dist/src/arm/berlin2cd-valve-steamlink.dts (contents, props changed) vendor/device-tree/dist/src/arm/dra7-mmc-iodelay.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-mamoj.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-dhcom-pdk2.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-dhcom-som.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-icore-mipi.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-kp-tpc.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-kp.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/meson8m2-mxiii-plus.dts (contents, props changed) vendor/device-tree/dist/src/arm/meson8m2.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/mt7623a-rfb-emmc.dts (contents, props changed) vendor/device-tree/dist/src/arm/mt7623a-rfb-nand.dts (contents, props changed) vendor/device-tree/dist/src/arm/mt7623a.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/mt7623n-rfb-emmc.dts (contents, props changed) vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk04.1-c1.dts (contents, props changed) vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk04.1-c3.dts (contents, props changed) vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk04.1.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk07.1-c1.dts (contents, props changed) vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk07.1-c2.dts (contents, props changed) vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk07.1.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/qcom-msm8974-sony-xperia-amami.dts (contents, props changed) vendor/device-tree/dist/src/arm/r8a77470-iwg23s-sbc.dts (contents, props changed) vendor/device-tree/dist/src/arm/r8a77470.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32f469.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/sun7i-a20-olimex-som-evb-emmc.dts (contents, props changed) vendor/device-tree/dist/src/arm/sun8i-h2-plus-libretech-all-h3-cc.dts (contents, props changed) vendor/device-tree/dist/src/arm/sun8i-r16-nintendo-nes-classic.dts (contents, props changed) vendor/device-tree/dist/src/arm/sun8i-r16-nintendo-super-nes-classic.dts (contents, props changed) vendor/device-tree/dist/src/arm/sunxi-libretech-all-h3-cc.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5-libretech-all-h3-cc.dts (contents, props changed) vendor/device-tree/dist/src/arm64/broadcom/bcm2837-rpi-3-b-plus.dts (contents, props changed) vendor/device-tree/dist/src/arm64/hisilicon/poplar-pinctrl.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/mediatek/mt2712-pinfunc.h (contents, props changed) vendor/device-tree/dist/src/arm64/qcom/msm8994-smd-rpm.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/qcom/sdm845-mtp.dts (contents, props changed) vendor/device-tree/dist/src/arm64/qcom/sdm845.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a77980-v3hsk.dts (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a77990-ebisu.dts (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a77990.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/synaptics/ vendor/device-tree/dist/src/arm64/synaptics/berlin4ct-dmp.dts (contents, props changed) vendor/device-tree/dist/src/arm64/synaptics/berlin4ct-stb.dts (contents, props changed) vendor/device-tree/dist/src/arm64/synaptics/berlin4ct.dtsi (contents, props changed) Deleted: vendor/device-tree/dist/Bindings/arm/altera/socfpga-eccmgr.txt vendor/device-tree/dist/Bindings/arm/arch_timer.txt vendor/device-tree/dist/Bindings/arm/armv7m_systick.txt vendor/device-tree/dist/Bindings/arm/global_timer.txt vendor/device-tree/dist/Bindings/arm/mrvl/timer.txt vendor/device-tree/dist/Bindings/arm/msm/timer.txt vendor/device-tree/dist/Bindings/arm/omap/timer.txt vendor/device-tree/dist/Bindings/arm/samsung/exynos-adc.txt vendor/device-tree/dist/Bindings/arm/spear-timer.txt vendor/device-tree/dist/Bindings/arm/stm32.txt vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-mc.txt vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra30-mc.txt vendor/device-tree/dist/Bindings/arm/twd.txt vendor/device-tree/dist/Bindings/arm/vt8500/via,vt8500-timer.txt vendor/device-tree/dist/Bindings/c6x/timer64.txt vendor/device-tree/dist/Bindings/clock/rockchip.txt vendor/device-tree/dist/Bindings/crypto/samsung,exynos-rng4.txt vendor/device-tree/dist/Bindings/marvell.txt vendor/device-tree/dist/Bindings/nios2/timer.txt vendor/device-tree/dist/Bindings/pci/rockchip-pcie.txt vendor/device-tree/dist/Bindings/powerpc/4xx/emac.txt vendor/device-tree/dist/Bindings/powerpc/4xx/ndfc.txt vendor/device-tree/dist/Bindings/powerpc/fsl/gtm.txt vendor/device-tree/dist/Bindings/sparc_sun_oracle_rng.txt vendor/device-tree/dist/src/arm/exynos5440-sd5v1.dts vendor/device-tree/dist/src/arm/exynos5440-ssdk5440.dts vendor/device-tree/dist/src/arm/exynos5440-tmu-sensor-conf.dtsi vendor/device-tree/dist/src/arm/exynos5440-trip-points.dtsi vendor/device-tree/dist/src/arm/exynos5440.dtsi vendor/device-tree/dist/src/arm/ste-ccu8540-pinctrl.dtsi vendor/device-tree/dist/src/arm/ste-ccu8540.dts vendor/device-tree/dist/src/arm/ste-ccu9540.dts vendor/device-tree/dist/src/arm64/marvell/berlin4ct-dmp.dts vendor/device-tree/dist/src/arm64/marvell/berlin4ct-stb.dts vendor/device-tree/dist/src/arm64/marvell/berlin4ct.dtsi vendor/device-tree/dist/src/powerpc/c2k.dts vendor/device-tree/dist/src/powerpc/sbc8349.dts Modified: vendor/device-tree/dist/Bindings/arm/amlogic.txt vendor/device-tree/dist/Bindings/arm/bcm/brcm,bcm2835.txt vendor/device-tree/dist/Bindings/arm/samsung/samsung-boards.txt vendor/device-tree/dist/Bindings/arm/shmobile.txt vendor/device-tree/dist/Bindings/arm/ux500/boards.txt vendor/device-tree/dist/Bindings/bus/ti-sysc.txt vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-aoclkc.txt vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-clkc.txt vendor/device-tree/dist/Bindings/clock/brcm,iproc-clocks.txt vendor/device-tree/dist/Bindings/clock/qcom,gcc.txt vendor/device-tree/dist/Bindings/clock/renesas,cpg-mssr.txt vendor/device-tree/dist/Bindings/clock/st/st,clkgen.txt vendor/device-tree/dist/Bindings/clock/sunxi-ccu.txt vendor/device-tree/dist/Bindings/clock/ti/gate.txt vendor/device-tree/dist/Bindings/clock/ti/interface.txt vendor/device-tree/dist/Bindings/cpufreq/cpufreq-mediatek.txt vendor/device-tree/dist/Bindings/devfreq/rk3399_dmc.txt vendor/device-tree/dist/Bindings/display/bridge/adi,adv7511.txt vendor/device-tree/dist/Bindings/display/bridge/renesas,dw-hdmi.txt vendor/device-tree/dist/Bindings/display/bridge/tda998x.txt vendor/device-tree/dist/Bindings/display/exynos/exynos5433-decon.txt vendor/device-tree/dist/Bindings/display/renesas,du.txt vendor/device-tree/dist/Bindings/display/tilcdc/tilcdc.txt vendor/device-tree/dist/Bindings/dma/k3dma.txt vendor/device-tree/dist/Bindings/dma/renesas,rcar-dmac.txt vendor/device-tree/dist/Bindings/dma/renesas,usb-dmac.txt vendor/device-tree/dist/Bindings/dma/ti-edma.txt vendor/device-tree/dist/Bindings/firmware/qcom,scm.txt vendor/device-tree/dist/Bindings/fsi/fsi-master-gpio.txt vendor/device-tree/dist/Bindings/gpio/gpio-pca953x.txt vendor/device-tree/dist/Bindings/gpio/nintendo,hollywood-gpio.txt vendor/device-tree/dist/Bindings/gpio/renesas,gpio-rcar.txt vendor/device-tree/dist/Bindings/gpio/snps-dwapb-gpio.txt vendor/device-tree/dist/Bindings/gpu/arm,mali-midgard.txt vendor/device-tree/dist/Bindings/gpu/arm,mali-utgard.txt vendor/device-tree/dist/Bindings/hwmon/gpio-fan.txt vendor/device-tree/dist/Bindings/i2c/i2c-davinci.txt vendor/device-tree/dist/Bindings/i2c/i2c-rcar.txt vendor/device-tree/dist/Bindings/i2c/i2c-s3c2410.txt vendor/device-tree/dist/Bindings/iio/adc/amlogic,meson-saradc.txt vendor/device-tree/dist/Bindings/iio/adc/mcp320x.txt vendor/device-tree/dist/Bindings/iio/adc/st,stm32-adc.txt vendor/device-tree/dist/Bindings/iio/adc/st,stm32-dfsdm-adc.txt vendor/device-tree/dist/Bindings/iio/dac/ltc2632.txt vendor/device-tree/dist/Bindings/iio/imu/inv_mpu6050.txt vendor/device-tree/dist/Bindings/iio/imu/st_lsm6dsx.txt vendor/device-tree/dist/Bindings/iio/potentiostat/lmp91000.txt vendor/device-tree/dist/Bindings/input/elan_i2c.txt vendor/device-tree/dist/Bindings/input/rmi4/rmi_2d_sensor.txt vendor/device-tree/dist/Bindings/input/rotary-encoder.txt vendor/device-tree/dist/Bindings/input/touchscreen/hideep.txt vendor/device-tree/dist/Bindings/interrupt-controller/amlogic,meson-gpio-intc.txt vendor/device-tree/dist/Bindings/interrupt-controller/arm,gic-v3.txt vendor/device-tree/dist/Bindings/interrupt-controller/nvidia,tegra20-ictlr.txt vendor/device-tree/dist/Bindings/interrupt-controller/st,stm32-exti.txt vendor/device-tree/dist/Bindings/leds/backlight/pwm-backlight.txt vendor/device-tree/dist/Bindings/mailbox/qcom,apcs-kpss-global.txt vendor/device-tree/dist/Bindings/media/rcar_vin.txt vendor/device-tree/dist/Bindings/media/renesas,ceu.txt vendor/device-tree/dist/Bindings/media/stih407-c8sectpfe.txt vendor/device-tree/dist/Bindings/memory-controllers/nvidia,tegra30-mc.txt vendor/device-tree/dist/Bindings/mfd/arizona.txt vendor/device-tree/dist/Bindings/mfd/as3722.txt vendor/device-tree/dist/Bindings/mfd/axp20x.txt vendor/device-tree/dist/Bindings/mfd/bd9571mwv.txt vendor/device-tree/dist/Bindings/mfd/da9063.txt vendor/device-tree/dist/Bindings/mfd/motorola-cpcap.txt vendor/device-tree/dist/Bindings/mfd/mt6397.txt vendor/device-tree/dist/Bindings/mfd/qcom,spmi-pmic.txt vendor/device-tree/dist/Bindings/mfd/stm32-timers.txt vendor/device-tree/dist/Bindings/mfd/sun6i-prcm.txt vendor/device-tree/dist/Bindings/mips/brcm/soc.txt vendor/device-tree/dist/Bindings/mips/lantiq/rcu.txt vendor/device-tree/dist/Bindings/mmc/amlogic,meson-gx.txt vendor/device-tree/dist/Bindings/mmc/exynos-dw-mshc.txt vendor/device-tree/dist/Bindings/mmc/microchip,sdhci-pic32.txt vendor/device-tree/dist/Bindings/mmc/mmc.txt vendor/device-tree/dist/Bindings/mmc/sdhci-omap.txt vendor/device-tree/dist/Bindings/mmc/sdhci-st.txt vendor/device-tree/dist/Bindings/mmc/tmio_mmc.txt vendor/device-tree/dist/Bindings/mtd/gpmi-nand.txt vendor/device-tree/dist/Bindings/mtd/mtk-nand.txt vendor/device-tree/dist/Bindings/mtd/partition.txt vendor/device-tree/dist/Bindings/mtd/sunxi-nand.txt vendor/device-tree/dist/Bindings/net/dsa/dsa.txt vendor/device-tree/dist/Bindings/net/dsa/ksz.txt vendor/device-tree/dist/Bindings/net/dsa/mt7530.txt vendor/device-tree/dist/Bindings/net/dsa/qca8k.txt vendor/device-tree/dist/Bindings/net/dwmac-sun8i.txt vendor/device-tree/dist/Bindings/net/fsl-fman.txt vendor/device-tree/dist/Bindings/net/fsl-tsec-phy.txt vendor/device-tree/dist/Bindings/net/meson-dwmac.txt vendor/device-tree/dist/Bindings/net/renesas,ravb.txt vendor/device-tree/dist/Bindings/net/sff,sfp.txt vendor/device-tree/dist/Bindings/net/sh_eth.txt vendor/device-tree/dist/Bindings/net/socionext,uniphier-ave4.txt vendor/device-tree/dist/Bindings/net/stm32-dwmac.txt vendor/device-tree/dist/Bindings/net/wireless/qcom,ath10k.txt vendor/device-tree/dist/Bindings/nvmem/allwinner,sunxi-sid.txt vendor/device-tree/dist/Bindings/opp/opp.txt vendor/device-tree/dist/Bindings/pci/designware-pcie.txt vendor/device-tree/dist/Bindings/pci/hisilicon-pcie.txt vendor/device-tree/dist/Bindings/pci/kirin-pcie.txt vendor/device-tree/dist/Bindings/pci/pci-armada8k.txt vendor/device-tree/dist/Bindings/pci/pci-keystone.txt vendor/device-tree/dist/Bindings/pci/rcar-pci.txt vendor/device-tree/dist/Bindings/pci/xgene-pci.txt vendor/device-tree/dist/Bindings/phy/qcom-qmp-phy.txt vendor/device-tree/dist/Bindings/phy/qcom-qusb2-phy.txt vendor/device-tree/dist/Bindings/pinctrl/actions,s900-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/allwinner,sunxi-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/brcm,bcm2835-gpio.txt vendor/device-tree/dist/Bindings/pinctrl/meson,pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-max77620.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-mcp23s08.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-mt7622.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-rk805.txt vendor/device-tree/dist/Bindings/pinctrl/renesas,pfc-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/rockchip,pinctrl.txt vendor/device-tree/dist/Bindings/power/fsl,imx-gpc.txt vendor/device-tree/dist/Bindings/power/pd-samsung.txt vendor/device-tree/dist/Bindings/power/power_domain.txt vendor/device-tree/dist/Bindings/power/renesas,rcar-sysc.txt vendor/device-tree/dist/Bindings/power/rockchip-io-domain.txt vendor/device-tree/dist/Bindings/power/supply/ab8500/btemp.txt vendor/device-tree/dist/Bindings/power/supply/ab8500/chargalg.txt vendor/device-tree/dist/Bindings/power/supply/ab8500/charger.txt vendor/device-tree/dist/Bindings/power/supply/bq27xxx.txt vendor/device-tree/dist/Bindings/power/wakeup-source.txt vendor/device-tree/dist/Bindings/pps/pps-gpio.txt vendor/device-tree/dist/Bindings/pwm/pwm-omap-dmtimer.txt vendor/device-tree/dist/Bindings/regulator/pfuze100.txt vendor/device-tree/dist/Bindings/regulator/qcom,spmi-regulator.txt vendor/device-tree/dist/Bindings/regulator/regulator.txt vendor/device-tree/dist/Bindings/regulator/tps65090.txt vendor/device-tree/dist/Bindings/remoteproc/qcom,q6v5.txt vendor/device-tree/dist/Bindings/reset/renesas,rst.txt vendor/device-tree/dist/Bindings/reset/st,sti-softreset.txt vendor/device-tree/dist/Bindings/rng/brcm,bcm2835.txt vendor/device-tree/dist/Bindings/rtc/nxp,rtc-2123.txt vendor/device-tree/dist/Bindings/rtc/st,stm32-rtc.txt vendor/device-tree/dist/Bindings/serial/microchip,pic32-uart.txt vendor/device-tree/dist/Bindings/soc/qcom/qcom,smd-rpm.txt vendor/device-tree/dist/Bindings/soc/qcom/qcom,smd.txt vendor/device-tree/dist/Bindings/soc/rockchip/power_domain.txt vendor/device-tree/dist/Bindings/soc/ti/keystone-navigator-qmss.txt vendor/device-tree/dist/Bindings/sound/cs42xx8.txt vendor/device-tree/dist/Bindings/sound/fsl,asrc.txt vendor/device-tree/dist/Bindings/sound/fsl,esai.txt vendor/device-tree/dist/Bindings/sound/fsl,spdif.txt vendor/device-tree/dist/Bindings/sound/fsl-sai.txt vendor/device-tree/dist/Bindings/sound/mt2701-afe-pcm.txt vendor/device-tree/dist/Bindings/sound/qcom,apq8016-sbc.txt vendor/device-tree/dist/Bindings/sound/rt274.txt vendor/device-tree/dist/Bindings/sound/rt5514.txt vendor/device-tree/dist/Bindings/sound/rt5616.txt vendor/device-tree/dist/Bindings/sound/rt5640.txt vendor/device-tree/dist/Bindings/sound/rt5645.txt vendor/device-tree/dist/Bindings/sound/rt5651.txt vendor/device-tree/dist/Bindings/sound/rt5663.txt vendor/device-tree/dist/Bindings/sound/sgtl5000.txt vendor/device-tree/dist/Bindings/sound/simple-card.txt vendor/device-tree/dist/Bindings/sound/st,stm32-i2s.txt vendor/device-tree/dist/Bindings/sound/st,stm32-sai.txt vendor/device-tree/dist/Bindings/sound/ti,tas6424.txt vendor/device-tree/dist/Bindings/sound/tscs42xx.txt vendor/device-tree/dist/Bindings/sound/wm8510.txt vendor/device-tree/dist/Bindings/sound/wm8523.txt vendor/device-tree/dist/Bindings/sound/wm8524.txt vendor/device-tree/dist/Bindings/sound/wm8580.txt vendor/device-tree/dist/Bindings/sound/wm8711.txt vendor/device-tree/dist/Bindings/sound/wm8728.txt vendor/device-tree/dist/Bindings/sound/wm8731.txt vendor/device-tree/dist/Bindings/sound/wm8737.txt vendor/device-tree/dist/Bindings/sound/wm8741.txt vendor/device-tree/dist/Bindings/sound/wm8750.txt vendor/device-tree/dist/Bindings/sound/wm8753.txt vendor/device-tree/dist/Bindings/sound/wm8770.txt vendor/device-tree/dist/Bindings/sound/wm8776.txt vendor/device-tree/dist/Bindings/sound/wm8804.txt vendor/device-tree/dist/Bindings/sound/wm8903.txt vendor/device-tree/dist/Bindings/sound/wm8960.txt vendor/device-tree/dist/Bindings/sound/wm8962.txt vendor/device-tree/dist/Bindings/sound/wm8994.txt vendor/device-tree/dist/Bindings/spi/spi-st-ssc.txt vendor/device-tree/dist/Bindings/submitting-patches.txt vendor/device-tree/dist/Bindings/thermal/exynos-thermal.txt vendor/device-tree/dist/Bindings/thermal/imx-thermal.txt vendor/device-tree/dist/Bindings/thermal/mediatek-thermal.txt vendor/device-tree/dist/Bindings/thermal/qcom-tsens.txt vendor/device-tree/dist/Bindings/thermal/rcar-gen3-thermal.txt vendor/device-tree/dist/Bindings/thermal/rcar-thermal.txt vendor/device-tree/dist/Bindings/thermal/uniphier-thermal.txt vendor/device-tree/dist/Bindings/timer/renesas,cmt.txt vendor/device-tree/dist/Bindings/usb/ci-hdrc-usb2.txt vendor/device-tree/dist/Bindings/usb/dwc3.txt vendor/device-tree/dist/Bindings/usb/fcs,fusb302.txt vendor/device-tree/dist/Bindings/usb/qcom,dwc3.txt vendor/device-tree/dist/Bindings/usb/rockchip,dwc3.txt vendor/device-tree/dist/Bindings/vendor-prefixes.txt vendor/device-tree/dist/Bindings/w1/w1-gpio.txt vendor/device-tree/dist/Bindings/watchdog/ingenic,jz4740-wdt.txt vendor/device-tree/dist/Bindings/watchdog/renesas-wdt.txt vendor/device-tree/dist/include/dt-bindings/clock/aspeed-clock.h vendor/device-tree/dist/include/dt-bindings/clock/bcm-sr.h vendor/device-tree/dist/include/dt-bindings/clock/gxbb-clkc.h vendor/device-tree/dist/include/dt-bindings/clock/histb-clock.h vendor/device-tree/dist/include/dt-bindings/clock/imx6qdl-clock.h vendor/device-tree/dist/include/dt-bindings/clock/imx6sx-clock.h vendor/device-tree/dist/include/dt-bindings/clock/imx6ul-clock.h vendor/device-tree/dist/include/dt-bindings/clock/imx7d-clock.h vendor/device-tree/dist/include/dt-bindings/clock/meson8b-clkc.h vendor/device-tree/dist/include/dt-bindings/clock/mt2701-clk.h vendor/device-tree/dist/include/dt-bindings/memory/tegra114-mc.h vendor/device-tree/dist/include/dt-bindings/memory/tegra124-mc.h vendor/device-tree/dist/include/dt-bindings/memory/tegra210-mc.h vendor/device-tree/dist/include/dt-bindings/memory/tegra30-mc.h vendor/device-tree/dist/include/dt-bindings/pinctrl/mt7623-pinfunc.h vendor/device-tree/dist/include/dt-bindings/reset/mt2701-resets.h vendor/device-tree/dist/include/dt-bindings/sound/fsl-imx-audmux.h vendor/device-tree/dist/src/arm/am335x-baltos-ir3220.dts vendor/device-tree/dist/src/arm/am335x-baltos-ir5221.dts vendor/device-tree/dist/src/arm/am335x-baltos.dtsi vendor/device-tree/dist/src/arm/am335x-bone-common.dtsi vendor/device-tree/dist/src/arm/am335x-boneblue.dts vendor/device-tree/dist/src/arm/am335x-evm.dts vendor/device-tree/dist/src/arm/am335x-evmsk.dts vendor/device-tree/dist/src/arm/am3517-evm.dts vendor/device-tree/dist/src/arm/am3517.dtsi vendor/device-tree/dist/src/arm/am437x-cm-t43.dts vendor/device-tree/dist/src/arm/am437x-gp-evm.dts vendor/device-tree/dist/src/arm/am437x-sk-evm.dts vendor/device-tree/dist/src/arm/am43x-epos-evm.dts vendor/device-tree/dist/src/arm/am571x-idk.dts vendor/device-tree/dist/src/arm/am572x-idk.dts vendor/device-tree/dist/src/arm/am574x-idk.dts vendor/device-tree/dist/src/arm/am57xx-beagle-x15-common.dtsi vendor/device-tree/dist/src/arm/am57xx-beagle-x15.dts vendor/device-tree/dist/src/arm/am57xx-idk-common.dtsi vendor/device-tree/dist/src/arm/armada-370-db.dts vendor/device-tree/dist/src/arm/armada-370-dlink-dns327l.dts vendor/device-tree/dist/src/arm/armada-370-mirabox.dts vendor/device-tree/dist/src/arm/armada-370-netgear-rn102.dts vendor/device-tree/dist/src/arm/armada-370-netgear-rn104.dts vendor/device-tree/dist/src/arm/armada-370-rd.dts vendor/device-tree/dist/src/arm/armada-370-seagate-nas-xbay.dtsi vendor/device-tree/dist/src/arm/armada-370-xp.dtsi vendor/device-tree/dist/src/arm/armada-375-db.dts vendor/device-tree/dist/src/arm/armada-375.dtsi vendor/device-tree/dist/src/arm/armada-385-db-ap.dts vendor/device-tree/dist/src/arm/armada-385-linksys-caiman.dts vendor/device-tree/dist/src/arm/armada-385-linksys-cobra.dts vendor/device-tree/dist/src/arm/armada-385-linksys-rango.dts vendor/device-tree/dist/src/arm/armada-385-linksys-shelby.dts vendor/device-tree/dist/src/arm/armada-385-linksys.dtsi vendor/device-tree/dist/src/arm/armada-385-synology-ds116.dts vendor/device-tree/dist/src/arm/armada-388-db.dts vendor/device-tree/dist/src/arm/armada-38x.dtsi vendor/device-tree/dist/src/arm/armada-390-db.dts vendor/device-tree/dist/src/arm/armada-395-gp.dts vendor/device-tree/dist/src/arm/armada-398-db.dts vendor/device-tree/dist/src/arm/armada-39x.dtsi vendor/device-tree/dist/src/arm/armada-xp-98dx3236.dtsi vendor/device-tree/dist/src/arm/armada-xp-db-dxbc2.dts vendor/device-tree/dist/src/arm/armada-xp-db-xc3-24g4xg.dts vendor/device-tree/dist/src/arm/armada-xp-db.dts vendor/device-tree/dist/src/arm/armada-xp-gp.dts vendor/device-tree/dist/src/arm/armada-xp-lenovo-ix4-300d.dts vendor/device-tree/dist/src/arm/armada-xp-linksys-mamba.dts vendor/device-tree/dist/src/arm/armada-xp-netgear-rn2120.dts vendor/device-tree/dist/src/arm/aspeed-ast2500-evb.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-romulus.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-witherspoon.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-zaius.dts vendor/device-tree/dist/src/arm/aspeed-g4.dtsi vendor/device-tree/dist/src/arm/aspeed-g5.dtsi vendor/device-tree/dist/src/arm/at91-sama5d2_xplained.dts vendor/device-tree/dist/src/arm/at91-sama5d4ek.dts vendor/device-tree/dist/src/arm/bcm-cygnus.dtsi vendor/device-tree/dist/src/arm/bcm-hr2.dtsi vendor/device-tree/dist/src/arm/bcm-nsp.dtsi vendor/device-tree/dist/src/arm/bcm2835-rpi-a-plus.dts vendor/device-tree/dist/src/arm/bcm2835-rpi-a.dts vendor/device-tree/dist/src/arm/bcm2835-rpi-b-plus.dts vendor/device-tree/dist/src/arm/bcm2835-rpi-b-rev2.dts vendor/device-tree/dist/src/arm/bcm2835-rpi-b.dts vendor/device-tree/dist/src/arm/bcm2835-rpi.dtsi vendor/device-tree/dist/src/arm/bcm2836-rpi-2-b.dts vendor/device-tree/dist/src/arm/bcm2837-rpi-3-b.dts vendor/device-tree/dist/src/arm/bcm283x.dtsi vendor/device-tree/dist/src/arm/bcm4708-asus-rt-ac56u.dts vendor/device-tree/dist/src/arm/bcm4708-asus-rt-ac68u.dts vendor/device-tree/dist/src/arm/bcm4708-buffalo-wzr-1750dhp.dts vendor/device-tree/dist/src/arm/bcm4708-linksys-ea6300-v1.dts vendor/device-tree/dist/src/arm/bcm4708-luxul-xap-1510.dts vendor/device-tree/dist/src/arm/bcm4708-luxul-xwc-1000.dts vendor/device-tree/dist/src/arm/bcm4708-netgear-r6300-v2.dts vendor/device-tree/dist/src/arm/bcm4708-smartrg-sr400ac.dts vendor/device-tree/dist/src/arm/bcm47081-asus-rt-n18u.dts vendor/device-tree/dist/src/arm/bcm47081-buffalo-wzr-600dhp2.dts vendor/device-tree/dist/src/arm/bcm47081-buffalo-wzr-900dhp.dts vendor/device-tree/dist/src/arm/bcm47081-luxul-xap-1410.dts vendor/device-tree/dist/src/arm/bcm47081-luxul-xwr-1200.dts vendor/device-tree/dist/src/arm/bcm47081-tplink-archer-c5-v2.dts vendor/device-tree/dist/src/arm/bcm4709-asus-rt-ac87u.dts vendor/device-tree/dist/src/arm/bcm4709-buffalo-wxr-1900dhp.dts vendor/device-tree/dist/src/arm/bcm4709-linksys-ea9200.dts vendor/device-tree/dist/src/arm/bcm4709-netgear-r7000.dts vendor/device-tree/dist/src/arm/bcm4709-tplink-archer-c9-v1.dts vendor/device-tree/dist/src/arm/bcm47094-dlink-dir-885l.dts vendor/device-tree/dist/src/arm/bcm47094-linksys-panamera.dts vendor/device-tree/dist/src/arm/bcm47094-luxul-abr-4500.dts vendor/device-tree/dist/src/arm/bcm47094-luxul-xbr-4500.dts vendor/device-tree/dist/src/arm/bcm47094-luxul-xwr-3100.dts vendor/device-tree/dist/src/arm/bcm47094-netgear-r8500.dts vendor/device-tree/dist/src/arm/bcm5301x-nand-cs0-bch1.dtsi vendor/device-tree/dist/src/arm/bcm5301x-nand-cs0-bch4.dtsi vendor/device-tree/dist/src/arm/bcm5301x-nand-cs0-bch8.dtsi vendor/device-tree/dist/src/arm/bcm5301x-nand-cs0.dtsi vendor/device-tree/dist/src/arm/bcm5301x.dtsi vendor/device-tree/dist/src/arm/berlin2-sony-nsz-gs7.dts vendor/device-tree/dist/src/arm/berlin2.dtsi vendor/device-tree/dist/src/arm/berlin2cd-google-chromecast.dts vendor/device-tree/dist/src/arm/berlin2cd.dtsi vendor/device-tree/dist/src/arm/berlin2q-marvell-dmp.dts vendor/device-tree/dist/src/arm/berlin2q.dtsi vendor/device-tree/dist/src/arm/da850-evm.dts vendor/device-tree/dist/src/arm/da850-lego-ev3.dts vendor/device-tree/dist/src/arm/da850.dtsi vendor/device-tree/dist/src/arm/dm8148-t410.dts vendor/device-tree/dist/src/arm/dra7-evm-common.dtsi vendor/device-tree/dist/src/arm/dra7-evm.dts vendor/device-tree/dist/src/arm/dra7.dtsi vendor/device-tree/dist/src/arm/dra71-evm.dts vendor/device-tree/dist/src/arm/dra72-evm-common.dtsi vendor/device-tree/dist/src/arm/dra72x-mmc-iodelay.dtsi vendor/device-tree/dist/src/arm/dra76-evm.dts vendor/device-tree/dist/src/arm/emev2-kzm9d.dts vendor/device-tree/dist/src/arm/emev2.dtsi vendor/device-tree/dist/src/arm/exynos-syscon-restart.dtsi vendor/device-tree/dist/src/arm/exynos3250-rinato.dts vendor/device-tree/dist/src/arm/exynos3250.dtsi vendor/device-tree/dist/src/arm/exynos4.dtsi vendor/device-tree/dist/src/arm/exynos4210-origen.dts vendor/device-tree/dist/src/arm/exynos4210-trats.dts vendor/device-tree/dist/src/arm/exynos4412-galaxy-s3.dtsi vendor/device-tree/dist/src/arm/exynos4412-midas.dtsi vendor/device-tree/dist/src/arm/exynos4412-n710x.dts vendor/device-tree/dist/src/arm/exynos4412-odroid-common.dtsi vendor/device-tree/dist/src/arm/exynos4412-odroidu3.dts vendor/device-tree/dist/src/arm/exynos4412-odroidx.dts vendor/device-tree/dist/src/arm/exynos4412-origen.dts vendor/device-tree/dist/src/arm/exynos4412.dtsi vendor/device-tree/dist/src/arm/exynos5.dtsi vendor/device-tree/dist/src/arm/exynos5250.dtsi vendor/device-tree/dist/src/arm/exynos5410.dtsi vendor/device-tree/dist/src/arm/exynos5420-peach-pit.dts vendor/device-tree/dist/src/arm/exynos5420.dtsi vendor/device-tree/dist/src/arm/exynos5422-odroid-core.dtsi vendor/device-tree/dist/src/arm/exynos5800-peach-pi.dts vendor/device-tree/dist/src/arm/gemini-dlink-dir-685.dts vendor/device-tree/dist/src/arm/gemini-dlink-dns-313.dts vendor/device-tree/dist/src/arm/gemini-nas4220b.dts vendor/device-tree/dist/src/arm/gemini-rut1xx.dts vendor/device-tree/dist/src/arm/gemini-sq201.dts vendor/device-tree/dist/src/arm/gemini-wbd111.dts vendor/device-tree/dist/src/arm/gemini-wbd222.dts vendor/device-tree/dist/src/arm/gemini.dtsi vendor/device-tree/dist/src/arm/imx1-ads.dts vendor/device-tree/dist/src/arm/imx1.dtsi vendor/device-tree/dist/src/arm/imx23-evk.dts vendor/device-tree/dist/src/arm/imx23.dtsi vendor/device-tree/dist/src/arm/imx25-pdk.dts vendor/device-tree/dist/src/arm/imx25.dtsi vendor/device-tree/dist/src/arm/imx27-apf27.dts vendor/device-tree/dist/src/arm/imx27-pdk.dts vendor/device-tree/dist/src/arm/imx27.dtsi vendor/device-tree/dist/src/arm/imx28-cfa10049.dts vendor/device-tree/dist/src/arm/imx28-duckbill-2-enocean.dts vendor/device-tree/dist/src/arm/imx28-evk.dts vendor/device-tree/dist/src/arm/imx28-tx28.dts vendor/device-tree/dist/src/arm/imx28.dtsi vendor/device-tree/dist/src/arm/imx31.dtsi vendor/device-tree/dist/src/arm/imx35-pdk.dts vendor/device-tree/dist/src/arm/imx35.dtsi vendor/device-tree/dist/src/arm/imx50-evk.dts vendor/device-tree/dist/src/arm/imx50.dtsi vendor/device-tree/dist/src/arm/imx51-babbage.dts vendor/device-tree/dist/src/arm/imx51-zii-rdu1.dts vendor/device-tree/dist/src/arm/imx51.dtsi vendor/device-tree/dist/src/arm/imx53-ard.dts vendor/device-tree/dist/src/arm/imx53-m53.dtsi vendor/device-tree/dist/src/arm/imx53-ppd.dts vendor/device-tree/dist/src/arm/imx53-qsb-common.dtsi vendor/device-tree/dist/src/arm/imx53-qsb.dts vendor/device-tree/dist/src/arm/imx53-qsrb.dts vendor/device-tree/dist/src/arm/imx53-smd.dts vendor/device-tree/dist/src/arm/imx53-tx53-x03x.dts vendor/device-tree/dist/src/arm/imx53-tx53.dtsi vendor/device-tree/dist/src/arm/imx53-voipac-dmm-668.dtsi vendor/device-tree/dist/src/arm/imx53.dtsi vendor/device-tree/dist/src/arm/imx6dl-aristainetos2_4.dts vendor/device-tree/dist/src/arm/imx6dl-colibri-eval-v3.dts vendor/device-tree/dist/src/arm/imx6dl-sabreauto.dts vendor/device-tree/dist/src/arm/imx6dl-sabresd.dts vendor/device-tree/dist/src/arm/imx6dl-udoo.dts vendor/device-tree/dist/src/arm/imx6dl-wandboard-revb1.dts vendor/device-tree/dist/src/arm/imx6dl-wandboard-revd1.dts vendor/device-tree/dist/src/arm/imx6dl-wandboard.dts vendor/device-tree/dist/src/arm/imx6dl.dtsi vendor/device-tree/dist/src/arm/imx6q-b850v3.dts vendor/device-tree/dist/src/arm/imx6q-ba16.dtsi vendor/device-tree/dist/src/arm/imx6q-bx50v3.dtsi vendor/device-tree/dist/src/arm/imx6q-gk802.dts vendor/device-tree/dist/src/arm/imx6q-icore-ofcap12.dts vendor/device-tree/dist/src/arm/imx6q-novena.dts vendor/device-tree/dist/src/arm/imx6q-pistachio.dts vendor/device-tree/dist/src/arm/imx6q-sabreauto.dts vendor/device-tree/dist/src/arm/imx6q-sabresd.dts vendor/device-tree/dist/src/arm/imx6q-udoo.dts vendor/device-tree/dist/src/arm/imx6q-utilite-pro.dts vendor/device-tree/dist/src/arm/imx6q-var-dt6customboard.dts vendor/device-tree/dist/src/arm/imx6q-wandboard-revb1.dts vendor/device-tree/dist/src/arm/imx6q-wandboard-revd1.dts vendor/device-tree/dist/src/arm/imx6q-wandboard.dts vendor/device-tree/dist/src/arm/imx6q.dtsi vendor/device-tree/dist/src/arm/imx6qdl-apalis.dtsi vendor/device-tree/dist/src/arm/imx6qdl-colibri.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw5904.dtsi vendor/device-tree/dist/src/arm/imx6qdl-hummingboard.dtsi vendor/device-tree/dist/src/arm/imx6qdl-hummingboard2.dtsi vendor/device-tree/dist/src/arm/imx6qdl-icore.dtsi vendor/device-tree/dist/src/arm/imx6qdl-phytec-pfla02.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sabreauto.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sabrelite.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sabresd.dtsi vendor/device-tree/dist/src/arm/imx6qdl-tx6-lcd.dtsi vendor/device-tree/dist/src/arm/imx6qdl-tx6-mb7.dtsi vendor/device-tree/dist/src/arm/imx6qdl-tx6.dtsi vendor/device-tree/dist/src/arm/imx6qdl-udoo.dtsi vendor/device-tree/dist/src/arm/imx6qdl-wandboard-revb1.dtsi vendor/device-tree/dist/src/arm/imx6qdl-wandboard-revc1.dtsi vendor/device-tree/dist/src/arm/imx6qdl-wandboard-revd1.dtsi vendor/device-tree/dist/src/arm/imx6qdl-wandboard.dtsi vendor/device-tree/dist/src/arm/imx6qdl-zii-rdu2.dtsi vendor/device-tree/dist/src/arm/imx6qdl.dtsi vendor/device-tree/dist/src/arm/imx6qp-sabreauto.dts vendor/device-tree/dist/src/arm/imx6qp-sabresd.dts vendor/device-tree/dist/src/arm/imx6qp-wandboard-revd1.dts vendor/device-tree/dist/src/arm/imx6qp-zii-rdu2.dts vendor/device-tree/dist/src/arm/imx6qp.dtsi vendor/device-tree/dist/src/arm/imx6sl-evk.dts vendor/device-tree/dist/src/arm/imx6sl.dtsi vendor/device-tree/dist/src/arm/imx6sx-nitrogen6sx.dts vendor/device-tree/dist/src/arm/imx6sx-sabreauto.dts vendor/device-tree/dist/src/arm/imx6sx.dtsi vendor/device-tree/dist/src/arm/imx6ul-14x14-evk.dts vendor/device-tree/dist/src/arm/imx6ul-isiot.dtsi vendor/device-tree/dist/src/arm/imx6ul-tx6ul-mainboard.dts vendor/device-tree/dist/src/arm/imx6ul-tx6ul.dtsi vendor/device-tree/dist/src/arm/imx6ul.dtsi vendor/device-tree/dist/src/arm/imx6ull-pinfunc.h vendor/device-tree/dist/src/arm/imx6ull.dtsi vendor/device-tree/dist/src/arm/imx7d-cl-som-imx7.dts vendor/device-tree/dist/src/arm/imx7d-nitrogen7.dts vendor/device-tree/dist/src/arm/imx7d-pinfunc.h vendor/device-tree/dist/src/arm/imx7d-sdb-sht11.dts vendor/device-tree/dist/src/arm/imx7d-sdb.dts vendor/device-tree/dist/src/arm/imx7d.dtsi vendor/device-tree/dist/src/arm/imx7s-warp.dts vendor/device-tree/dist/src/arm/imx7s.dtsi vendor/device-tree/dist/src/arm/keystone-k2g-evm.dts vendor/device-tree/dist/src/arm/logicpd-som-lv.dtsi vendor/device-tree/dist/src/arm/logicpd-torpedo-som.dtsi vendor/device-tree/dist/src/arm/meson8.dtsi vendor/device-tree/dist/src/arm/meson8b-odroidc1.dts vendor/device-tree/dist/src/arm/meson8b.dtsi vendor/device-tree/dist/src/arm/mt2701-evb.dts vendor/device-tree/dist/src/arm/mt2701.dtsi vendor/device-tree/dist/src/arm/mt6323.dtsi vendor/device-tree/dist/src/arm/mt6580-evbp1.dts vendor/device-tree/dist/src/arm/mt6580.dtsi vendor/device-tree/dist/src/arm/mt6589-aquaris5.dts vendor/device-tree/dist/src/arm/mt6589.dtsi vendor/device-tree/dist/src/arm/mt6592-evb.dts vendor/device-tree/dist/src/arm/mt6592.dtsi vendor/device-tree/dist/src/arm/mt7623.dtsi vendor/device-tree/dist/src/arm/mt7623n-bananapi-bpi-r2.dts vendor/device-tree/dist/src/arm/mt7623n-rfb-nand.dts vendor/device-tree/dist/src/arm/mt7623n-rfb.dtsi vendor/device-tree/dist/src/arm/mt8127-moose.dts vendor/device-tree/dist/src/arm/mt8127.dtsi vendor/device-tree/dist/src/arm/mt8135-evbp1.dts vendor/device-tree/dist/src/arm/mt8135.dtsi vendor/device-tree/dist/src/arm/omap2420-n810.dts vendor/device-tree/dist/src/arm/omap3-beagle-xm.dts vendor/device-tree/dist/src/arm/omap3-cm-t3x.dtsi vendor/device-tree/dist/src/arm/omap3-devkit8000-common.dtsi vendor/device-tree/dist/src/arm/omap3-devkit8000-lcd-common.dtsi vendor/device-tree/dist/src/arm/omap3-gta04.dtsi vendor/device-tree/dist/src/arm/omap3-pandora-common.dtsi vendor/device-tree/dist/src/arm/omap3-sb-t35.dtsi vendor/device-tree/dist/src/arm/omap4-droid4-xt894.dts vendor/device-tree/dist/src/arm/pxa3xx.dtsi vendor/device-tree/dist/src/arm/qcom-apq8064.dtsi vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk01.1.dtsi vendor/device-tree/dist/src/arm/qcom-ipq4019.dtsi vendor/device-tree/dist/src/arm/qcom-msm8660.dtsi vendor/device-tree/dist/src/arm/qcom-pm8941.dtsi vendor/device-tree/dist/src/arm/r7s72100.dtsi vendor/device-tree/dist/src/arm/r8a73a4-ape6evm.dts vendor/device-tree/dist/src/arm/r8a73a4.dtsi vendor/device-tree/dist/src/arm/r8a7740.dtsi vendor/device-tree/dist/src/arm/r8a7743-iwg20m.dtsi vendor/device-tree/dist/src/arm/r8a7743.dtsi vendor/device-tree/dist/src/arm/r8a7745-iwg22m.dtsi vendor/device-tree/dist/src/arm/r8a7745.dtsi vendor/device-tree/dist/src/arm/r8a7790-lager.dts vendor/device-tree/dist/src/arm/r8a7790.dtsi vendor/device-tree/dist/src/arm/r8a7791-koelsch.dts vendor/device-tree/dist/src/arm/r8a7791-porter.dts vendor/device-tree/dist/src/arm/r8a7791.dtsi vendor/device-tree/dist/src/arm/r8a7792-blanche.dts vendor/device-tree/dist/src/arm/r8a7792-wheat.dts vendor/device-tree/dist/src/arm/r8a7792.dtsi vendor/device-tree/dist/src/arm/r8a7793-gose.dts vendor/device-tree/dist/src/arm/r8a7793.dtsi vendor/device-tree/dist/src/arm/r8a7794-alt.dts vendor/device-tree/dist/src/arm/r8a7794-silk.dts vendor/device-tree/dist/src/arm/r8a7794.dtsi vendor/device-tree/dist/src/arm/rk3036.dtsi vendor/device-tree/dist/src/arm/rk322x.dtsi vendor/device-tree/dist/src/arm/rk3288-phycore-som.dtsi vendor/device-tree/dist/src/arm/rk3288-tinker.dts vendor/device-tree/dist/src/arm/rk3288-veyron-chromebook.dtsi vendor/device-tree/dist/src/arm/rk3288-veyron-minnie.dts vendor/device-tree/dist/src/arm/rk3288.dtsi vendor/device-tree/dist/src/arm/s3c2416-smdk2416.dts vendor/device-tree/dist/src/arm/s3c2416.dtsi vendor/device-tree/dist/src/arm/s3c24xx.dtsi vendor/device-tree/dist/src/arm/s3c6410-mini6410.dts vendor/device-tree/dist/src/arm/s3c6410-smdk6410.dts vendor/device-tree/dist/src/arm/s3c64xx.dtsi vendor/device-tree/dist/src/arm/sh73a0.dtsi vendor/device-tree/dist/src/arm/socfpga.dtsi vendor/device-tree/dist/src/arm/socfpga_arria10.dtsi vendor/device-tree/dist/src/arm/socfpga_cyclone5_vining_fpga.dts vendor/device-tree/dist/src/arm/ste-snowball.dts vendor/device-tree/dist/src/arm/stih407-family.dtsi vendor/device-tree/dist/src/arm/stih407-pinctrl.dtsi vendor/device-tree/dist/src/arm/stih407.dtsi vendor/device-tree/dist/src/arm/stih410.dtsi vendor/device-tree/dist/src/arm/stihxxx-b2120.dtsi vendor/device-tree/dist/src/arm/stm32f469-disco.dts vendor/device-tree/dist/src/arm/stm32f746-disco.dts vendor/device-tree/dist/src/arm/stm32f746.dtsi vendor/device-tree/dist/src/arm/stm32f769-disco.dts vendor/device-tree/dist/src/arm/stm32h743-pinctrl.dtsi vendor/device-tree/dist/src/arm/stm32h743.dtsi vendor/device-tree/dist/src/arm/stm32h743i-eval.dts vendor/device-tree/dist/src/arm/stm32mp157-pinctrl.dtsi vendor/device-tree/dist/src/arm/stm32mp157c-ed1.dts vendor/device-tree/dist/src/arm/stm32mp157c-ev1.dts vendor/device-tree/dist/src/arm/stm32mp157c.dtsi vendor/device-tree/dist/src/arm/sun7i-a20-olimex-som204-evb.dts vendor/device-tree/dist/src/arm/sun8i-a23-a33.dtsi vendor/device-tree/dist/src/arm/sun8i-a33.dtsi vendor/device-tree/dist/src/arm/sun8i-a83t.dtsi vendor/device-tree/dist/src/arm/sun8i-h2-plus-orangepi-zero.dts vendor/device-tree/dist/src/arm/sun8i-h3-libretech-all-h3-cc.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-one.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-pc.dts vendor/device-tree/dist/src/arm/sun8i-h3.dtsi vendor/device-tree/dist/src/arm/sun8i-r40-bananapi-m2-ultra.dts vendor/device-tree/dist/src/arm/sun8i-r40.dtsi vendor/device-tree/dist/src/arm/sun8i-v40-bananapi-m2-berry.dts vendor/device-tree/dist/src/arm/sunxi-h3-h5.dtsi vendor/device-tree/dist/src/arm/tegra114.dtsi vendor/device-tree/dist/src/arm/tegra124-apalis-v1.2.dtsi vendor/device-tree/dist/src/arm/tegra124-apalis.dtsi vendor/device-tree/dist/src/arm/tegra30.dtsi vendor/device-tree/dist/src/arm/uniphier-pro4.dtsi vendor/device-tree/dist/src/arm/uniphier-pxs2.dtsi vendor/device-tree/dist/src/arm/vexpress-v2m-rs1.dtsi vendor/device-tree/dist/src/arm/vexpress-v2m.dtsi vendor/device-tree/dist/src/arm/vexpress-v2p-ca15-tc1.dts vendor/device-tree/dist/src/arm/vexpress-v2p-ca15_a7.dts vendor/device-tree/dist/src/arm/vexpress-v2p-ca5s.dts vendor/device-tree/dist/src/arm/vexpress-v2p-ca9.dts vendor/device-tree/dist/src/arm/vf-colibri-eval-v3.dtsi vendor/device-tree/dist/src/arm/vf610-zii-dev-rev-b.dts vendor/device-tree/dist/src/arm/vf610-zii-dev-rev-c.dts vendor/device-tree/dist/src/arm/vf610-zii-dev.dtsi vendor/device-tree/dist/src/arm/vfxxx.dtsi vendor/device-tree/dist/src/arm64/allwinner/axp803.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-bananapi-m64.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-pine-h64.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6.dtsi vendor/device-tree/dist/src/arm64/altera/socfpga_stratix10.dtsi vendor/device-tree/dist/src/arm64/altera/socfpga_stratix10_socdk.dts vendor/device-tree/dist/src/arm64/amlogic/meson-axg-s400.dts vendor/device-tree/dist/src/arm64/amlogic/meson-axg.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gx.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-mali.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-p212.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl.dtsi vendor/device-tree/dist/src/arm64/arm/juno-base.dtsi vendor/device-tree/dist/src/arm64/arm/juno-motherboard.dtsi vendor/device-tree/dist/src/arm64/arm/juno-r1.dts vendor/device-tree/dist/src/arm64/arm/juno-r2.dts vendor/device-tree/dist/src/arm64/arm/juno.dts vendor/device-tree/dist/src/arm64/arm/rtsm_ve-aemv8a.dts vendor/device-tree/dist/src/arm64/arm/rtsm_ve-motherboard.dtsi vendor/device-tree/dist/src/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts vendor/device-tree/dist/src/arm64/arm/vexpress-v2m-rs1.dtsi vendor/device-tree/dist/src/arm64/broadcom/northstar2/ns2.dtsi vendor/device-tree/dist/src/arm64/broadcom/stingray/bcm958742k.dts vendor/device-tree/dist/src/arm64/broadcom/stingray/bcm958742t.dts vendor/device-tree/dist/src/arm64/broadcom/stingray/stingray.dtsi vendor/device-tree/dist/src/arm64/exynos/exynos5433.dtsi vendor/device-tree/dist/src/arm64/exynos/exynos7.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls208xa-rdb.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi3660-hikey960.dts vendor/device-tree/dist/src/arm64/hisilicon/hi3660.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi3798cv200-poplar.dts vendor/device-tree/dist/src/arm64/hisilicon/hi3798cv200.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi6220-hikey.dts vendor/device-tree/dist/src/arm64/hisilicon/hip06-d03.dts vendor/device-tree/dist/src/arm64/hisilicon/hip06.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hip07-d05.dts vendor/device-tree/dist/src/arm64/hisilicon/hip07.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-3720-espressobin.dts vendor/device-tree/dist/src/arm64/marvell/armada-37xx.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-7040-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-8040-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-8040-mcbin.dts vendor/device-tree/dist/src/arm64/marvell/armada-cp110.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt2712e.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt7622-rfb1.dts vendor/device-tree/dist/src/arm64/mediatek/mt7622.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8096-db820c-pins.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8096-db820c-pmic-pins.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8096-db820c.dtsi vendor/device-tree/dist/src/arm64/qcom/ipq8074-hk01.dts vendor/device-tree/dist/src/arm64/qcom/ipq8074.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8916.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8992-bullhead-rev-101.dts vendor/device-tree/dist/src/arm64/qcom/msm8992-pins.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8992.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8996.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7795-es1-salvator-x.dts vendor/device-tree/dist/src/arm64/renesas/r8a7795-es1.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7795-salvator-x.dts vendor/device-tree/dist/src/arm64/renesas/r8a7795-salvator-xs.dts vendor/device-tree/dist/src/arm64/renesas/r8a7795.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7796-salvator-x.dts vendor/device-tree/dist/src/arm64/renesas/r8a7796-salvator-xs.dts vendor/device-tree/dist/src/arm64/renesas/r8a7796.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77965-salvator-x.dts vendor/device-tree/dist/src/arm64/renesas/r8a77965-salvator-xs.dts vendor/device-tree/dist/src/arm64/renesas/r8a77965.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77970-eagle.dts vendor/device-tree/dist/src/arm64/renesas/r8a77970-v3msk.dts vendor/device-tree/dist/src/arm64/renesas/r8a77970.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77980-condor.dts vendor/device-tree/dist/src/arm64/renesas/r8a77980.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77995-draak.dts vendor/device-tree/dist/src/arm64/renesas/r8a77995.dtsi vendor/device-tree/dist/src/arm64/renesas/salvator-common.dtsi vendor/device-tree/dist/src/arm64/renesas/ulcb.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3328.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3368.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-firefly.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-gru-kevin.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-gru.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-puma-haikou.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-puma.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-sapphire-excavator.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-sapphire.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11-global.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20-global.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-pxs3.dtsi vendor/device-tree/dist/src/arm64/sprd/sc2731.dtsi vendor/device-tree/dist/src/arm64/sprd/sc9860.dtsi vendor/device-tree/dist/src/arm64/sprd/whale2.dtsi vendor/device-tree/dist/src/mips/ingenic/ci20.dts vendor/device-tree/dist/src/mips/ingenic/jz4740.dtsi vendor/device-tree/dist/src/mips/ingenic/jz4780.dtsi vendor/device-tree/dist/src/mips/mscc/ocelot.dtsi vendor/device-tree/dist/src/mips/mscc/ocelot_pcb123.dts vendor/device-tree/dist/src/powerpc/fsl/t104xqds.dtsi Modified: vendor/device-tree/dist/Bindings/arm/amlogic.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/amlogic.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/arm/amlogic.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -25,6 +25,10 @@ Boards with the Amlogic Meson8b SoC shall have the fol Required root node property: compatible: "amlogic,meson8b"; +Boards with the Amlogic Meson8m2 SoC shall have the following properties: + Required root node property: + compatible: "amlogic,meson8m2"; + Boards with the Amlogic Meson GXBaby SoC shall have the following properties: Required root node property: compatible: "amlogic,meson-gxbb"; @@ -53,6 +57,8 @@ Board compatible values (alphabetically, grouped by So - "hardkernel,odroid-c1" (Meson8b) - "tronfy,mxq" (Meson8b) + + - "tronsmart,mxiii-plus" (Meson8m2) - "amlogic,p200" (Meson gxbb) - "amlogic,p201" (Meson gxbb) Modified: vendor/device-tree/dist/Bindings/arm/bcm/brcm,bcm2835.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/bcm/brcm,bcm2835.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/arm/bcm/brcm,bcm2835.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -34,6 +34,10 @@ Raspberry Pi 3 Model B Required root node properties: compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; +Raspberry Pi 3 Model B+ +Required root node properties: +compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837"; + Raspberry Pi Compute Module Required root node properties: compatible = "raspberrypi,compute-module", "brcm,bcm2835"; Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,g3dsys.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,g3dsys.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,30 @@ +MediaTek g3dsys controller +============================ + +The MediaTek g3dsys controller provides various clocks and reset controller to +the GPU. + +Required Properties: + +- compatible: Should be: + - "mediatek,mt2701-g3dsys", "syscon": + for MT2701 SoC + - "mediatek,mt7623-g3dsys", "mediatek,mt2701-g3dsys", "syscon": + for MT7623 SoC +- #clock-cells: Must be 1 +- #reset-cells: Must be 1 + +The g3dsys controller uses the common clk binding from +Documentation/devicetree/bindings/clock/clock-bindings.txt +The available clocks are defined in dt-bindings/clock/mt*-clk.h. + +Example: + +g3dsys: clock-controller@13000000 { + compatible = "mediatek,mt7623-g3dsys", + "mediatek,mt2701-g3dsys", + "syscon"; + reg = <0 0x13000000 0 0x200>; + #clock-cells = <1>; + #reset-cells = <1>; +}; Modified: vendor/device-tree/dist/Bindings/arm/samsung/samsung-boards.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/samsung/samsung-boards.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/arm/samsung/samsung-boards.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -21,8 +21,6 @@ Required root node properties: - "samsung,smdk5420" - for Exynos5420-based Samsung SMDK5420 eval board. - "samsung,tm2" - for Exynos5433-based Samsung TM2 board. - "samsung,tm2e" - for Exynos5433-based Samsung TM2E board. - - "samsung,sd5v1" - for Exynos5440-based Samsung board. - - "samsung,ssdk5440" - for Exynos5440-based Samsung board. * Other companies Exynos SoC based * FriendlyARM @@ -68,7 +66,7 @@ Required root node properties: - "insignal,arndale-octa" - for Exynos5420-based Insignal Arndale Octa board. - "insignal,origen" - for Exynos4210-based Insignal Origen board. - - "insignal,origen4412 - for Exynos4412-based Insignal Origen board. + - "insignal,origen4412" - for Exynos4412-based Insignal Origen board. Optional nodes: Modified: vendor/device-tree/dist/Bindings/arm/shmobile.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/shmobile.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/arm/shmobile.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -21,6 +21,8 @@ SoCs: compatible = "renesas,r8a7744" - RZ/G1E (R8A77450) compatible = "renesas,r8a7745" + - RZ/G1C (R8A77470) + compatible = "renesas,r8a77470" - R-Car M1A (R8A77781) compatible = "renesas,r8a7778" - R-Car H1 (R8A77790) @@ -45,6 +47,8 @@ SoCs: compatible = "renesas,r8a77970" - R-Car V3H (R8A77980) compatible = "renesas,r8a77980" + - R-Car E3 (R8A77990) + compatible = "renesas,r8a77990" - R-Car D3 (R8A77995) compatible = "renesas,r8a77995" @@ -67,6 +71,8 @@ Boards: compatible = "renesas,draak", "renesas,r8a77995" - Eagle (RTP0RC77970SEB0010S) compatible = "renesas,eagle", "renesas,r8a77970" + - Ebisu (RTP0RC77990SEB0010S) + compatible = "renesas,ebisu", "renesas,r8a77990" - Genmai (RTK772100BC00000BR) compatible = "renesas,genmai", "renesas,r7s72100" - GR-Peach (X28A-M01-E/F) @@ -78,6 +84,8 @@ Boards: compatible = "renesas,h3ulcb", "renesas,r8a7795" - Henninger compatible = "renesas,henninger", "renesas,r8a7791" + - iWave Systems RZ/G1C Single Board Computer (iW-RainboW-G23S) + compatible = "iwave,g23s", "renesas,r8a77470" - iWave Systems RZ/G1E SODIMM SOM Development Platform (iW-RainboW-G22D) compatible = "iwave,g22d", "iwave,g22m", "renesas,r8a7745" - iWave Systems RZ/G1E SODIMM System On Module (iW-RainboW-G22M-SM) @@ -108,7 +116,7 @@ Boards: compatible = "renesas,salvator-x", "renesas,r8a7795" - Salvator-X (RTP0RC7796SIPB0011S) compatible = "renesas,salvator-x", "renesas,r8a7796" - - Salvator-X (RTP0RC7796SIPB0011S (M3N)) + - Salvator-X (RTP0RC7796SIPB0011S (M3-N)) compatible = "renesas,salvator-x", "renesas,r8a77965" - Salvator-XS (Salvator-X 2nd version, RTP0RC7795SIPB0012S) compatible = "renesas,salvator-xs", "renesas,r8a7795" @@ -124,6 +132,8 @@ Boards: compatible = "renesas,sk-rzg1m", "renesas,r8a7743" - Stout (ADAS Starterkit, Y-R-CAR-ADAS-SKH2-BOARD) compatible = "renesas,stout", "renesas,r8a7790" + - V3HSK (Y-ASK-RCAR-V3H-WS10) + compatible = "renesas,v3hsk", "renesas,r8a77980" - V3MSK (Y-ASK-RCAR-V3M-WS10) compatible = "renesas,v3msk", "renesas,r8a77970" - Wheat (RTP0RC7792ASKB0000JE) Added: vendor/device-tree/dist/Bindings/arm/stm32/stm32-syscon.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/stm32/stm32-syscon.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,14 @@ +STMicroelectronics STM32 Platforms System Controller + +Properties: + - compatible : should contain two values. First value must be : + - " st,stm32mp157-syscfg " - for stm32mp157 based SoCs, + second value must be always "syscon". + - reg : offset and length of the register set. + + Example: + syscfg: syscon@50020000 { + compatible = "st,stm32mp157-syscfg", "syscon"; + reg = <0x50020000 0x400>; + }; + Added: vendor/device-tree/dist/Bindings/arm/stm32/stm32.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/stm32/stm32.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,10 @@ +STMicroelectronics STM32 Platforms Device Tree Bindings + +Each device tree must specify which STM32 SoC it uses, +using one of the following compatible strings: + + st,stm32f429 + st,stm32f469 + st,stm32f746 + st,stm32h743 + st,stm32mp157 Modified: vendor/device-tree/dist/Bindings/arm/ux500/boards.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/ux500/boards.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/arm/ux500/boards.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -26,7 +26,7 @@ interrupt-controller: see binding for interrupt-controller/arm,gic.txt timer: - see binding for arm/twd.txt + see binding for timer/arm,twd.txt clocks: see binding for clocks/ux500.txt Modified: vendor/device-tree/dist/Bindings/bus/ti-sysc.txt ============================================================================== --- vendor/device-tree/dist/Bindings/bus/ti-sysc.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/bus/ti-sysc.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -79,7 +79,11 @@ Optional properties: mode as for example omap4 L4_CFG_CLKCTRL - clock-names should contain at least "fck", and optionally also "ick" - depending on the SoC and the interconnect target module + depending on the SoC and the interconnect target module, + some interconnect target modules also need additional + optional clocks that can be specified as listed in TRM + for the related CLKCTRL register bits 8 to 15 such as + "dbclk" or "clk32k" depending on their role - ti,hwmods optional TI interconnect module name to use legacy hwmod platform data Added: vendor/device-tree/dist/Bindings/clock/actions,s900-cmu.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/clock/actions,s900-cmu.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,47 @@ +* Actions S900 Clock Management Unit (CMU) + +The Actions S900 clock management unit generates and supplies clock to various +controllers within the SoC. The clock binding described here is applicable to +S900 SoC. + +Required Properties: + +- compatible: should be "actions,s900-cmu" +- reg: physical base address of the controller and length of memory mapped + region. +- clocks: Reference to the parent clocks ("hosc", "losc") +- #clock-cells: should be 1. + +Each clock is assigned an identifier, and client nodes can use this identifier +to specify the clock which they consume. + +All available clocks are defined as preprocessor macros in +dt-bindings/clock/actions,s900-cmu.h header and can be used in device +tree sources. + +External clocks: + +The hosc clock used as input for the plls is generated outside the SoC. It is +expected that it is defined using standard clock bindings as "hosc". + +Actions S900 CMU also requires one more clock: + - "losc" - internal low frequency oscillator + +Example: Clock Management Unit node: + + cmu: clock-controller@e0160000 { + compatible = "actions,s900-cmu"; + reg = <0x0 0xe0160000 0x0 0x1000>; + clocks = <&hosc>, <&losc>; + #clock-cells = <1>; + }; + +Example: UART controller node that consumes clock generated by the clock +management unit: + + uart: serial@e012a000 { + compatible = "actions,s900-uart", "actions,owl-uart"; + reg = <0x0 0xe012a000 0x0 0x2000>; + interrupts = ; + clocks = <&cmu CLK_UART5>; + }; Modified: vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-aoclkc.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-aoclkc.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-aoclkc.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -9,6 +9,7 @@ Required Properties: - GXBB (S905) : "amlogic,meson-gxbb-aoclkc" - GXL (S905X, S905D) : "amlogic,meson-gxl-aoclkc" - GXM (S912) : "amlogic,meson-gxm-aoclkc" + - AXG (A113D, A113X) : "amlogic,meson-axg-aoclkc" followed by the common "amlogic,meson-gx-aoclkc" - #clock-cells: should be 1. Modified: vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-clkc.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-clkc.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-clkc.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -10,9 +10,6 @@ Required Properties: "amlogic,gxl-clkc" for GXL and GXM SoC, "amlogic,axg-clkc" for AXG SoC. -- reg: physical base address of the clock controller and length of memory - mapped region. - - #clock-cells: should be 1. Each clock is assigned an identifier and client nodes can use this identifier @@ -20,13 +17,22 @@ to specify the clock which they consume. All available preprocessor macros in the dt-bindings/clock/gxbb-clkc.h header and can be used in device tree sources. +Parent node should have the following properties : +- compatible: "syscon", "simple-mfd, and "amlogic,meson-gx-hhi-sysctrl" or + "amlogic,meson-axg-hhi-sysctrl" +- reg: base address and size of the HHI system control register space. + Example: Clock controller node: - clkc: clock-controller@c883c000 { +sysctrl: system-controller@0 { + compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd"; + reg = <0 0 0 0x400>; + + clkc: clock-controller { #clock-cells = <1>; compatible = "amlogic,gxbb-clkc"; - reg = <0x0 0xc883c000 0x0 0x3db>; }; +}; Example: UART controller node that consumes the clock generated by the clock controller: Modified: vendor/device-tree/dist/Bindings/clock/brcm,iproc-clocks.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/brcm,iproc-clocks.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/clock/brcm,iproc-clocks.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -276,36 +276,38 @@ These clock IDs are defined in: clk_ts_500_ref genpll2 2 BCM_SR_GENPLL2_TS_500_REF_CLK clk_125_nitro genpll2 3 BCM_SR_GENPLL2_125_NITRO_CLK clk_chimp genpll2 4 BCM_SR_GENPLL2_CHIMP_CLK - clk_nic_flash genpll2 5 BCM_SR_GENPLL2_NIC_FLASH + clk_nic_flash genpll2 5 BCM_SR_GENPLL2_NIC_FLASH_CLK + clk_fs genpll2 6 BCM_SR_GENPLL2_FS_CLK genpll3 crystal 0 BCM_SR_GENPLL3 clk_hsls genpll3 1 BCM_SR_GENPLL3_HSLS_CLK clk_sdio genpll3 2 BCM_SR_GENPLL3_SDIO_CLK genpll4 crystal 0 BCM_SR_GENPLL4 - ccn genpll4 1 BCM_SR_GENPLL4_CCN_CLK + clk_ccn genpll4 1 BCM_SR_GENPLL4_CCN_CLK clk_tpiu_pll genpll4 2 BCM_SR_GENPLL4_TPIU_PLL_CLK - noc_clk genpll4 3 BCM_SR_GENPLL4_NOC_CLK + clk_noc genpll4 3 BCM_SR_GENPLL4_NOC_CLK clk_chclk_fs4 genpll4 4 BCM_SR_GENPLL4_CHCLK_FS4_CLK clk_bridge_fscpu genpll4 5 BCM_SR_GENPLL4_BRIDGE_FSCPU_CLK - genpll5 crystal 0 BCM_SR_GENPLL5 - fs4_hf_clk genpll5 1 BCM_SR_GENPLL5_FS4_HF_CLK - crypto_ae_clk genpll5 2 BCM_SR_GENPLL5_CRYPTO_AE_CLK - raid_ae_clk genpll5 3 BCM_SR_GENPLL5_RAID_AE_CLK + clk_fs4_hf genpll5 1 BCM_SR_GENPLL5_FS4_HF_CLK + clk_crypto_ae genpll5 2 BCM_SR_GENPLL5_CRYPTO_AE_CLK + clk_raid_ae genpll5 3 BCM_SR_GENPLL5_RAID_AE_CLK genpll6 crystal 0 BCM_SR_GENPLL6 - 48_usb genpll6 1 BCM_SR_GENPLL6_48_USB_CLK + clk_48_usb genpll6 1 BCM_SR_GENPLL6_48_USB_CLK lcpll0 crystal 0 BCM_SR_LCPLL0 clk_sata_refp lcpll0 1 BCM_SR_LCPLL0_SATA_REFP_CLK clk_sata_refn lcpll0 2 BCM_SR_LCPLL0_SATA_REFN_CLK - clk_usb_ref lcpll0 3 BCM_SR_LCPLL0_USB_REF_CLK - sata_refpn lcpll0 3 BCM_SR_LCPLL0_SATA_REFPN_CLK + clk_sata_350 lcpll0 3 BCM_SR_LCPLL0_SATA_350_CLK + clk_sata_500 lcpll0 4 BCM_SR_LCPLL0_SATA_500_CLK lcpll1 crystal 0 BCM_SR_LCPLL1 - wan lcpll1 1 BCM_SR_LCPLL0_WAN_CLK + clk_wan lcpll1 1 BCM_SR_LCPLL1_WAN_CLK + clk_usb_ref lcpll1 2 BCM_SR_LCPLL1_USB_REF_CLK + clk_crmu_ts lcpll1 3 BCM_SR_LCPLL1_CRMU_TS_CLK lcpll_pcie crystal 0 BCM_SR_LCPLL_PCIE - pcie_phy_ref lcpll1 1 BCM_SR_LCPLL_PCIE_PHY_REF_CLK + clk_pcie_phy_ref lcpll1 1 BCM_SR_LCPLL_PCIE_PHY_REF_CLK Added: vendor/device-tree/dist/Bindings/clock/nuvoton,npcm750-clk.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/clock/nuvoton,npcm750-clk.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,100 @@ +* Nuvoton NPCM7XX Clock Controller + +Nuvoton Poleg BMC NPCM7XX contains an integrated clock controller, which +generates and supplies clocks to all modules within the BMC. + +External clocks: + +There are six fixed clocks that are generated outside the BMC. All clocks are of +a known fixed value that cannot be changed. clk_refclk, clk_mcbypck and +clk_sysbypck are inputs to the clock controller. +clk_rg1refck, clk_rg2refck and clk_xin are external clocks suppling the +network. They are set on the device tree, but not used by the clock module. The +network devices use them directly. +Example can be found below. + +All available clocks are defined as preprocessor macros in: +dt-bindings/clock/nuvoton,npcm7xx-clock.h +and can be reused as DT sources. + +Required Properties of clock controller: + + - compatible: "nuvoton,npcm750-clk" : for clock controller of Nuvoton + Poleg BMC NPCM750 + + - reg: physical base address of the clock controller and length of + memory mapped region. + + - #clock-cells: should be 1. + +Example: Clock controller node: + + clk: clock-controller@f0801000 { + compatible = "nuvoton,npcm750-clk"; + #clock-cells = <1>; + reg = <0xf0801000 0x1000>; + clock-names = "refclk", "sysbypck", "mcbypck"; + clocks = <&clk_refclk>, <&clk_sysbypck>, <&clk_mcbypck>; + }; + +Example: Required external clocks for network: + + /* external reference clock */ + clk_refclk: clk-refclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + clock-output-names = "refclk"; + }; + + /* external reference clock for cpu. float in normal operation */ + clk_sysbypck: clk-sysbypck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <800000000>; + clock-output-names = "sysbypck"; + }; + + /* external reference clock for MC. float in normal operation */ + clk_mcbypck: clk-mcbypck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <800000000>; + clock-output-names = "mcbypck"; + }; + + /* external clock signal rg1refck, supplied by the phy */ + clk_rg1refck: clk-rg1refck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <125000000>; + clock-output-names = "clk_rg1refck"; + }; + + /* external clock signal rg2refck, supplied by the phy */ + clk_rg2refck: clk-rg2refck { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <125000000>; + clock-output-names = "clk_rg2refck"; + }; + + clk_xin: clk-xin { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + clock-output-names = "clk_xin"; + }; + + +Example: GMAC controller node that consumes two clocks: a generated clk by the +clock controller and a fixed clock from DT (clk_rg1refck). + + ethernet0: ethernet@f0802000 { + compatible = "snps,dwmac"; + reg = <0xf0802000 0x2000>; + interrupts = <0 14 4>; + interrupt-names = "macirq"; + clocks = <&clk_rg1refck>, <&clk NPCM7XX_CLK_AHB>; + clock-names = "stmmaceth", "clk_gmac"; + }; Modified: vendor/device-tree/dist/Bindings/clock/qcom,gcc.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/qcom,gcc.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/clock/qcom,gcc.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -17,7 +17,9 @@ Required properties : "qcom,gcc-msm8974pro-ac" "qcom,gcc-msm8994" "qcom,gcc-msm8996" + "qcom,gcc-msm8998" "qcom,gcc-mdm9615" + "qcom,gcc-sdm845" - reg : shall contain base register location and length - #clock-cells : shall contain 1 Added: vendor/device-tree/dist/Bindings/clock/qcom,rpmh-clk.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/clock/qcom,rpmh-clk.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,22 @@ +Qualcomm Technologies, Inc. RPMh Clocks +------------------------------------------------------- + +Resource Power Manager Hardened (RPMh) manages shared resources on +some Qualcomm Technologies Inc. SoCs. It accepts clock requests from +other hardware subsystems via RSC to control clocks. + +Required properties : +- compatible : shall contain "qcom,sdm845-rpmh-clk" + +- #clock-cells : must contain 1 + +Example : + +#include + + &apps_rsc { + rpmhcc: clock-controller { + compatible = "qcom,sdm845-rpmh-clk"; + #clock-cells = <1>; + }; + }; Added: vendor/device-tree/dist/Bindings/clock/qcom,videocc.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/clock/qcom,videocc.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,19 @@ +Qualcomm Video Clock & Reset Controller Binding +----------------------------------------------- + +Required properties : +- compatible : shall contain "qcom,sdm845-videocc" +- reg : shall contain base register location and length +- #clock-cells : from common clock binding, shall contain 1. +- #power-domain-cells : from generic power domain binding, shall contain 1. + +Optional properties : +- #reset-cells : from common reset binding, shall contain 1. + +Example: + videocc: clock-controller@ab00000 { + compatible = "qcom,sdm845-videocc"; + reg = <0xab00000 0x10000>; + #clock-cells = <1>; + #power-domain-cells = <1>; + }; Modified: vendor/device-tree/dist/Bindings/clock/renesas,cpg-mssr.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/renesas,cpg-mssr.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/clock/renesas,cpg-mssr.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -15,6 +15,7 @@ Required Properties: - compatible: Must be one of: - "renesas,r8a7743-cpg-mssr" for the r8a7743 SoC (RZ/G1M) - "renesas,r8a7745-cpg-mssr" for the r8a7745 SoC (RZ/G1E) + - "renesas,r8a77470-cpg-mssr" for the r8a77470 SoC (RZ/G1C) - "renesas,r8a7790-cpg-mssr" for the r8a7790 SoC (R-Car H2) - "renesas,r8a7791-cpg-mssr" for the r8a7791 SoC (R-Car M2-W) - "renesas,r8a7792-cpg-mssr" for the r8a7792 SoC (R-Car V2H) @@ -25,6 +26,7 @@ Required Properties: - "renesas,r8a77965-cpg-mssr" for the r8a77965 SoC (R-Car M3-N) - "renesas,r8a77970-cpg-mssr" for the r8a77970 SoC (R-Car V3M) - "renesas,r8a77980-cpg-mssr" for the r8a77980 SoC (R-Car V3H) + - "renesas,r8a77990-cpg-mssr" for the r8a77990 SoC (R-Car E3) - "renesas,r8a77995-cpg-mssr" for the r8a77995 SoC (R-Car D3) - reg: Base address and length of the memory resource used by the CPG/MSSR @@ -33,10 +35,12 @@ Required Properties: - clocks: References to external parent clocks, one entry for each entry in clock-names - clock-names: List of external parent clock names. Valid names are: - - "extal" (r8a7743, r8a7745, r8a7790, r8a7791, r8a7792, r8a7793, r8a7794, - r8a7795, r8a7796, r8a77965, r8a77970, r8a77980, r8a77995) + - "extal" (r8a7743, r8a7745, r8a77470, r8a7790, r8a7791, r8a7792, + r8a7793, r8a7794, r8a7795, r8a7796, r8a77965, r8a77970, + r8a77980, r8a77990, r8a77995) - "extalr" (r8a7795, r8a7796, r8a77965, r8a77970, r8a77980) - - "usb_extal" (r8a7743, r8a7745, r8a7790, r8a7791, r8a7793, r8a7794) + - "usb_extal" (r8a7743, r8a7745, r8a77470, r8a7790, r8a7791, r8a7793, + r8a7794) - #clock-cells: Must be 2 - For CPG core clocks, the two clock specifier cells must be "CPG_CORE" Modified: vendor/device-tree/dist/Bindings/clock/st/st,clkgen.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/st/st,clkgen.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/clock/st/st,clkgen.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -31,10 +31,10 @@ This binding uses the common clock binding[1]. Each subnode should use the binding described in [2]..[7] [1] Documentation/devicetree/bindings/clock/clock-bindings.txt -[3] Documentation/devicetree/bindings/clock/st,clkgen-mux.txt -[4] Documentation/devicetree/bindings/clock/st,clkgen-pll.txt -[7] Documentation/devicetree/bindings/clock/st,quadfs.txt -[8] Documentation/devicetree/bindings/clock/st,flexgen.txt +[3] Documentation/devicetree/bindings/clock/st/st,clkgen-mux.txt +[4] Documentation/devicetree/bindings/clock/st/st,clkgen-pll.txt +[7] Documentation/devicetree/bindings/clock/st/st,quadfs.txt +[8] Documentation/devicetree/bindings/clock/st/st,flexgen.txt Required properties: Modified: vendor/device-tree/dist/Bindings/clock/sunxi-ccu.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/sunxi-ccu.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/clock/sunxi-ccu.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -21,6 +21,7 @@ Required properties : - "allwinner,sun50i-a64-r-ccu" - "allwinner,sun50i-h5-ccu" - "allwinner,sun50i-h6-ccu" + - "allwinner,sun50i-h6-r-ccu" - "nextthing,gr8-ccu" - reg: Must contain the registers base address and length @@ -35,7 +36,7 @@ Required properties : For the main CCU on H6, one more clock is needed: - "iosc": the SoC's internal frequency oscillator -For the PRCM CCUs on A83T/H3/A64, two more clocks are needed: +For the PRCM CCUs on A83T/H3/A64/H6, two more clocks are needed: - "pll-periph": the SoC's peripheral PLL from the main CCU - "iosc": the SoC's internal frequency oscillator Modified: vendor/device-tree/dist/Bindings/clock/ti/gate.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/ti/gate.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/clock/ti/gate.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -10,7 +10,7 @@ will be controlled instead and the corresponding hw-op that is used. [1] Documentation/devicetree/bindings/clock/clock-bindings.txt -[2] Documentation/devicetree/bindings/clock/gate-clock.txt +[2] Documentation/devicetree/bindings/clock/gpio-gate-clock.txt [3] Documentation/devicetree/bindings/clock/ti/clockdomain.txt Required properties: Modified: vendor/device-tree/dist/Bindings/clock/ti/interface.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/ti/interface.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/clock/ti/interface.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -9,7 +9,7 @@ companion clock finding (match corresponding functiona clock) and hardware autoidle enable / disable. [1] Documentation/devicetree/bindings/clock/clock-bindings.txt -[2] Documentation/devicetree/bindings/clock/gate-clock.txt +[2] Documentation/devicetree/bindings/clock/gpio-gate-clock.txt Required properties: - compatible : shall be one of: Modified: vendor/device-tree/dist/Bindings/cpufreq/cpufreq-mediatek.txt ============================================================================== --- vendor/device-tree/dist/Bindings/cpufreq/cpufreq-mediatek.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/cpufreq/cpufreq-mediatek.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -8,7 +8,7 @@ Required properties: "intermediate" - A parent of "cpu" clock which is used as "intermediate" clock source (usually MAINPLL) when the original CPU PLL is under transition and not stable yet. - Please refer to Documentation/devicetree/bindings/clk/clock-bindings.txt for + Please refer to Documentation/devicetree/bindings/clock/clock-bindings.txt for generic clock consumer properties. - operating-points-v2: Please refer to Documentation/devicetree/bindings/opp/opp.txt for detail. Modified: vendor/device-tree/dist/Bindings/devfreq/rk3399_dmc.txt ============================================================================== --- vendor/device-tree/dist/Bindings/devfreq/rk3399_dmc.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/devfreq/rk3399_dmc.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -12,7 +12,7 @@ Required properties: - clocks: Phandles for clock specified in "clock-names" property - clock-names : The name of clock used by the DFI, must be "pclk_ddr_mon"; -- operating-points-v2: Refer to Documentation/devicetree/bindings/power/opp.txt +- operating-points-v2: Refer to Documentation/devicetree/bindings/opp/opp.txt for details. - center-supply: DMC supply node. - status: Marks the node enabled/disabled. Modified: vendor/device-tree/dist/Bindings/display/bridge/adi,adv7511.txt ============================================================================== --- vendor/device-tree/dist/Bindings/display/bridge/adi,adv7511.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/display/bridge/adi,adv7511.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -14,8 +14,14 @@ Required properties: "adi,adv7513" "adi,adv7533" -- reg: I2C slave address +- reg: I2C slave addresses + The ADV7511 internal registers are split into four pages exposed through + different I2C addresses, creating four register maps. Each map has it own + I2C address and acts as a standard slave device on the I2C bus. The main + address is mandatory, others are optional and revert to defaults if not + specified. + The ADV7511 supports a large number of input data formats that differ by their color depth, color format, clock mode, bit justification and random arrangement of components on the data bus. The combination of the following @@ -70,6 +76,9 @@ Optional properties: rather than generate its own timings for HDMI output. - clocks: from common clock binding: reference to the CEC clock. - clock-names: from common clock binding: must be "cec". +- reg-names : Names of maps with programmable addresses. + It can contain any map needing a non-default address. + Possible maps names are : "main", "edid", "cec", "packet" Required nodes: @@ -88,7 +97,12 @@ Example adv7511w: hdmi@39 { compatible = "adi,adv7511w"; - reg = <39>; + /* + * The EDID page will be accessible on address 0x66 on the I2C + * bus. All other maps continue to use their default addresses. + */ + reg = <0x39>, <0x66>; + reg-names = "main", "edid"; interrupt-parent = <&gpio3>; interrupts = <29 IRQ_TYPE_EDGE_FALLING>; clocks = <&cec_clock>; Added: vendor/device-tree/dist/Bindings/display/bridge/cdns,dsi.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/display/bridge/cdns,dsi.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,133 @@ +Cadence DSI bridge +================== + +The Cadence DSI bridge is a DPI to DSI bridge supporting up to 4 DSI lanes. + +Required properties: +- compatible: should be set to "cdns,dsi". +- reg: physical base address and length of the controller's registers. +- interrupts: interrupt line connected to the DSI bridge. +- clocks: DSI bridge clocks. +- clock-names: must contain "dsi_p_clk" and "dsi_sys_clk". +- phys: phandle link to the MIPI D-PHY controller. +- phy-names: must contain "dphy". +- #address-cells: must be set to 1. +- #size-cells: must be set to 0. + +Optional properties: +- resets: DSI reset lines. +- reset-names: can contain "dsi_p_rst". + +Required subnodes: +- ports: Ports as described in Documentation/devicetree/bindings/graph.txt. + 2 ports are available: + * port 0: this port is only needed if some of your DSI devices are + controlled through an external bus like I2C or SPI. Can have at + most 4 endpoints. The endpoint number is directly encoding the + DSI virtual channel used by this device. + * port 1: represents the DPI input. + Other ports will be added later to support the new kind of inputs. + +- one subnode per DSI device connected on the DSI bus. Each DSI device should + contain a reg property encoding its virtual channel. + +Cadence DPHY +============ + +Cadence DPHY block. + +Required properties: +- compatible: should be set to "cdns,dphy". +- reg: physical base address and length of the DPHY registers. +- clocks: DPHY reference clocks. +- clock-names: must contain "psm" and "pll_ref". +- #phy-cells: must be set to 0. + + +Example: + dphy0: dphy@fd0e0000{ + compatible = "cdns,dphy"; + reg = <0x0 0xfd0e0000 0x0 0x1000>; + clocks = <&psm_clk>, <&pll_ref_clk>; + clock-names = "psm", "pll_ref"; + #phy-cells = <0>; + }; + + dsi0: dsi@fd0c0000 { + compatible = "cdns,dsi"; + reg = <0x0 0xfd0c0000 0x0 0x1000>; + clocks = <&pclk>, <&sysclk>; + clock-names = "dsi_p_clk", "dsi_sys_clk"; + interrupts = <1>; + phys = <&dphy0>; + phy-names = "dphy"; + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + dsi0_dpi_input: endpoint { + remote-endpoint = <&xxx_dpi_output>; + }; + }; + }; + + panel: dsi-dev@0 { + compatible = ""; + reg = <0>; + }; + }; + +or + + dsi0: dsi@fd0c0000 { + compatible = "cdns,dsi"; + reg = <0x0 0xfd0c0000 0x0 0x1000>; + clocks = <&pclk>, <&sysclk>; + clock-names = "dsi_p_clk", "dsi_sys_clk"; + interrupts = <1>; + phys = <&dphy1>; + phy-names = "dphy"; + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + dsi0_output: endpoint@0 { + reg = <0>; + remote-endpoint = <&dsi_panel_input>; + }; + }; + + port@1 { + reg = <1>; + dsi0_dpi_input: endpoint { + remote-endpoint = <&xxx_dpi_output>; + }; + }; + }; + }; + + i2c@xxx { + panel: panel@59 { + compatible = ""; + reg = <0x59>; + + port { + dsi_panel_input: endpoint { + remote-endpoint = <&dsi0_output>; + }; + }; + }; + }; Modified: vendor/device-tree/dist/Bindings/display/bridge/renesas,dw-hdmi.txt ============================================================================== --- vendor/device-tree/dist/Bindings/display/bridge/renesas,dw-hdmi.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/display/bridge/renesas,dw-hdmi.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -14,6 +14,7 @@ Required properties: - compatible : Shall contain one or more of - "renesas,r8a7795-hdmi" for R8A7795 (R-Car H3) compatible HDMI TX - "renesas,r8a7796-hdmi" for R8A7796 (R-Car M3-W) compatible HDMI TX + - "renesas,r8a77965-hdmi" for R8A77965 (R-Car M3-N) compatible HDMI TX - "renesas,rcar-gen3-hdmi" for the generic R-Car Gen3 compatible HDMI TX When compatible with generic versions, nodes must list the SoC-specific Modified: vendor/device-tree/dist/Bindings/display/bridge/tda998x.txt ============================================================================== --- vendor/device-tree/dist/Bindings/display/bridge/tda998x.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/display/bridge/tda998x.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -27,7 +27,10 @@ Optional properties: in question is used. The implementation allows one or two DAIs. If two DAIs are defined, they must be of different type. -[1] Documentation/sound/alsa/soc/DAI.txt + - nxp,calib-gpios: calibration GPIO, which must correspond with the + gpio used for the TDA998x interrupt pin. + +[1] Documentation/sound/soc/dai.rst [2] include/dt-bindings/display/tda998x.h Example: Added: vendor/device-tree/dist/Bindings/display/bridge/thine,thc63lvd1024.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/display/bridge/thine,thc63lvd1024.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,60 @@ +Thine Electronics THC63LVD1024 LVDS decoder +------------------------------------------- + +The THC63LVD1024 is a dual link LVDS receiver designed to convert LVDS streams +to parallel data outputs. The chip supports single/dual input/output modes, +handling up to two LVDS input streams and up to two digital CMOS/TTL outputs. + +Single or dual operation mode, output data mapping and DDR output modes are +configured through input signals and the chip does not expose any control bus. + +Required properties: +- compatible: Shall be "thine,thc63lvd1024" +- vcc-supply: Power supply for TTL output, TTL CLOCKOUT signal, LVDS input, + PPL and digital circuitry + +Optional properties: +- powerdown-gpios: Power down GPIO signal, pin name "/PDWN". Active low +- oe-gpios: Output enable GPIO signal, pin name "OE". Active high + +The THC63LVD1024 video port connections are modeled according +to OF graph bindings specified by Documentation/devicetree/bindings/graph.txt + +Required video port nodes: +- port@0: First LVDS input port +- port@2: First digital CMOS/TTL parallel output + +Optional video port nodes: +- port@1: Second LVDS input port +- port@3: Second digital CMOS/TTL parallel output + +Example: +-------- + + thc63lvd1024: lvds-decoder { + compatible = "thine,thc63lvd1024"; + + vcc-supply = <®_lvds_vcc>; + powerdown-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + lvds_dec_in_0: endpoint { + remote-endpoint = <&lvds_out>; + }; + }; + + port@2{ + reg = <2>; + + lvds_dec_out_2: endpoint { + remote-endpoint = <&adv7511_in>; + }; + }; + }; + }; Modified: vendor/device-tree/dist/Bindings/display/exynos/exynos5433-decon.txt ============================================================================== --- vendor/device-tree/dist/Bindings/display/exynos/exynos5433-decon.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/display/exynos/exynos5433-decon.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -19,7 +19,8 @@ Required properties: clock-names property. - clock-names: list of clock names sorted in the same order as the clocks property. Must contain "pclk", "aclk_decon", "aclk_smmu_decon0x", - "aclk_xiu_decon0x", "pclk_smmu_decon0x", clk_decon_vclk", + "aclk_xiu_decon0x", "pclk_smmu_decon0x", "aclk_smmu_decon1x", + "aclk_xiu_decon1x", "pclk_smmu_decon1x", clk_decon_vclk", "sclk_decon_eclk" - ports: contains a port which is connected to mic node. address-cells and size-cells must 1 and 0, respectively. @@ -34,10 +35,14 @@ decon: decon@13800000 { clocks = <&cmu_disp CLK_ACLK_DECON>, <&cmu_disp CLK_ACLK_SMMU_DECON0X>, <&cmu_disp CLK_ACLK_XIU_DECON0X>, <&cmu_disp CLK_PCLK_SMMU_DECON0X>, + <&cmu_disp CLK_ACLK_SMMU_DECON1X>, + <&cmu_disp CLK_ACLK_XIU_DECON1X>, + <&cmu_disp CLK_PCLK_SMMU_DECON1X>, <&cmu_disp CLK_SCLK_DECON_VCLK>, <&cmu_disp CLK_SCLK_DECON_ECLK>; clock-names = "aclk_decon", "aclk_smmu_decon0x", "aclk_xiu_decon0x", - "pclk_smmu_decon0x", "sclk_decon_vclk", "sclk_decon_eclk"; + "pclk_smmu_decon0x", "aclk_smmu_decon1x", "aclk_xiu_decon1x", + "pclk_smmu_decon1x", "sclk_decon_vclk", "sclk_decon_eclk"; interrupt-names = "vsync", "lcd_sys"; interrupts = <0 202 0>, <0 203 0>; Modified: vendor/device-tree/dist/Bindings/display/renesas,du.txt ============================================================================== --- vendor/device-tree/dist/Bindings/display/renesas,du.txt Mon Aug 13 05:16:27 2018 (r337700) +++ vendor/device-tree/dist/Bindings/display/renesas,du.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -13,6 +13,7 @@ Required Properties: - "renesas,du-r8a7794" for R8A7794 (R-Car E2) compatible DU - "renesas,du-r8a7795" for R8A7795 (R-Car H3) compatible DU - "renesas,du-r8a7796" for R8A7796 (R-Car M3-W) compatible DU + - "renesas,du-r8a77965" for R8A77965 (R-Car M3-N) compatible DU - "renesas,du-r8a77970" for R8A77970 (R-Car V3M) compatible DU - "renesas,du-r8a77995" for R8A77995 (R-Car D3) compatible DU @@ -47,20 +48,21 @@ bindings specified in Documentation/devicetree/binding The following table lists for each supported model the port number corresponding to each DU output. - Port0 Port1 Port2 Port3 + Port0 Port1 Port2 Port3 ----------------------------------------------------------------------------- - R8A7743 (RZ/G1M) DPAD 0 LVDS 0 - - - R8A7745 (RZ/G1E) DPAD 0 DPAD 1 - - - R8A7779 (R-Car H1) DPAD 0 DPAD 1 - - - R8A7790 (R-Car H2) DPAD 0 LVDS 0 LVDS 1 - - R8A7791 (R-Car M2-W) DPAD 0 LVDS 0 - - - R8A7792 (R-Car V2H) DPAD 0 DPAD 1 - - - R8A7793 (R-Car M2-N) DPAD 0 LVDS 0 - - - R8A7794 (R-Car E2) DPAD 0 DPAD 1 - - - R8A7795 (R-Car H3) DPAD 0 HDMI 0 HDMI 1 LVDS 0 - R8A7796 (R-Car M3-W) DPAD 0 HDMI 0 LVDS 0 - - R8A77970 (R-Car V3M) DPAD 0 LVDS 0 - - - R8A77995 (R-Car D3) DPAD 0 LVDS 0 LVDS 1 - + R8A7743 (RZ/G1M) DPAD 0 LVDS 0 - - + R8A7745 (RZ/G1E) DPAD 0 DPAD 1 - - + R8A7779 (R-Car H1) DPAD 0 DPAD 1 - - + R8A7790 (R-Car H2) DPAD 0 LVDS 0 LVDS 1 - + R8A7791 (R-Car M2-W) DPAD 0 LVDS 0 - - + R8A7792 (R-Car V2H) DPAD 0 DPAD 1 - - + R8A7793 (R-Car M2-N) DPAD 0 LVDS 0 - - + R8A7794 (R-Car E2) DPAD 0 DPAD 1 - - + R8A7795 (R-Car H3) DPAD 0 HDMI 0 HDMI 1 LVDS 0 + R8A7796 (R-Car M3-W) DPAD 0 HDMI 0 LVDS 0 - + R8A77965 (R-Car M3-N) DPAD 0 HDMI 0 LVDS 0 - + R8A77970 (R-Car V3M) DPAD 0 LVDS 0 - - + R8A77995 (R-Car D3) DPAD 0 LVDS 0 LVDS 1 - Example: R8A7795 (R-Car H3) ES2.0 DU Added: vendor/device-tree/dist/Bindings/display/sunxi/sun6i-dsi.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/display/sunxi/sun6i-dsi.txt Mon Aug 13 05:53:54 2018 (r337701) @@ -0,0 +1,93 @@ +Allwinner A31 DSI Encoder +========================= + +The DSI pipeline consists of two separate blocks: the DSI controller +itself, and its associated D-PHY. + +DSI Encoder +----------- + +The DSI Encoder generates the DSI signal from the TCON's. + +Required properties: + - compatible: value must be one of: + * allwinner,sun6i-a31-mipi-dsi + - reg: base address and size of memory-mapped region + - interrupts: interrupt associated to this IP + - clocks: phandles to the clocks feeding the DSI encoder + * bus: the DSI interface clock + * mod: the DSI module clock + - clock-names: the clock names mentioned above + - phys: phandle to the D-PHY + - phy-names: must be "dphy" + - resets: phandle to the reset controller driving the encoder + + - ports: A ports node with endpoint definitions as defined in + Documentation/devicetree/bindings/media/video-interfaces.txt. The + first port should be the input endpoint, usually coming from the + associated TCON. + +Any MIPI-DSI device attached to this should be described according to +the bindings defined in ../mipi-dsi-bus.txt + +D-PHY *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 13 05:54: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 C101D1066F22; Mon, 13 Aug 2018 05:54:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 789498BC10; Mon, 13 Aug 2018 05:54:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 409148F1; Mon, 13 Aug 2018 05:54:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7D5shqq082590; Mon, 13 Aug 2018 05:54:43 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D5sh4C082589; Mon, 13 Aug 2018 05:54:43 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808130554.w7D5sh4C082589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 13 Aug 2018 05:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337702 - vendor/device-tree/4.18 X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: vendor/device-tree/4.18 X-SVN-Commit-Revision: 337702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 05:54:43 -0000 Author: manu Date: Mon Aug 13 05:54:42 2018 New Revision: 337702 URL: https://svnweb.freebsd.org/changeset/base/337702 Log: Tag DTS files from Linux 4.18 Added: vendor/device-tree/4.18/ - copied from r337701, vendor/device-tree/dist/ From owner-svn-src-all@freebsd.org Mon Aug 13 06:40:25 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 CD46C1067CA3; Mon, 13 Aug 2018 06:40:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BB318CBA9; Mon, 13 Aug 2018 06:40:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57A8AF54; Mon, 13 Aug 2018 06:40:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7D6eOi3003282; Mon, 13 Aug 2018 06:40:24 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D6eLfO003265; Mon, 13 Aug 2018 06:40:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808130640.w7D6eLfO003265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 13 Aug 2018 06:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337703 - in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/dma include/dt-bindings/memory include/dt-bindings/net include/dt-bindings/phy include/dt-bindings/pinct... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/dma include/dt-bindings/memory include/dt-bindings/net include/dt-bindings/phy include/dt-bindings/pinctrl include/dt-bindings/po... X-SVN-Commit-Revision: 337703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 06:40:25 -0000 Author: manu Date: Mon Aug 13 06:40:20 2018 New Revision: 337703 URL: https://svnweb.freebsd.org/changeset/base/337703 Log: Import DTS files from Linux 4.18 Added: - copied unchanged from r337701, vendor/device-tree/dist/src/arm/am335x-osd335x-common.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/am335x-pocketbeagle.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/am3517-som.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/aspeed-bmc-intel-s2600wf.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-lanyang.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/aspeed-bmc-portwell-neptune.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/bcm2837-rpi-3-b-plus.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/bcm283x-rpi-lan7515.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/bcm47094-luxul-xap-1610.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/bcm47094-luxul-xwr-3150-v1.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/berlin2cd-valve-steamlink.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/dra7-mmc-iodelay.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/imx6dl-mamoj.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/imx6q-dhcom-pdk2.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/imx6q-dhcom-som.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/imx6q-icore-mipi.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/imx6q-kp-tpc.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/imx6q-kp.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/meson8m2-mxiii-plus.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/meson8m2.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/mt7623a-rfb-emmc.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/mt7623a-rfb-nand.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/mt7623a.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/mt7623n-rfb-emmc.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk04.1-c1.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk04.1-c3.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk04.1.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk07.1-c1.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk07.1-c2.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/qcom-ipq4019-ap.dk07.1.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/qcom-msm8974-sony-xperia-amami.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/r8a77470-iwg23s-sbc.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/r8a77470.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/stm32f469.dtsi - copied unchanged from r337701, vendor/device-tree/dist/src/arm/sun7i-a20-olimex-som-evb-emmc.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/sun8i-h2-plus-libretech-all-h3-cc.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/sun8i-r16-nintendo-nes-classic.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/sun8i-r16-nintendo-super-nes-classic.dts - copied unchanged from r337701, vendor/device-tree/dist/src/arm/sunxi-libretech-all-h3-cc.dtsi - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/actions,s900-cmu.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/axg-aoclkc.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/nuvoton,npcm7xx-clock.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8998.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-sdm845.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/qcom,rpmh.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/qcom,videocc-sdm845.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/r8a77470-cpg-mssr.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/r8a77990-cpg-mssr.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/clock/sun50i-h6-r-ccu.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/memory/tegra20-mc.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/net/microchip-lan78xx.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/phy/phy-qcom-qusb2.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/power/px30-power.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/power/r8a77470-sysc.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/power/r8a77990-sysc.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/power/rk3036-power.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/power/rk3128-power.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/power/rk3228-power.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/reset/axg-aoclkc.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/reset/sun50i-h6-r-ccu.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/soc/qcom,apr.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/sound/qcom,q6afe.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/sound/qcom,q6asm.h - copied unchanged from r337701, vendor/device-tree/dist/include/dt-bindings/sound/rt5640.h Directory Properties: head/sys/gnu/dts/arm/am335x-osd335x-common.dtsi (props changed) head/sys/gnu/dts/arm/am335x-pocketbeagle.dts (props changed) head/sys/gnu/dts/arm/am3517-som.dtsi (props changed) head/sys/gnu/dts/arm/aspeed-bmc-intel-s2600wf.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-opp-lanyang.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-portwell-neptune.dts (props changed) head/sys/gnu/dts/arm/bcm2837-rpi-3-b-plus.dts (props changed) head/sys/gnu/dts/arm/bcm283x-rpi-lan7515.dtsi (props changed) head/sys/gnu/dts/arm/bcm47094-luxul-xap-1610.dts (props changed) head/sys/gnu/dts/arm/bcm47094-luxul-xwr-3150-v1.dts (props changed) head/sys/gnu/dts/arm/berlin2cd-valve-steamlink.dts (props changed) head/sys/gnu/dts/arm/dra7-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-mamoj.dts (props changed) head/sys/gnu/dts/arm/imx6q-dhcom-pdk2.dts (props changed) head/sys/gnu/dts/arm/imx6q-dhcom-som.dtsi (props changed) head/sys/gnu/dts/arm/imx6q-icore-mipi.dts (props changed) head/sys/gnu/dts/arm/imx6q-kp-tpc.dts (props changed) head/sys/gnu/dts/arm/imx6q-kp.dtsi (props changed) head/sys/gnu/dts/arm/meson8m2-mxiii-plus.dts (props changed) head/sys/gnu/dts/arm/meson8m2.dtsi (props changed) head/sys/gnu/dts/arm/mt7623a-rfb-emmc.dts (props changed) head/sys/gnu/dts/arm/mt7623a-rfb-nand.dts (props changed) head/sys/gnu/dts/arm/mt7623a.dtsi (props changed) head/sys/gnu/dts/arm/mt7623n-rfb-emmc.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk04.1-c1.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk04.1-c3.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk04.1.dtsi (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk07.1-c1.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk07.1-c2.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk07.1.dtsi (props changed) head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-amami.dts (props changed) head/sys/gnu/dts/arm/r8a77470-iwg23s-sbc.dts (props changed) head/sys/gnu/dts/arm/r8a77470.dtsi (props changed) head/sys/gnu/dts/arm/stm32f469.dtsi (props changed) head/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb-emmc.dts (props changed) head/sys/gnu/dts/arm/sun8i-h2-plus-libretech-all-h3-cc.dts (props changed) head/sys/gnu/dts/arm/sun8i-r16-nintendo-nes-classic.dts (props changed) head/sys/gnu/dts/arm/sun8i-r16-nintendo-super-nes-classic.dts (props changed) head/sys/gnu/dts/arm/sunxi-libretech-all-h3-cc.dtsi (props changed) head/sys/gnu/dts/include/dt-bindings/clock/actions,s900-cmu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/axg-aoclkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/nuvoton,npcm7xx-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8998.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmh.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,videocc-sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77470-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77990-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun50i-h6-r-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/tegra20-mc.h (props changed) head/sys/gnu/dts/include/dt-bindings/net/microchip-lan78xx.h (props changed) head/sys/gnu/dts/include/dt-bindings/phy/phy-qcom-qusb2.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/px30-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77470-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77990-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3036-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3128-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3228-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/axg-aoclkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun50i-h6-r-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/qcom,apr.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/qcom,q6afe.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/qcom,q6asm.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/rt5640.h (props changed) Deleted: head/sys/gnu/dts/arm/exynos5440-sd5v1.dts head/sys/gnu/dts/arm/exynos5440-ssdk5440.dts head/sys/gnu/dts/arm/exynos5440-tmu-sensor-conf.dtsi head/sys/gnu/dts/arm/exynos5440-trip-points.dtsi head/sys/gnu/dts/arm/exynos5440.dtsi head/sys/gnu/dts/arm/ste-ccu8540-pinctrl.dtsi head/sys/gnu/dts/arm/ste-ccu8540.dts head/sys/gnu/dts/arm/ste-ccu9540.dts head/sys/gnu/dts/include/dt-bindings/dma/jz4780-dma.h Modified: head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts head/sys/gnu/dts/arm/am335x-baltos.dtsi head/sys/gnu/dts/arm/am335x-bone-common.dtsi head/sys/gnu/dts/arm/am335x-boneblue.dts head/sys/gnu/dts/arm/am335x-evm.dts head/sys/gnu/dts/arm/am335x-evmsk.dts head/sys/gnu/dts/arm/am3517-evm.dts head/sys/gnu/dts/arm/am3517.dtsi head/sys/gnu/dts/arm/am437x-cm-t43.dts head/sys/gnu/dts/arm/am437x-gp-evm.dts head/sys/gnu/dts/arm/am437x-sk-evm.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/am571x-idk.dts head/sys/gnu/dts/arm/am572x-idk.dts head/sys/gnu/dts/arm/am574x-idk.dts head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi head/sys/gnu/dts/arm/am57xx-beagle-x15.dts head/sys/gnu/dts/arm/am57xx-idk-common.dtsi head/sys/gnu/dts/arm/armada-370-db.dts head/sys/gnu/dts/arm/armada-370-dlink-dns327l.dts head/sys/gnu/dts/arm/armada-370-mirabox.dts head/sys/gnu/dts/arm/armada-370-netgear-rn102.dts head/sys/gnu/dts/arm/armada-370-netgear-rn104.dts head/sys/gnu/dts/arm/armada-370-rd.dts head/sys/gnu/dts/arm/armada-370-seagate-nas-xbay.dtsi head/sys/gnu/dts/arm/armada-370-xp.dtsi head/sys/gnu/dts/arm/armada-375-db.dts head/sys/gnu/dts/arm/armada-375.dtsi head/sys/gnu/dts/arm/armada-385-db-ap.dts head/sys/gnu/dts/arm/armada-385-linksys-caiman.dts head/sys/gnu/dts/arm/armada-385-linksys-cobra.dts head/sys/gnu/dts/arm/armada-385-linksys-rango.dts head/sys/gnu/dts/arm/armada-385-linksys-shelby.dts head/sys/gnu/dts/arm/armada-385-linksys.dtsi head/sys/gnu/dts/arm/armada-385-synology-ds116.dts head/sys/gnu/dts/arm/armada-388-db.dts head/sys/gnu/dts/arm/armada-38x.dtsi head/sys/gnu/dts/arm/armada-390-db.dts head/sys/gnu/dts/arm/armada-395-gp.dts head/sys/gnu/dts/arm/armada-398-db.dts head/sys/gnu/dts/arm/armada-39x.dtsi head/sys/gnu/dts/arm/armada-xp-98dx3236.dtsi head/sys/gnu/dts/arm/armada-xp-db-dxbc2.dts head/sys/gnu/dts/arm/armada-xp-db-xc3-24g4xg.dts head/sys/gnu/dts/arm/armada-xp-db.dts head/sys/gnu/dts/arm/armada-xp-gp.dts head/sys/gnu/dts/arm/armada-xp-lenovo-ix4-300d.dts head/sys/gnu/dts/arm/armada-xp-linksys-mamba.dts head/sys/gnu/dts/arm/armada-xp-netgear-rn2120.dts head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4ek.dts head/sys/gnu/dts/arm/bcm-cygnus.dtsi head/sys/gnu/dts/arm/bcm-hr2.dtsi head/sys/gnu/dts/arm/bcm-nsp.dtsi head/sys/gnu/dts/arm/bcm2835-rpi-a-plus.dts head/sys/gnu/dts/arm/bcm2835-rpi-a.dts head/sys/gnu/dts/arm/bcm2835-rpi-b-plus.dts head/sys/gnu/dts/arm/bcm2835-rpi-b-rev2.dts head/sys/gnu/dts/arm/bcm2835-rpi-b.dts head/sys/gnu/dts/arm/bcm2835-rpi.dtsi head/sys/gnu/dts/arm/bcm2836-rpi-2-b.dts head/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts head/sys/gnu/dts/arm/bcm283x.dtsi head/sys/gnu/dts/arm/bcm4708-asus-rt-ac56u.dts head/sys/gnu/dts/arm/bcm4708-asus-rt-ac68u.dts head/sys/gnu/dts/arm/bcm4708-buffalo-wzr-1750dhp.dts head/sys/gnu/dts/arm/bcm4708-linksys-ea6300-v1.dts head/sys/gnu/dts/arm/bcm4708-luxul-xap-1510.dts head/sys/gnu/dts/arm/bcm4708-luxul-xwc-1000.dts head/sys/gnu/dts/arm/bcm4708-netgear-r6300-v2.dts head/sys/gnu/dts/arm/bcm4708-smartrg-sr400ac.dts head/sys/gnu/dts/arm/bcm47081-asus-rt-n18u.dts head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-600dhp2.dts head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-900dhp.dts head/sys/gnu/dts/arm/bcm47081-luxul-xap-1410.dts head/sys/gnu/dts/arm/bcm47081-luxul-xwr-1200.dts head/sys/gnu/dts/arm/bcm47081-tplink-archer-c5-v2.dts head/sys/gnu/dts/arm/bcm4709-asus-rt-ac87u.dts head/sys/gnu/dts/arm/bcm4709-buffalo-wxr-1900dhp.dts head/sys/gnu/dts/arm/bcm4709-linksys-ea9200.dts head/sys/gnu/dts/arm/bcm4709-netgear-r7000.dts head/sys/gnu/dts/arm/bcm4709-tplink-archer-c9-v1.dts head/sys/gnu/dts/arm/bcm47094-dlink-dir-885l.dts head/sys/gnu/dts/arm/bcm47094-linksys-panamera.dts head/sys/gnu/dts/arm/bcm47094-luxul-abr-4500.dts head/sys/gnu/dts/arm/bcm47094-luxul-xbr-4500.dts head/sys/gnu/dts/arm/bcm47094-luxul-xwr-3100.dts head/sys/gnu/dts/arm/bcm47094-netgear-r8500.dts head/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch1.dtsi head/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch4.dtsi head/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch8.dtsi head/sys/gnu/dts/arm/bcm5301x-nand-cs0.dtsi head/sys/gnu/dts/arm/bcm5301x.dtsi head/sys/gnu/dts/arm/berlin2-sony-nsz-gs7.dts head/sys/gnu/dts/arm/berlin2.dtsi head/sys/gnu/dts/arm/berlin2cd-google-chromecast.dts head/sys/gnu/dts/arm/berlin2cd.dtsi head/sys/gnu/dts/arm/berlin2q-marvell-dmp.dts head/sys/gnu/dts/arm/berlin2q.dtsi head/sys/gnu/dts/arm/da850-evm.dts head/sys/gnu/dts/arm/da850-lego-ev3.dts head/sys/gnu/dts/arm/da850.dtsi head/sys/gnu/dts/arm/dm8148-t410.dts head/sys/gnu/dts/arm/dra7-evm-common.dtsi head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/dra71-evm.dts head/sys/gnu/dts/arm/dra72-evm-common.dtsi head/sys/gnu/dts/arm/dra72x-mmc-iodelay.dtsi head/sys/gnu/dts/arm/dra76-evm.dts head/sys/gnu/dts/arm/emev2-kzm9d.dts head/sys/gnu/dts/arm/emev2.dtsi head/sys/gnu/dts/arm/exynos-syscon-restart.dtsi head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-origen.dts head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4412-galaxy-s3.dtsi head/sys/gnu/dts/arm/exynos4412-midas.dtsi head/sys/gnu/dts/arm/exynos4412-n710x.dts head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-odroidu3.dts head/sys/gnu/dts/arm/exynos4412-odroidx.dts head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos4412.dtsi head/sys/gnu/dts/arm/exynos5.dtsi head/sys/gnu/dts/arm/exynos5250.dtsi head/sys/gnu/dts/arm/exynos5410.dtsi head/sys/gnu/dts/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi head/sys/gnu/dts/arm/exynos5800-peach-pi.dts head/sys/gnu/dts/arm/gemini-dlink-dir-685.dts head/sys/gnu/dts/arm/gemini-dlink-dns-313.dts head/sys/gnu/dts/arm/gemini-nas4220b.dts head/sys/gnu/dts/arm/gemini-rut1xx.dts head/sys/gnu/dts/arm/gemini-sq201.dts head/sys/gnu/dts/arm/gemini-wbd111.dts head/sys/gnu/dts/arm/gemini-wbd222.dts head/sys/gnu/dts/arm/gemini.dtsi head/sys/gnu/dts/arm/imx1-ads.dts head/sys/gnu/dts/arm/imx1.dtsi head/sys/gnu/dts/arm/imx23-evk.dts head/sys/gnu/dts/arm/imx23.dtsi head/sys/gnu/dts/arm/imx25-pdk.dts head/sys/gnu/dts/arm/imx25.dtsi head/sys/gnu/dts/arm/imx27-apf27.dts head/sys/gnu/dts/arm/imx27-pdk.dts head/sys/gnu/dts/arm/imx27.dtsi head/sys/gnu/dts/arm/imx28-cfa10049.dts head/sys/gnu/dts/arm/imx28-duckbill-2-enocean.dts head/sys/gnu/dts/arm/imx28-evk.dts head/sys/gnu/dts/arm/imx28-tx28.dts head/sys/gnu/dts/arm/imx28.dtsi head/sys/gnu/dts/arm/imx31.dtsi head/sys/gnu/dts/arm/imx35-pdk.dts head/sys/gnu/dts/arm/imx35.dtsi head/sys/gnu/dts/arm/imx50-evk.dts head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx51-babbage.dts head/sys/gnu/dts/arm/imx51-zii-rdu1.dts head/sys/gnu/dts/arm/imx51.dtsi head/sys/gnu/dts/arm/imx53-ard.dts head/sys/gnu/dts/arm/imx53-m53.dtsi head/sys/gnu/dts/arm/imx53-ppd.dts head/sys/gnu/dts/arm/imx53-qsb-common.dtsi head/sys/gnu/dts/arm/imx53-qsb.dts head/sys/gnu/dts/arm/imx53-qsrb.dts head/sys/gnu/dts/arm/imx53-smd.dts head/sys/gnu/dts/arm/imx53-tx53-x03x.dts head/sys/gnu/dts/arm/imx53-tx53.dtsi head/sys/gnu/dts/arm/imx53-voipac-dmm-668.dtsi head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6dl-aristainetos2_4.dts head/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts head/sys/gnu/dts/arm/imx6dl-sabreauto.dts head/sys/gnu/dts/arm/imx6dl-sabresd.dts head/sys/gnu/dts/arm/imx6dl-udoo.dts head/sys/gnu/dts/arm/imx6dl-wandboard-revb1.dts head/sys/gnu/dts/arm/imx6dl-wandboard-revd1.dts head/sys/gnu/dts/arm/imx6dl-wandboard.dts head/sys/gnu/dts/arm/imx6dl.dtsi head/sys/gnu/dts/arm/imx6q-b850v3.dts head/sys/gnu/dts/arm/imx6q-ba16.dtsi head/sys/gnu/dts/arm/imx6q-bx50v3.dtsi head/sys/gnu/dts/arm/imx6q-gk802.dts head/sys/gnu/dts/arm/imx6q-icore-ofcap12.dts head/sys/gnu/dts/arm/imx6q-novena.dts head/sys/gnu/dts/arm/imx6q-pistachio.dts head/sys/gnu/dts/arm/imx6q-sabreauto.dts head/sys/gnu/dts/arm/imx6q-sabresd.dts head/sys/gnu/dts/arm/imx6q-udoo.dts head/sys/gnu/dts/arm/imx6q-utilite-pro.dts head/sys/gnu/dts/arm/imx6q-var-dt6customboard.dts head/sys/gnu/dts/arm/imx6q-wandboard-revb1.dts head/sys/gnu/dts/arm/imx6q-wandboard-revd1.dts head/sys/gnu/dts/arm/imx6q-wandboard.dts head/sys/gnu/dts/arm/imx6q.dtsi head/sys/gnu/dts/arm/imx6qdl-apalis.dtsi head/sys/gnu/dts/arm/imx6qdl-colibri.dtsi head/sys/gnu/dts/arm/imx6qdl-gw5904.dtsi head/sys/gnu/dts/arm/imx6qdl-hummingboard.dtsi head/sys/gnu/dts/arm/imx6qdl-hummingboard2.dtsi head/sys/gnu/dts/arm/imx6qdl-icore.dtsi head/sys/gnu/dts/arm/imx6qdl-phytec-pfla02.dtsi head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi head/sys/gnu/dts/arm/imx6qdl-sabrelite.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl-tx6-lcd.dtsi head/sys/gnu/dts/arm/imx6qdl-tx6-mb7.dtsi head/sys/gnu/dts/arm/imx6qdl-tx6.dtsi head/sys/gnu/dts/arm/imx6qdl-udoo.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard-revb1.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard-revc1.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard-revd1.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi head/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6qp-sabreauto.dts head/sys/gnu/dts/arm/imx6qp-sabresd.dts head/sys/gnu/dts/arm/imx6qp-wandboard-revd1.dts head/sys/gnu/dts/arm/imx6qp-zii-rdu2.dts head/sys/gnu/dts/arm/imx6qp.dtsi head/sys/gnu/dts/arm/imx6sl-evk.dts head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sx-nitrogen6sx.dts head/sys/gnu/dts/arm/imx6sx-sabreauto.dts head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-14x14-evk.dts head/sys/gnu/dts/arm/imx6ul-isiot.dtsi head/sys/gnu/dts/arm/imx6ul-tx6ul-mainboard.dts head/sys/gnu/dts/arm/imx6ul-tx6ul.dtsi head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx6ull-pinfunc.h head/sys/gnu/dts/arm/imx6ull.dtsi head/sys/gnu/dts/arm/imx7d-cl-som-imx7.dts head/sys/gnu/dts/arm/imx7d-nitrogen7.dts head/sys/gnu/dts/arm/imx7d-pinfunc.h head/sys/gnu/dts/arm/imx7d-sdb-sht11.dts head/sys/gnu/dts/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7d.dtsi head/sys/gnu/dts/arm/imx7s-warp.dts head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/keystone-k2g-evm.dts head/sys/gnu/dts/arm/logicpd-som-lv.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/mt2701-evb.dts head/sys/gnu/dts/arm/mt2701.dtsi head/sys/gnu/dts/arm/mt6323.dtsi head/sys/gnu/dts/arm/mt6580-evbp1.dts head/sys/gnu/dts/arm/mt6580.dtsi head/sys/gnu/dts/arm/mt6589-aquaris5.dts head/sys/gnu/dts/arm/mt6589.dtsi head/sys/gnu/dts/arm/mt6592-evb.dts head/sys/gnu/dts/arm/mt6592.dtsi head/sys/gnu/dts/arm/mt7623.dtsi head/sys/gnu/dts/arm/mt7623n-bananapi-bpi-r2.dts head/sys/gnu/dts/arm/mt7623n-rfb-nand.dts head/sys/gnu/dts/arm/mt7623n-rfb.dtsi head/sys/gnu/dts/arm/mt8127-moose.dts head/sys/gnu/dts/arm/mt8127.dtsi head/sys/gnu/dts/arm/mt8135-evbp1.dts head/sys/gnu/dts/arm/mt8135.dtsi head/sys/gnu/dts/arm/omap2420-n810.dts head/sys/gnu/dts/arm/omap3-beagle-xm.dts head/sys/gnu/dts/arm/omap3-cm-t3x.dtsi head/sys/gnu/dts/arm/omap3-devkit8000-common.dtsi head/sys/gnu/dts/arm/omap3-devkit8000-lcd-common.dtsi head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-pandora-common.dtsi head/sys/gnu/dts/arm/omap3-sb-t35.dtsi head/sys/gnu/dts/arm/omap4-droid4-xt894.dts head/sys/gnu/dts/arm/pxa3xx.dtsi head/sys/gnu/dts/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk01.1.dtsi head/sys/gnu/dts/arm/qcom-ipq4019.dtsi head/sys/gnu/dts/arm/qcom-msm8660.dtsi head/sys/gnu/dts/arm/qcom-pm8941.dtsi head/sys/gnu/dts/arm/r7s72100.dtsi head/sys/gnu/dts/arm/r8a73a4-ape6evm.dts head/sys/gnu/dts/arm/r8a73a4.dtsi head/sys/gnu/dts/arm/r8a7740.dtsi head/sys/gnu/dts/arm/r8a7743-iwg20m.dtsi head/sys/gnu/dts/arm/r8a7743.dtsi head/sys/gnu/dts/arm/r8a7745-iwg22m.dtsi head/sys/gnu/dts/arm/r8a7745.dtsi head/sys/gnu/dts/arm/r8a7790-lager.dts head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791-koelsch.dts head/sys/gnu/dts/arm/r8a7791-porter.dts head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7792-blanche.dts head/sys/gnu/dts/arm/r8a7792-wheat.dts head/sys/gnu/dts/arm/r8a7792.dtsi head/sys/gnu/dts/arm/r8a7793-gose.dts head/sys/gnu/dts/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794-alt.dts head/sys/gnu/dts/arm/r8a7794-silk.dts head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/rk3036.dtsi head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-phycore-som.dtsi head/sys/gnu/dts/arm/rk3288-tinker.dts head/sys/gnu/dts/arm/rk3288-veyron-chromebook.dtsi head/sys/gnu/dts/arm/rk3288-veyron-minnie.dts head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/s3c2416-smdk2416.dts head/sys/gnu/dts/arm/s3c2416.dtsi head/sys/gnu/dts/arm/s3c24xx.dtsi head/sys/gnu/dts/arm/s3c6410-mini6410.dts head/sys/gnu/dts/arm/s3c6410-smdk6410.dts head/sys/gnu/dts/arm/s3c64xx.dtsi head/sys/gnu/dts/arm/sh73a0.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10.dtsi head/sys/gnu/dts/arm/socfpga_cyclone5_vining_fpga.dts head/sys/gnu/dts/arm/ste-snowball.dts head/sys/gnu/dts/arm/stih407-family.dtsi head/sys/gnu/dts/arm/stih407-pinctrl.dtsi head/sys/gnu/dts/arm/stih407.dtsi head/sys/gnu/dts/arm/stih410.dtsi head/sys/gnu/dts/arm/stihxxx-b2120.dtsi head/sys/gnu/dts/arm/stm32f469-disco.dts head/sys/gnu/dts/arm/stm32f746-disco.dts head/sys/gnu/dts/arm/stm32f746.dtsi head/sys/gnu/dts/arm/stm32f769-disco.dts head/sys/gnu/dts/arm/stm32h743-pinctrl.dtsi head/sys/gnu/dts/arm/stm32h743.dtsi head/sys/gnu/dts/arm/stm32h743i-eval.dts head/sys/gnu/dts/arm/stm32mp157-pinctrl.dtsi head/sys/gnu/dts/arm/stm32mp157c-ed1.dts head/sys/gnu/dts/arm/stm32mp157c-ev1.dts head/sys/gnu/dts/arm/stm32mp157c.dtsi head/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb.dts head/sys/gnu/dts/arm/sun8i-a23-a33.dtsi head/sys/gnu/dts/arm/sun8i-a33.dtsi head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts head/sys/gnu/dts/arm/sun8i-h3-libretech-all-h3-cc.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc.dts head/sys/gnu/dts/arm/sun8i-h3.dtsi head/sys/gnu/dts/arm/sun8i-r40-bananapi-m2-ultra.dts head/sys/gnu/dts/arm/sun8i-r40.dtsi head/sys/gnu/dts/arm/sun8i-v40-bananapi-m2-berry.dts head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/arm/tegra114.dtsi head/sys/gnu/dts/arm/tegra124-apalis-v1.2.dtsi head/sys/gnu/dts/arm/tegra124-apalis.dtsi head/sys/gnu/dts/arm/tegra30.dtsi head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm/vexpress-v2m.dtsi head/sys/gnu/dts/arm/vexpress-v2p-ca15-tc1.dts head/sys/gnu/dts/arm/vexpress-v2p-ca15_a7.dts head/sys/gnu/dts/arm/vexpress-v2p-ca5s.dts head/sys/gnu/dts/arm/vexpress-v2p-ca9.dts head/sys/gnu/dts/arm/vf-colibri-eval-v3.dtsi head/sys/gnu/dts/arm/vf610-zii-dev-rev-b.dts head/sys/gnu/dts/arm/vf610-zii-dev-rev-c.dts head/sys/gnu/dts/arm/vf610-zii-dev.dtsi head/sys/gnu/dts/arm/vfxxx.dtsi head/sys/gnu/dts/include/dt-bindings/clock/aspeed-clock.h head/sys/gnu/dts/include/dt-bindings/clock/bcm-sr.h head/sys/gnu/dts/include/dt-bindings/clock/gxbb-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/histb-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6ul-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx7d-clock.h head/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/mt2701-clk.h head/sys/gnu/dts/include/dt-bindings/memory/tegra114-mc.h head/sys/gnu/dts/include/dt-bindings/memory/tegra124-mc.h head/sys/gnu/dts/include/dt-bindings/memory/tegra210-mc.h head/sys/gnu/dts/include/dt-bindings/memory/tegra30-mc.h head/sys/gnu/dts/include/dt-bindings/pinctrl/mt7623-pinfunc.h head/sys/gnu/dts/include/dt-bindings/reset/mt2701-resets.h head/sys/gnu/dts/include/dt-bindings/sound/fsl-imx-audmux.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/include/ (props changed) Modified: head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Mon Aug 13 06:40:20 2018 (r337703) @@ -85,7 +85,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-parent = <&gpio0>; - interrupts = <20 GPIO_ACTIVE_LOW>; + interrupts = <20 IRQ_TYPE_EDGE_RISING>; pinctrl-names = "default"; pinctrl-0 = <&tca6416_pins>; }; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Mon Aug 13 06:40:20 2018 (r337703) @@ -94,7 +94,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-parent = <&gpio0>; - interrupts = <20 GPIO_ACTIVE_LOW>; + interrupts = <20 IRQ_TYPE_EDGE_RISING>; pinctrl-names = "default"; pinctrl-0 = <&tca6416_pins>; }; Modified: head/sys/gnu/dts/arm/am335x-baltos.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos.dtsi Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am335x-baltos.dtsi Mon Aug 13 06:40:20 2018 (r337703) @@ -249,7 +249,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-parent = <&gpio1>; - interrupts = <28 GPIO_ACTIVE_LOW>; + interrupts = <28 IRQ_TYPE_EDGE_RISING>; pinctrl-names = "default"; pinctrl-0 = <&tps65910_pins>; }; Modified: head/sys/gnu/dts/arm/am335x-bone-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-bone-common.dtsi Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am335x-bone-common.dtsi Mon Aug 13 06:40:20 2018 (r337703) @@ -161,7 +161,13 @@ mmc1_pins: pinmux_mmc1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* GPIO0_6 */ + AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spio0_cs1.gpio0_6 */ + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0.mmc0_dat0 */ + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1.mmc0_dat1 */ + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2.mmc0_dat2 */ + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */ + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */ + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk */ >; }; Modified: head/sys/gnu/dts/arm/am335x-boneblue.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblue.dts Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am335x-boneblue.dts Mon Aug 13 06:40:20 2018 (r337703) @@ -364,7 +364,7 @@ compatible = "invensense,mpu9250"; reg = <0x68>; interrupt-parent = <&gpio3>; - interrupts = <21 GPIO_ACTIVE_LOW>; + interrupts = <21 IRQ_TYPE_EDGE_RISING>; i2c-gate { #address-cells = <1>; #size-cells = <0>; Modified: head/sys/gnu/dts/arm/am335x-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evm.dts Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am335x-evm.dts Mon Aug 13 06:40:20 2018 (r337703) @@ -303,7 +303,14 @@ mmc1_pins: pinmux_mmc1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */ + AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */ + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0.mmc0_dat0 */ + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1.mmc0_dat1 */ + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2.mmc0_dat2 */ + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */ + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */ + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk */ + AM33XX_IOPAD(0x9a0, PIN_INPUT | MUX_MODE4) /* mcasp0_aclkr.mmc0_sdwp */ >; }; Modified: head/sys/gnu/dts/arm/am335x-evmsk.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evmsk.dts Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am335x-evmsk.dts Mon Aug 13 06:40:20 2018 (r337703) @@ -137,7 +137,7 @@ }; }; - backlight { + lcd_bl: backlight { compatible = "pwm-backlight"; pwms = <&ecap2 0 50000 PWM_POLARITY_INVERTED>; brightness-levels = <0 58 61 66 75 90 125 170 255>; @@ -172,6 +172,7 @@ pinctrl-names = "default", "sleep"; pinctrl-0 = <&lcd_pins_default>; pinctrl-1 = <&lcd_pins_sleep>; + backlight = <&lcd_bl>; status = "okay"; panel-info { ac-bias = <255>; @@ -399,7 +400,14 @@ mmc1_pins: pinmux_mmc1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */ + AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */ + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0.mmc0_dat0 */ + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1.mmc0_dat1 */ + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2.mmc0_dat2 */ + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */ + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */ + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk */ + AM33XX_IOPAD(0x9a0, PIN_INPUT | MUX_MODE4) /* mcasp0_aclkr.mmc0_sdwp */ >; }; Copied: head/sys/gnu/dts/arm/am335x-osd335x-common.dtsi (from r337701, vendor/device-tree/dist/src/arm/am335x-osd335x-common.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am335x-osd335x-common.dtsi Mon Aug 13 06:40:20 2018 (r337703, copy of r337701, vendor/device-tree/dist/src/arm/am335x-osd335x-common.dtsi) @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * + * Author: Robert Nelson + */ + +/ { + cpus { + cpu@0 { + cpu0-supply = <&dcdc2_reg>; + }; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x20000000>; /* 512 MB */ + }; +}; + +&cpu0_opp_table { + /* + * Octavo Systems: + * The EFUSE_SMA register is not programmed for any of the AM335x wafers + * we get and we are not programming them during our production test. + * Therefore, from a DEVICE_ID revision point of view, the silicon looks + * like it is Revision 2.1. However, from an EFUSE_SMA point of view for + * the HW OPP table, the silicon looks like it is Revision 1.0 (ie the + * EFUSE_SMA register reads as all zeros). + */ + oppnitro-1000000000 { + opp-supported-hw = <0x06 0x0100>; + }; +}; + +&am33xx_pinmux { + i2c0_pins: pinmux-i2c0-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* (C17) I2C0_SDA.I2C0_SDA */ + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* (C16) I2C0_SCL.I2C0_SCL */ + >; + }; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + + status = "okay"; + clock-frequency = <400000>; + + tps: tps@24 { + reg = <0x24>; + }; +}; + +/include/ "tps65217.dtsi" + +&tps { + interrupts = <7>; /* NMI */ + interrupt-parent = <&intc>; + + ti,pmic-shutdown-controller; + + pwrbutton { + interrupts = <2>; + status = "okay"; + }; + + regulators { + dcdc1_reg: regulator@0 { + regulator-name = "vdds_dpr"; + regulator-always-on; + }; + + dcdc2_reg: regulator@1 { + /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */ + regulator-name = "vdd_mpu"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1351500>; + regulator-boot-on; + regulator-always-on; + }; + + dcdc3_reg: regulator@2 { + /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */ + regulator-name = "vdd_core"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo1_reg: regulator@3 { + regulator-name = "vio,vrtc,vdds"; + regulator-always-on; + }; + + ldo2_reg: regulator@4 { + regulator-name = "vdd_3v3aux"; + regulator-always-on; + }; + + ldo3_reg: regulator@5 { + regulator-name = "vdd_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + ldo4_reg: regulator@6 { + regulator-name = "vdd_3v3a"; + regulator-always-on; + }; + }; +}; + +&aes { + status = "okay"; +}; + +&sham { + status = "okay"; +}; Copied: head/sys/gnu/dts/arm/am335x-pocketbeagle.dts (from r337701, vendor/device-tree/dist/src/arm/am335x-pocketbeagle.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am335x-pocketbeagle.dts Mon Aug 13 06:40:20 2018 (r337703, copy of r337701, vendor/device-tree/dist/src/arm/am335x-pocketbeagle.dts) @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * + * Author: Robert Nelson + */ +/dts-v1/; + +#include "am33xx.dtsi" +#include "am335x-osd335x-common.dtsi" + +/ { + model = "TI AM335x PocketBeagle"; + compatible = "ti,am335x-pocketbeagle", "ti,am335x-bone", "ti,am33xx"; + + chosen { + stdout-path = &uart0; + }; + + leds { + pinctrl-names = "default"; + pinctrl-0 = <&usr_leds_pins>; + + compatible = "gpio-leds"; + + usr0 { + label = "beaglebone:green:usr0"; + gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + + usr1 { + label = "beaglebone:green:usr1"; + gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + + usr2 { + label = "beaglebone:green:usr2"; + gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "cpu0"; + default-state = "off"; + }; + + usr3 { + label = "beaglebone:green:usr3"; + gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + vmmcsd_fixed: fixedregulator0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; +}; + +&am33xx_pinmux { + i2c2_pins: pinmux-i2c2-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3) /* (D17) uart1_rtsn.I2C2_SCL */ + AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3) /* (D18) uart1_ctsn.I2C2_SDA */ + >; + }; + + ehrpwm0_pins: pinmux-ehrpwm0-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x990, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* (A13) mcasp0_aclkx.ehrpwm0A */ + >; + }; + + ehrpwm1_pins: pinmux-ehrpwm1-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* (U14) gpmc_a2.ehrpwm1A */ + >; + }; + + mmc0_pins: pinmux-mmc0-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* (C15) spi0_cs1.gpio0[6] */ + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* (G16) mmc0_dat0.mmc0_dat0 */ + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* (G15) mmc0_dat1.mmc0_dat1 */ + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* (F18) mmc0_dat2.mmc0_dat2 */ + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* (F17) mmc0_dat3.mmc0_dat3 */ + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* (G18) mmc0_cmd.mmc0_cmd */ + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* (G17) mmc0_clk.mmc0_clk */ + AM33XX_IOPAD(0x9a0, PIN_INPUT | MUX_MODE4) /* (B12) mcasp0_aclkr.mmc0_sdwp */ + >; + }; + + spi0_pins: pinmux-spi0-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0) /* (A17) spi0_sclk.spi0_sclk */ + AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0) /* (B17) spi0_d0.spi0_d0 */ + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* (B16) spi0_d1.spi0_d1 */ + AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0) /* (A16) spi0_cs0.spi0_cs0 */ + >; + }; + + spi1_pins: pinmux-spi1-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x964, PIN_INPUT_PULLUP | MUX_MODE4) /* (C18) eCAP0_in_PWM0_out.spi1_sclk */ + AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE4) /* (E18) uart0_ctsn.spi1_d0 */ + AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE4) /* (E17) uart0_rtsn.spi1_d1 */ + AM33XX_IOPAD(0x9b0, PIN_INPUT_PULLUP | MUX_MODE4) /* (A15) xdma_event_intr0.spi1_cs1 */ + >; + }; + + usr_leds_pins: pinmux-usr-leds-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x854, PIN_OUTPUT | MUX_MODE7) /* (V15) gpmc_a5.gpio1[21] - USR_LED_0 */ + AM33XX_IOPAD(0x858, PIN_OUTPUT | MUX_MODE7) /* (U15) gpmc_a6.gpio1[22] - USR_LED_1 */ + AM33XX_IOPAD(0x85c, PIN_OUTPUT | MUX_MODE7) /* (T15) gpmc_a7.gpio1[23] - USR_LED_2 */ + AM33XX_IOPAD(0x860, PIN_OUTPUT | MUX_MODE7) /* (V16) gpmc_a8.gpio1[24] - USR_LED_3 */ + >; + }; + + uart0_pins: pinmux-uart0-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* (E15) uart0_rxd.uart0_rxd */ + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (E16) uart0_txd.uart0_txd */ + >; + }; + + uart4_pins: pinmux-uart4-pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6) /* (T17) gpmc_wait0.uart4_rxd */ + AM33XX_IOPAD(0x874, PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* (U17) gpmc_wpn.uart4_txd */ + >; + }; +}; + +&epwmss0 { + status = "okay"; +}; + +&ehrpwm0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&ehrpwm0_pins>; +}; + +&epwmss1 { + status = "okay"; +}; + +&ehrpwm1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&ehrpwm1_pins>; +}; + +&i2c0 { + eeprom: eeprom@50 { + compatible = "atmel,24c256"; + reg = <0x50>; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + + status = "okay"; + clock-frequency = <400000>; +}; + +&mmc1 { + status = "okay"; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; +}; + +&rtc { + system-power-controller; +}; + +&tscadc { + status = "okay"; + adc { + ti,adc-channels = <0 1 2 3 4 5 6 7>; + ti,chan-step-avg = <16 16 16 16 16 16 16 16>; + ti,chan-step-opendelay = <0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98>; + ti,chan-step-sampledelay = <0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0>; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + + status = "okay"; +}; + +&uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&uart4_pins>; + + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "otg"; +}; + +&usb1_phy { + status = "okay"; +}; + +&usb1 { + status = "okay"; + dr_mode = "host"; +}; + +&cppi41dma { + status = "okay"; +}; Modified: head/sys/gnu/dts/arm/am3517-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am3517-evm.dts Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am3517-evm.dts Mon Aug 13 06:40:20 2018 (r337703) @@ -8,11 +8,17 @@ /dts-v1/; #include "am3517.dtsi" +#include "am3517-som.dtsi" +#include / { model = "TI AM3517 EVM (AM3517/05 TMDSEVM3517)"; compatible = "ti,am3517-evm", "ti,am3517", "ti,omap3"; + aliases { + display0 = &lcd0; + }; + memory@80000000 { device_type = "memory"; reg = <0x80000000 0x10000000>; /* 256 MB */ @@ -24,6 +30,144 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; }; + + gpio-keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + user_pb { + label = "User Push Button"; + linux,code = ; + gpios = <&tca6416 5 GPIO_ACTIVE_LOW>; + }; + + user_sw_1 { + label = "User Switch 1"; + linux,code = ; + gpios = <&tca6416 8 GPIO_ACTIVE_LOW>; + }; + + user_sw_2 { + label = "User Switch 2"; + linux,code = ; + gpios = <&tca6416 9 GPIO_ACTIVE_LOW>; + }; + + user_sw_3 { + label = "User Switch 3"; + linux,code = ; + gpios = <&tca6416 10 GPIO_ACTIVE_LOW>; + }; + + user_sw_4 { + label = "User Switch 4"; + linux,code = ; + gpios = <&tca6416 11 GPIO_ACTIVE_LOW>; + }; + + user_sw_5 { + label = "User Switch 5"; + linux,code = ; + gpios = <&tca6416 12 GPIO_ACTIVE_LOW>; + }; + + user_sw_6 { + label = "User Switch 6"; + linux,code = ; + gpios = <&tca6416 13 GPIO_ACTIVE_LOW>; + }; + + user_sw_7 { + label = "User Switch 7"; + linux,code = ; + gpios = <&tca6416 14 GPIO_ACTIVE_LOW>; + }; + + user_sw_8 { + label = "User Switch 8"; + linux,code = ; + gpios = <&tca6416 15 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&leds_pins>; + + user_led_1 { + label = "am3517evm:green:user_led_1"; + gpios = <&tca6416 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + user_led_2 { + label = "am3517evm:green:user_led_2"; + gpios = <&tca6416 6 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + user_led_3 { + label = "am3517evm:green:user_led_3"; + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; /* SD/MMC card activity */ + }; + + user_led_4 { + label = "am3517evm:green:user_led_4"; + gpios = <&gpio1 31 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + }; + + lcd0: display@0 { + compatible = "panel-dpi"; + label = "15"; + status = "okay"; + pinctrl-names = "default"; + enable-gpios = <&gpio6 16 GPIO_ACTIVE_HIGH>; /* gpio176, lcd INI */ + + port { + lcd_in: endpoint { + remote-endpoint = <&dpi_out>; + }; + }; + + panel-timing { + clock-frequency = <9000000>; + hactive = <480>; + vactive = <272>; + hfront-porch = <3>; + hback-porch = <2>; + hsync-len = <42>; + vback-porch = <3>; + vfront-porch = <4>; + vsync-len = <11>; + hsync-active = <0>; + vsync-active = <0>; + de-active = <1>; + pixelclk-active = <1>; + }; + }; + + bl: backlight { + compatible = "pwm-backlight"; + pinctrl-names = "default"; + pinctrl-0 = <&backlight_pins>; + pwms = <&pwm11 0 5000000 0>; + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; + default-brightness-level = <7>; + enable-gpios = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* gpio_182 */ + }; + + pwm11: dmtimer-pwm@11 { + compatible = "ti,omap-dmtimer-pwm"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins>; + ti,timers = <&timer11>; + #pwm-cells = <3>; + }; }; &davinci_emac { @@ -34,12 +178,32 @@ status = "okay"; }; -&i2c1 { - clock-frequency = <400000>; +&dss { + status = "ok"; + + pinctrl-names = "default"; + pinctrl-0 = <&dss_dpi_pins>; + + vdds_dsi-supply = <&vdd_io_reg>; + vdda_video-supply = <&vdd_io_reg>; + + port { + dpi_out: endpoint { + remote-endpoint = <&lcd_in>; + data-lines = <16>; + }; + }; }; &i2c2 { clock-frequency = <400000>; + /* User DIP swithes [1:8] / User LEDS [1:2] */ + tca6416: gpio@21 { + compatible = "ti,tca6416"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + }; }; &i2c3 { @@ -47,8 +211,13 @@ }; &mmc1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; vmmc-supply = <&vmmc_fixed>; bus-width = <4>; + wp-gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>; /* gpio_126 */ + cd-gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>; /* gpio_127 */ }; &mmc2 { @@ -59,3 +228,63 @@ status = "disabled"; }; +&omap3_pmx_core { + + leds_pins: pinmux_leds_pins { + pinctrl-single,pins = < + OMAP3_WKUP_IOPAD(0x2a24, PIN_OUTPUT_PULLUP | MUX_MODE4) /* jtag_emu0.gpio_11 */ + OMAP3_WKUP_IOPAD(0x2a26, PIN_OUTPUT_PULLUP | MUX_MODE4) /* jtag_emu1.gpio_31 */ + >; + }; + + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x2144, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */ + OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_cmd.sdmmc1_cmd */ + OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat0.sdmmc1_dat0 */ + OMAP3_CORE1_IOPAD(0x214a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */ + OMAP3_CORE1_IOPAD(0x214c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */ + OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */ + OMAP3_CORE1_IOPAD(0x2150, PIN_INPUT_PULLUP | MUX_MODE4) /* sdmmc1_dat4.gpio_126 */ + OMAP3_CORE1_IOPAD(0x2152, PIN_INPUT_PULLUP | MUX_MODE4) /* sdmmc1_dat5.gpio_127 */ + >; + }; + + pwm_pins: pinmux_pwm_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x21dc, PIN_OUTPUT | MUX_MODE1) /* mcspi2_cs0.gpt11_pwm */ + >; + }; + + backlight_pins: pinmux_backlight_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x21de, PIN_OUTPUT | MUX_MODE4) /* mcspi2_cs1.gpio_182 */ + >; + }; + + dss_dpi_pins: pinmux_dss_dpi_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x21d2, PIN_OUTPUT | MUX_MODE4) /* mcspi1_cs2.gpio_176 */ + OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */ + OMAP3_CORE1_IOPAD(0x20d6, PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */ + OMAP3_CORE1_IOPAD(0x20d8, PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */ + OMAP3_CORE1_IOPAD(0x20da, PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */ + OMAP3_CORE1_IOPAD(0x20dc, PIN_OUTPUT | MUX_MODE0) /* dss_data0.dss_data0 */ + OMAP3_CORE1_IOPAD(0x20de, PIN_OUTPUT | MUX_MODE0) /* dss_data1.dss_data1 */ + OMAP3_CORE1_IOPAD(0x20e0, PIN_OUTPUT | MUX_MODE0) /* dss_data2.dss_data2 */ + OMAP3_CORE1_IOPAD(0x20e2, PIN_OUTPUT | MUX_MODE0) /* dss_data3.dss_data3 */ + OMAP3_CORE1_IOPAD(0x20e4, PIN_OUTPUT | MUX_MODE0) /* dss_data4.dss_data4 */ + OMAP3_CORE1_IOPAD(0x20e6, PIN_OUTPUT | MUX_MODE0) /* dss_data5.dss_data5 */ + OMAP3_CORE1_IOPAD(0x20e8, PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */ + OMAP3_CORE1_IOPAD(0x20ea, PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */ + OMAP3_CORE1_IOPAD(0x20ec, PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */ + OMAP3_CORE1_IOPAD(0x20ee, PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */ + OMAP3_CORE1_IOPAD(0x20f0, PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */ + OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */ + OMAP3_CORE1_IOPAD(0x20f4, PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */ + OMAP3_CORE1_IOPAD(0x20f6, PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */ + OMAP3_CORE1_IOPAD(0x20f8, PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */ + OMAP3_CORE1_IOPAD(0x20fa, PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */ + >; + }; +}; Copied: head/sys/gnu/dts/arm/am3517-som.dtsi (from r337701, vendor/device-tree/dist/src/arm/am3517-som.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am3517-som.dtsi Mon Aug 13 06:40:20 2018 (r337703, copy of r337701, vendor/device-tree/dist/src/arm/am3517-som.dtsi) @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2016 Derald D. Woods + * + * Based on am3517-evm.dts + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/ { + cpus { + cpu@0 { + cpu0-supply = <&vdd_core_reg>; + }; + }; +}; + +&gpmc { + ranges = <0 0 0x30000000 0x1000000>; /* CS0: 16MB for NAND */ + + nand@0,0 { + compatible = "ti,omap2-nand"; + linux,mtd-name = "micron,mt29f4g16abchch"; + reg = <0 0 4>; /* CS0, offset 0, IO size 4 */ + nand-bus-width = <16>; + ti,nand-ecc-opt = "bch8"; + gpmc,sync-clk-ps = <0>; + gpmc,cs-on-ns = <0>; + gpmc,cs-rd-off-ns = <44>; + gpmc,cs-wr-off-ns = <44>; + gpmc,adv-on-ns = <6>; + gpmc,adv-rd-off-ns = <34>; + gpmc,adv-wr-off-ns = <44>; + gpmc,we-off-ns = <40>; + gpmc,oe-off-ns = <54>; + gpmc,access-ns = <64>; + gpmc,rd-cycle-ns = <82>; + gpmc,wr-cycle-ns = <82>; + gpmc,wr-access-ns = <40>; + gpmc,wr-data-mux-bus-ns = <0>; + gpmc,device-width = <2>; + #address-cells = <1>; + #size-cells = <1>; + }; +}; + +&i2c1 { + clock-frequency = <400000>; + + s35390a: s35390a@30 { + compatible = "sii,s35390a"; + reg = <0x30>; + + pinctrl-names = "default"; + pinctrl-0 = <&rtc_pins>; + interrupts-extended = <&gpio2 23 IRQ_TYPE_EDGE_FALLING>; /* gpio_55 */ + }; + + tps: tps65023@48 { + compatible = "ti,tps65023"; + reg = <0x48>; + + regulators { + vdd_core_reg: VDCDC1 { + regulator-name = "vdd_core"; + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + }; + + vdd_io_reg: VDCDC2 { + regulator-name = "vdd_io"; + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + vdd_1v8_reg: VDCDC3 { + regulator-name = "vdd_1v8"; + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + vdd_usb18_reg: LDO1 { + regulator-name = "vdd_usb18"; + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + vdd_usb33_reg: LDO2 { + regulator-name = "vdd_usb33"; + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + }; + }; + + touchscreen: tsc2004@4b { + compatible = "ti,tsc2004"; + reg = <0x4b>; + + vio-supply = <&vdd_io_reg>; + + pinctrl-names = "default"; + pinctrl-0 = <&tsc2004_pins>; + interrupts-extended = <&gpio3 1 IRQ_TYPE_EDGE_RISING>; /* gpio_65 */ + + touchscreen-fuzz-x = <4>; + touchscreen-fuzz-y = <7>; + touchscreen-fuzz-pressure = <2>; + touchscreen-size-x = <480>; + touchscreen-size-y = <272>; + touchscreen-max-pressure = <2048>; + + ti,x-plate-ohms = <280>; + ti,esd-recovery-timeout-ms = <8000>; + }; +}; + +&omap3_pmx_core { + + rtc_pins: pinmux_rtc_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x20b6, PIN_INPUT_PULLUP | MUX_MODE4) /* gpmc_ncs4.gpio_55 */ + >; + }; + + tsc2004_pins: pinmux_tsc2004_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x20d2, PIN_INPUT | MUX_MODE4) /* gpmc_wait3.gpio_65 */ + >; + }; +}; Modified: head/sys/gnu/dts/arm/am3517.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am3517.dtsi Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am3517.dtsi Mon Aug 13 06:40:20 2018 (r337703) @@ -39,6 +39,8 @@ ti,davinci-ctrl-ram-size = <0x2000>; ti,davinci-rmii-en = /bits/ 8 <1>; local-mac-address = [ 00 00 00 00 00 00 ]; + clocks = <&emac_ick>; + clock-names = "ick"; }; davinci_mdio: ethernet@5c030000 { @@ -49,6 +51,8 @@ bus_freq = <1000000>; #address-cells = <1>; #size-cells = <0>; + clocks = <&emac_fck>; + clock-names = "fck"; }; uart4: serial@4809e000 { @@ -85,6 +89,11 @@ clocks = <&hecc_ck>; }; }; +}; + +/* Table Table 5-79 of the TRM shows 480ab000 is reserved */ +&usb_otg_hs { + status = "disabled"; }; &iva { Modified: head/sys/gnu/dts/arm/am437x-cm-t43.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-cm-t43.dts Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am437x-cm-t43.dts Mon Aug 13 06:40:20 2018 (r337703) @@ -203,7 +203,7 @@ tps65218: tps65218@24 { compatible = "ti,tps65218"; reg = <0x24>; - interrupts = ; /* NMIn */ + interrupts = ; /* NMIn */ interrupt-parent = <&gic>; interrupt-controller; #interrupt-cells = <2>; Modified: head/sys/gnu/dts/arm/am437x-gp-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-gp-evm.dts Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am437x-gp-evm.dts Mon Aug 13 06:40:20 2018 (r337703) @@ -543,7 +543,7 @@ tps65218: tps65218@24 { reg = <0x24>; compatible = "ti,tps65218"; - interrupts = ; /* NMIn */ + interrupts = ; /* NMIn */ interrupt-controller; #interrupt-cells = <2>; Modified: head/sys/gnu/dts/arm/am437x-sk-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-sk-evm.dts Mon Aug 13 05:54:42 2018 (r337702) +++ head/sys/gnu/dts/arm/am437x-sk-evm.dts Mon Aug 13 06:40:20 2018 (r337703) @@ -15,6 +15,7 @@ #include #include #include +#include / { model = "TI AM437x SK EVM"; @@ -158,6 +159,22 @@ }; }; }; + + vmmcwl_fixed: fixedregulator-mmcwl { + /* + * WL_EN is not SDIO standard compliant. It is an out of band + * signal and hard to be dealt with in a standard way by the + * SDIO core driver. + * So modelling the WL_EN line as a regulator was a natural + * choice as the MMC core already deals with MMC supplies. + */ + compatible = "regulator-fixed"; + regulator-name = "vmmcwl_fixed"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&gpio4 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &am43xx_pinmux { @@ -418,6 +435,62 @@ AM4372_IOPAD(0xac4, PIN_OUTPUT | MUX_MODE0) /* usb0_drvvbus.usb0_drvvbus */ >; }; + + mmc3_pins_default: pinmux_mmc3_pins_default { + pinctrl-single,pins = < + AM4372_IOPAD(0x9f0, PIN_INPUT_PULLUP | MUX_MODE3) /* (AD21) cam1_data2.mmc2_clk */ + AM4372_IOPAD(0x9f4, PIN_INPUT_PULLUP | MUX_MODE3) /* (AE22) cam1_data3.mmc2_cmd */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 13 07:28:26 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 B34D01068A7E; Mon, 13 Aug 2018 07:28:26 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 575008E227; Mon, 13 Aug 2018 07:28:26 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32D7E1762; Mon, 13 Aug 2018 07:28:26 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7D7SQqw029126; Mon, 13 Aug 2018 07:28:26 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D7SP8U029124; Mon, 13 Aug 2018 07:28:25 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201808130728.w7D7SP8U029124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 13 Aug 2018 07:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337704 - in head/sys/dev/usb: . net X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys/dev/usb: . net X-SVN-Commit-Revision: 337704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 07:28:26 -0000 Author: mmel Date: Mon Aug 13 07:28:25 2018 New Revision: 337704 URL: https://svnweb.freebsd.org/changeset/base/337704 Log: Add USB ID for rebranded RTL8153 found on NVIDIA Jetson TX1 board. MFC after: 3 days Modified: head/sys/dev/usb/net/if_ure.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_ure.c ============================================================================== --- head/sys/dev/usb/net/if_ure.c Mon Aug 13 06:40:20 2018 (r337703) +++ head/sys/dev/usb/net/if_ure.c Mon Aug 13 07:28:25 2018 (r337704) @@ -68,6 +68,7 @@ SYSCTL_INT(_hw_usb_ure, OID_AUTO, debug, CTLFLAG_RWTUN static const STRUCT_USB_HOST_ID ure_devs[] = { #define URE_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } URE_DEV(LENOVO, RTL8153, 0), + URE_DEV(NVIDIA, RTL8153, 0), URE_DEV(REALTEK, RTL8152, URE_FLAG_8152), URE_DEV(REALTEK, RTL8153, 0), URE_DEV(TPLINK, RTL8153, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Aug 13 06:40:20 2018 (r337703) +++ head/sys/dev/usb/usbdevs Mon Aug 13 07:28:25 2018 (r337704) @@ -467,6 +467,7 @@ vendor PLEXTOR 0x093b Plextor vendor INTREPIDCS 0x093c Intrepid vendor YANO 0x094f Yano vendor KINGSTON 0x0951 Kingston Technology +vendor NVIDIA 0x0955 NVIDIA Corporation vendor BLUEWATER 0x0956 BlueWater Systems vendor AGILENT 0x0957 Agilent Technologies vendor GUDE 0x0959 Gude ADS @@ -3455,6 +3456,9 @@ product NOVATEL MC760 0x6002 Novatel MC760 product NOVATEL MC547 0x7042 Novatel MC547 product NOVATEL MC679 0x7031 Novatel MC679 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver + +/* NVIDIA products */ +product NVIDIA RTL8153 0x09ff USB 3.0 Ethernet /* Merlin products */ product MERLIN V620 0x1110 Merlin V620 From owner-svn-src-all@freebsd.org Mon Aug 13 08:47:55 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 AFE8B106A9E3; Mon, 13 Aug 2018 08:47:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65222705E3; Mon, 13 Aug 2018 08:47:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C173240D; Mon, 13 Aug 2018 08:47:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7D8lskW070002; Mon, 13 Aug 2018 08:47:54 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7D8lshj070000; Mon, 13 Aug 2018 08:47:54 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201808130847.w7D8lshj070000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 13 Aug 2018 08:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337705 - stable/11/sys/dev/extres/regulator X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/11/sys/dev/extres/regulator X-SVN-Commit-Revision: 337705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 08:47:55 -0000 Author: mmel Date: Mon Aug 13 08:47:54 2018 New Revision: 337705 URL: https://svnweb.freebsd.org/changeset/base/337705 Log: MFC r335249: Fix handling of enable counter for shared GPIO line in fixed regulator. Modified: stable/11/sys/dev/extres/regulator/regnode_if.m stable/11/sys/dev/extres/regulator/regulator.c stable/11/sys/dev/extres/regulator/regulator_fixed.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/extres/regulator/regnode_if.m ============================================================================== --- stable/11/sys/dev/extres/regulator/regnode_if.m Mon Aug 13 07:28:25 2018 (r337704) +++ stable/11/sys/dev/extres/regulator/regnode_if.m Mon Aug 13 08:47:54 2018 (r337705) @@ -31,6 +31,15 @@ HEADER { struct regnode; } +CODE { + static int + regnode_default_stop(struct regnode *regnode, int *udelay) + { + + return(REGNODE_ENABLE(regnode, false, udelay)); + } +} + # # Initialize regulator # Returns 0 on success or a standard errno value. @@ -80,3 +89,12 @@ METHOD int get_voltage { struct regnode *regnode; int *uvolt; }; + +# +# Stop (shutdown) regulator +# Returns 0 on success or a standard errno value. +# +METHOD int stop { + struct regnode *regnode; + int *udelay; +} DEFAULT regnode_default_stop; Modified: stable/11/sys/dev/extres/regulator/regulator.c ============================================================================== --- stable/11/sys/dev/extres/regulator/regulator.c Mon Aug 13 07:28:25 2018 (r337704) +++ stable/11/sys/dev/extres/regulator/regulator.c Mon Aug 13 08:47:54 2018 (r337705) @@ -515,7 +515,7 @@ regnode_stop(struct regnode *regnode, int depth) /* Disable regulator for each node in chain, starting from consumer */ if ((regnode->enable_cnt == 0) && ((regnode->flags & REGULATOR_FLAGS_NOT_DISABLE) == 0)) { - rv = REGNODE_ENABLE(regnode, false, &udelay); + rv = REGNODE_STOP(regnode, &udelay); if (rv != 0) { REGNODE_UNLOCK(regnode); return (rv); @@ -527,7 +527,7 @@ regnode_stop(struct regnode *regnode, int depth) rv = regnode_resolve_parent(regnode); if (rv != 0) return (rv); - if (regnode->parent != NULL) + if (regnode->parent != NULL && regnode->parent->enable_cnt == 0) rv = regnode_stop(regnode->parent, depth + 1); return (rv); } Modified: stable/11/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- stable/11/sys/dev/extres/regulator/regulator_fixed.c Mon Aug 13 07:28:25 2018 (r337704) +++ stable/11/sys/dev/extres/regulator/regulator_fixed.c Mon Aug 13 08:47:54 2018 (r337705) @@ -56,6 +56,7 @@ struct gpio_entry { struct gpiobus_pin gpio_pin; int use_cnt; int enable_cnt; + bool always_on; }; static gpio_list_t gpio_list = TAILQ_HEAD_INITIALIZER(gpio_list); static struct mtx gpio_list_mtx; @@ -71,12 +72,14 @@ static int regnode_fixed_init(struct regnode *regnode) static int regnode_fixed_enable(struct regnode *regnode, bool enable, int *udelay); static int regnode_fixed_status(struct regnode *regnode, int *status); +static int regnode_fixed_stop(struct regnode *regnode, int *udelay); static regnode_method_t regnode_fixed_methods[] = { /* Regulator interface */ REGNODEMETHOD(regnode_init, regnode_fixed_init), REGNODEMETHOD(regnode_enable, regnode_fixed_enable), REGNODEMETHOD(regnode_status, regnode_fixed_status), + REGNODEMETHOD(regnode_stop, regnode_fixed_stop), REGNODEMETHOD_END }; DEFINE_CLASS_1(regnode_fixed, regnode_fixed_class, regnode_fixed_methods, @@ -188,8 +191,6 @@ regnode_fixed_enable(struct regnode *regnode, bool ena dev = regnode_get_device(regnode); *udelay = 0; - if (sc->param->always_on && !enable) - return (0); if (sc->gpio_entry == NULL) return (0); pin = &sc->gpio_entry->gpio_pin; @@ -204,6 +205,8 @@ regnode_fixed_enable(struct regnode *regnode, bool ena if (sc->gpio_entry->enable_cnt >= 1) return (0); } + if (sc->gpio_entry->always_on && !enable) + return (0); if (!sc->param->enable_active_high) enable = !enable; rv = GPIO_PIN_SET(pin->dev, pin->pin, enable); @@ -215,7 +218,43 @@ regnode_fixed_enable(struct regnode *regnode, bool ena return (0); } +/* + * Stop (physicaly shutdown) regulator. + * Take shared GPIO pins in account + */ static int +regnode_fixed_stop(struct regnode *regnode, int *udelay) +{ + device_t dev; + struct regnode_fixed_sc *sc; + struct gpiobus_pin *pin; + int rv; + + sc = regnode_get_softc(regnode); + dev = regnode_get_device(regnode); + + *udelay = 0; + if (sc->gpio_entry == NULL) + return (0); + if (sc->gpio_entry->always_on) + return (0); + pin = &sc->gpio_entry->gpio_pin; + if (sc->gpio_entry->enable_cnt > 0) { + /* Other regulator(s) are enabled. */ + /* XXXX Any diagnostic message? Or error? */ + return (0); + } + rv = GPIO_PIN_SET(pin->dev, pin->pin, + sc->param->enable_active_high ? false: true); + if (rv != 0) { + device_printf(dev, "Cannot set GPIO pin: %d\n", pin->pin); + return (rv); + } + *udelay = sc->param->enable_delay; + return (0); +} + +static int regnode_fixed_status(struct regnode *regnode, int *status) { struct regnode_fixed_sc *sc; @@ -264,6 +303,10 @@ regnode_fixed_register(device_t dev, struct regnode_fi device_printf(dev, "Cannot register regulator.\n"); return(ENXIO); } + + if (sc->gpio_entry != NULL) + sc->gpio_entry->always_on |= sc->param->always_on; + return (0); } From owner-svn-src-all@freebsd.org Mon Aug 13 11:56: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 CCD2D106FE23; Mon, 13 Aug 2018 11:56:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8281475F04; Mon, 13 Aug 2018 11:56:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BD0C46EE; Mon, 13 Aug 2018 11:56:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DBuNwA066845; Mon, 13 Aug 2018 11:56:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DBuMiY066804; Mon, 13 Aug 2018 11:56:22 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201808131156.w7DBuMiY066804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 13 Aug 2018 11:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337706 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 11:56:24 -0000 Author: tuexen Date: Mon Aug 13 11:56:21 2018 New Revision: 337706 URL: https://svnweb.freebsd.org/changeset/base/337706 Log: Use consistently the macors to modify the assoc state. No functional change. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Aug 13 08:47:54 2018 (r337705) +++ head/sys/netinet/sctp_indata.c Mon Aug 13 11:56:21 2018 (r337706) @@ -4329,9 +4329,9 @@ again: /* clean up */ if ((asoc->stream_queue_cnt == 1) && ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (asoc->state & SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && @@ -5026,9 +5026,9 @@ hopeless_peer: /* clean up */ if ((asoc->stream_queue_cnt == 1) && ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (asoc->state & SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Aug 13 08:47:54 2018 (r337705) +++ head/sys/netinet/sctp_input.c Mon Aug 13 11:56:21 2018 (r337706) @@ -742,8 +742,7 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); - stcb->asoc.state &= ~SCTP_STATE_COOKIE_ECHOED; - stcb->asoc.state |= SCTP_STATE_COOKIE_WAIT; + SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_toss_old_cookies(stcb, &stcb->asoc); stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); @@ -840,7 +839,7 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif - stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; + SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_WAS_ABORTED); (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -1266,8 +1265,7 @@ sctp_handle_error(struct sctp_chunkhdr *ch, } /* blast back to INIT state */ sctp_toss_old_cookies(stcb, &stcb->asoc); - asoc->state &= ~SCTP_STATE_COOKIE_ECHOED; - asoc->state |= SCTP_STATE_COOKIE_WAIT; + SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); } @@ -1418,7 +1416,7 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int o return (-1); } /* process according to association state... */ - switch (stcb->asoc.state & SCTP_STATE_MASK) { + switch (SCTP_GET_STATE(&stcb->asoc)) { case SCTP_STATE_COOKIE_WAIT: /* this is the expected state for this chunk */ /* process the INIT-ACK parameters */ @@ -1841,8 +1839,8 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle asoc->cookie_how[how_indx] = 10; return (NULL); } - if ((asoc->state & SCTP_STATE_COOKIE_WAIT) || - (asoc->state & SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { *notification = SCTP_NOTIFY_ASSOC_UP; if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || @@ -1955,7 +1953,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); - } else if (!(asoc->state & SCTP_STATE_SHUTDOWN_SENT)) { + } else if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) { /* move to OPEN state, if not in SHUTDOWN_SENT */ SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); } @@ -2883,7 +2881,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in * the accept state waiting for the accept! */ if (*stcb) { - (*stcb)->asoc.state |= SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_ADD_SUBSTATE(&(*stcb)->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); } sctp_move_pcb_and_assoc(*inp_p, inp, *stcb); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Aug 13 08:47:54 2018 (r337705) +++ head/sys/netinet/sctp_output.c Mon Aug 13 11:56:21 2018 (r337706) @@ -6734,9 +6734,9 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } - asoc->state |= SCTP_STATE_SHUTDOWN_PENDING; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { @@ -7856,7 +7856,7 @@ sctp_med_chunk_output(struct sctp_inpcb *inp, *reason_code = 0; auth_keyid = stcb->asoc.authinfo.active_keyid; if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (asoc->state & SCTP_STATE_SHUTDOWN_RECEIVED) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR))) { eeor_mode = 1; } else { @@ -8664,7 +8664,7 @@ again_one_more_time: chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; } if (SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) && - ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) == SCTP_STATE_SHUTDOWN_PENDING)) { + (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { struct sctp_data_chunk *dchkh; dchkh = mtod(chk->data, struct sctp_data_chunk *); @@ -13539,9 +13539,9 @@ dataless_eof: hold_tcblock = 1; } if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } - asoc->state |= SCTP_STATE_SHUTDOWN_PENDING; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Aug 13 08:47:54 2018 (r337705) +++ head/sys/netinet/sctp_pcb.c Mon Aug 13 11:56:21 2018 (r337706) @@ -3373,7 +3373,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, * was not closed. So go ahead and * start it now. */ - asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); } SCTP_TCB_UNLOCK(asoc); @@ -3397,7 +3397,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, } /* Disconnect the socket please */ asoc->sctp_socket = NULL; - asoc->asoc.state |= SCTP_STATE_CLOSED_SOCKET; + SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_CLOSED_SOCKET); if ((asoc->asoc.size_on_reasm_queue > 0) || (asoc->asoc.control_pdapi) || (asoc->asoc.size_on_all_streams > 0) || @@ -3453,11 +3453,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, } } else { /* mark into shutdown pending */ - asoc->asoc.state |= SCTP_STATE_SHUTDOWN_PENDING; + SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, asoc->sctp_ep, asoc, asoc->asoc.primary_destination); if ((*asoc->asoc.ss_functions.sctp_ss_is_user_msgs_incomplete) (asoc, &asoc->asoc)) { - asoc->asoc.state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (TAILQ_EMPTY(&asoc->asoc.send_queue) && TAILQ_EMPTY(&asoc->asoc.sent_queue) && @@ -3518,7 +3518,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, SCTP_TCB_LOCK(asoc); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { - asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); } cnt++; @@ -4803,7 +4803,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc } /* Now the read queue needs to be cleaned up (only once) */ if ((stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0) { - stcb->asoc.state |= SCTP_STATE_ABOUT_TO_BE_FREED; + SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_ABOUT_TO_BE_FREED); SCTP_INP_READ_LOCK(inp); TAILQ_FOREACH(sq, &inp->read_queue, next) { if (sq->stcb == stcb) { @@ -4857,7 +4857,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc if ((stcb->asoc.refcnt) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { - stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); } SCTP_TCB_UNLOCK(stcb); @@ -4939,7 +4939,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc atomic_add_int(&stcb->asoc.refcnt, -1); } if (stcb->asoc.refcnt) { - stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); if (from_inpcbfree == SCTP_NORMAL_PROC) { SCTP_INP_INFO_WUNLOCK(); @@ -6277,7 +6277,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * assoc? straighten out locks. */ if (stcb_tmp) { - if (SCTP_GET_STATE(&stcb_tmp->asoc) & SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(&stcb_tmp->asoc) == SCTP_STATE_COOKIE_WAIT) { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; @@ -6377,7 +6377,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * assoc? straighten out locks. */ if (stcb_tmp) { - if (SCTP_GET_STATE(&stcb_tmp->asoc) & SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(&stcb_tmp->asoc) == SCTP_STATE_COOKIE_WAIT) { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon Aug 13 08:47:54 2018 (r337705) +++ head/sys/netinet/sctp_usrreq.c Mon Aug 13 11:56:21 2018 (r337706) @@ -773,11 +773,11 @@ sctp_disconnect(struct socket *so) netp = stcb->asoc.primary_destination; } - asoc->state |= SCTP_STATE_SHUTDOWN_PENDING; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && @@ -7222,7 +7222,7 @@ sctp_accept(struct socket *so, struct sockaddr **addr) SCTP_TCB_LOCK(stcb); SCTP_INP_RUNLOCK(inp); store = stcb->asoc.primary_destination->ro._l_addr; - stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); SCTP_TCB_UNLOCK(stcb); switch (store.sa.sa_family) { #ifdef INET Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Aug 13 08:47:54 2018 (r337705) +++ head/sys/netinet/sctputil.c Mon Aug 13 11:56:21 2018 (r337706) @@ -3698,8 +3698,8 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb if (stcb->sctp_socket->so_rcv.sb_state & SBS_CANTRCVMORE) { return; } - if ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || - (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { if ((notification == SCTP_NOTIFY_INTERFACE_DOWN) || (notification == SCTP_NOTIFY_INTERFACE_UP) || (notification == SCTP_NOTIFY_INTERFACE_CONFIRMED)) { @@ -3773,16 +3773,16 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb break; } case SCTP_NOTIFY_ASSOC_LOC_ABORTED: - if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 0, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 0, so_locked); } break; case SCTP_NOTIFY_ASSOC_REM_ABORTED: - if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 1, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); @@ -4026,7 +4026,7 @@ sctp_abort_association(struct sctp_inpcb *inp, struct if (stcb != NULL) { /* We have a TCB to abort, send notification too */ sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); - stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; + SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_WAS_ABORTED); /* Ok, now lets free it */ #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); @@ -4137,7 +4137,7 @@ sctp_abort_an_association(struct sctp_inpcb *inp, stru } return; } else { - stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; + SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_WAS_ABORTED); } /* notify the peer */ sctp_send_abort_tcb(stcb, op_err, so_locked); @@ -5130,9 +5130,8 @@ sctp_user_rcvd(struct sctp_tcb *stcb, uint32_t *freed_ atomic_add_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & (SCTP_STATE_ABOUT_TO_BE_FREED | - SCTP_STATE_SHUTDOWN_RECEIVED | - SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || + (stcb->asoc.state & (SCTP_STATE_ABOUT_TO_BE_FREED | SCTP_STATE_SHUTDOWN_RECEIVED))) { /* Pre-check If we are freeing no update */ goto no_lock; } From owner-svn-src-all@freebsd.org Mon Aug 13 11:56: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 F08B2106FE24; Mon, 13 Aug 2018 11:56:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A329F75F05; Mon, 13 Aug 2018 11:56:23 +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 844BE46EF; Mon, 13 Aug 2018 11:56:23 +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 w7DBuNVg066855; Mon, 13 Aug 2018 11:56:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DBuNfQ066854; Mon, 13 Aug 2018 11:56:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808131156.w7DBuNfQ066854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 13 Aug 2018 11:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337707 - head/stand/man X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/stand/man X-SVN-Commit-Revision: 337707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 11:56:24 -0000 Author: trasz Date: Mon Aug 13 11:56:23 2018 New Revision: 337707 URL: https://svnweb.freebsd.org/changeset/base/337707 Log: Move around text in loader(8), in particular stuff related to ZFS, to restore the usual section order. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/stand/man/loader.8 Modified: head/stand/man/loader.8 ============================================================================== --- head/stand/man/loader.8 Mon Aug 13 11:56:21 2018 (r337706) +++ head/stand/man/loader.8 Mon Aug 13 11:56:23 2018 (r337707) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2018 +.Dd August 13, 2018 .Dt LOADER 8 .Os .Sh NAME @@ -244,10 +244,14 @@ If is specified, file sizes will be shown too. .Pp .It Ic lsdev Op Fl v -Lists all of the devices from which it may be possible to load modules. +Lists all of the devices from which it may be possible to load modules, +as well as ZFS pools. If .Fl v -is specified, more details are printed. +is specified, more details are printed, including ZFS pool information +in a format that resembles +.Nm zpool Cm status +output. .Pp .It Ic lsmod Op Fl v Displays loaded modules. @@ -255,6 +259,14 @@ If .Fl v is specified, more details are shown. .Pp +.It Ic lszfs Ar filesystem +A ZFS extended command that can be used to explore the ZFS filesystem +hierarchy in a pool. +Lists the immediate children of the +.Ar filesystem . +The filesystem hierarchy is rooted at a filesystem with the same name +as the pool. +.Pp .It Ic more Ar file Op Ar Display the files specified, with a pause at each .Va LINES @@ -666,6 +678,29 @@ Modifies and .Dv VM_KMEM_SIZE_MAX . .El +.Ss ZFS FEATURES +.Nm +supports the following format for specifying ZFS filesystems which +can be used wherever +.Xr loader 8 +refers to a device specification: +.Pp +.Ar zfs:pool/filesystem: +.Pp +where +.Pa pool/filesystem +is a ZFS filesystem name as described in +.Xr zfs 8 . +.Pp +If +.Pa /etc/fstab +does not have an entry for the root filesystem and +.Va vfs.root.mountfrom +is not set, but +.Va currdev +refers to a ZFS filesystem, then +.Nm +will instruct kernel to use that filesystem as the root filesystem. .Ss BUILTIN PARSER When a builtin command is executed, the rest of the line is taken by it as arguments, and it is processed by a special parser which @@ -907,9 +942,8 @@ version at compile time. .Nm version. .El -.Ss SYSTEM DOCUMENTATION .Sh FILES -.Bl -tag -width /boot/defaults/loader.conf -compact +.Bl -tag -width /usr/share/examples/bootforth/ -compact .It Pa /boot/loader .Nm itself. @@ -918,6 +952,8 @@ Additional .Tn FICL initialization. .It Pa /boot/defaults/loader.conf +.It Pa /boot/loader.4th +Extra builtin-like words. .It Pa /boot/loader.conf .It Pa /boot/loader.conf.local .Nm @@ -930,6 +966,11 @@ bootstrapping script. Loaded by .Ic help . Contains the help messages. +.It Pa /boot/support.4th +.Pa loader.conf +processing words. +.It Pa /usr/share/examples/bootforth/ +Assorted examples. .El .Sh EXAMPLES Boot in single user mode: @@ -955,16 +996,11 @@ set root_disk_unit=2 boot /boot/kernel/kernel .Ed .Pp -See also: -.Bl -tag -width /usr/share/examples/bootforth/X -.It Pa /boot/loader.4th -Extra builtin-like words. -.It Pa /boot/support.4th -.Pa loader.conf -processing words. -.It Pa /usr/share/examples/bootforth/ -Assorted examples. -.El +Set the default device used for loading a kernel from a ZFS filesystem: +.Bd -literal -offset indent +set currdev=zfs:tank/ROOT/knowngood: +.Ed +.Pp .Sh ERRORS The following values are thrown by .Nm : @@ -990,52 +1026,6 @@ executed. .It -259 Unspecified error. .El -.Sh ZFS FEATURES -.Nm -supports the following format for specifying ZFS filesystems which -can be used wherever -.Xr loader 8 -refers to a device specification: -.Pp -.Ar zfs:pool/filesystem: -.Pp -where -.Pa pool/filesystem -is a ZFS filesystem name as described in -.Xr zfs 8 . -.Pp -If -.Pa /etc/fstab -does not have an entry for the root filesystem and -.Va vfs.root.mountfrom -is not set, but -.Va currdev -refers to a ZFS filesystem, then -.Nm -will instruct kernel to use that filesystem as the root filesystem. -.Sh ZFS COMMAND EXTENSIONS -.Bl -tag -width Ds -compact -.It Ic lsdev Op Fl v -Lists ZFS pools in addition to disks and partitions. -Adding -.Fl v -shows more ZFS pool details in a format that resembles -.Nm zpool Cm status -output. -.Pp -.It Ic lszfs Ar filesystem -A ZFS extended command that can be used to explore the ZFS filesystem -hierarchy in a pool. -Lists the immediate children of the -.Ar filesystem . -The filesystem hierarchy is rooted at a filesystem with the same name -as the pool. -.El -.Sh EXAMPLES -Set the default device used for loading a kernel from a ZFS filesystem: -.Bd -literal -offset indent -set currdev=zfs:tank/ROOT/knowngood: -.Ed .Sh SEE ALSO .Xr libstand 3 , .Xr loader.conf 5 , From owner-svn-src-all@freebsd.org Mon Aug 13 13:58:48 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 E5A4F10736EF; Mon, 13 Aug 2018 13:58:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BA9A7AB98; Mon, 13 Aug 2018 13:58:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77A795A50; Mon, 13 Aug 2018 13:58:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DDwle1038644; Mon, 13 Aug 2018 13:58:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DDwjs2038635; Mon, 13 Aug 2018 13:58:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201808131358.w7DDwjs2038635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 13 Aug 2018 13:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337708 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 13:58:48 -0000 Author: tuexen Date: Mon Aug 13 13:58:45 2018 New Revision: 337708 URL: https://svnweb.freebsd.org/changeset/base/337708 Log: Use the stacb instead of the asoc in state macros. This is not a functional change. Just a preparation for upcoming dtrace state change provider support. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon Aug 13 11:56:23 2018 (r337707) +++ head/sys/netinet/sctp_asconf.c Mon Aug 13 13:58:45 2018 (r337708) @@ -1991,8 +1991,8 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *inp, struct sc * sent when the state goes open. */ if (status == 0 && - ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED))) { + ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED))) { #ifdef SCTP_TIMER_BASED_ASCONF sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, stcb->asoc.primary_destination); @@ -2242,8 +2242,8 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, stru * count of queued params. If in the non-open * state, these get sent when the assoc goes open. */ - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { if (status >= 0) { num_queued++; } @@ -2304,8 +2304,8 @@ sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb, "set_primary_ip_address_sa: queued on tcb=%p, ", (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { #ifdef SCTP_TIMER_BASED_ASCONF sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep, stcb, @@ -2844,8 +2844,7 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, * out the ASCONF. */ if (status == 0 && - SCTP_GET_STATE(&stcb->asoc) == - SCTP_STATE_OPEN) { + SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { #ifdef SCTP_TIMER_BASED_ASCONF sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep, stcb, Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Mon Aug 13 11:56:23 2018 (r337707) +++ head/sys/netinet/sctp_constants.h Mon Aug 13 13:58:45 2018 (r337708) @@ -470,10 +470,14 @@ __FBSDID("$FreeBSD$"); #define SCTP_STATE_IN_ACCEPT_QUEUE 0x1000 #define SCTP_STATE_MASK 0x007f -#define SCTP_GET_STATE(asoc) ((asoc)->state & SCTP_STATE_MASK) -#define SCTP_SET_STATE(asoc, newstate) ((asoc)->state = ((asoc)->state & ~SCTP_STATE_MASK) | newstate) -#define SCTP_CLEAR_SUBSTATE(asoc, substate) ((asoc)->state &= ~substate) -#define SCTP_ADD_SUBSTATE(asoc, substate) ((asoc)->state |= substate) +#define SCTP_GET_STATE(_stcb) \ + ((_stcb)->asoc.state & SCTP_STATE_MASK) +#define SCTP_SET_STATE(_stcb, _state) \ + (_stcb)->asoc.state = ((_stcb)->asoc.state & ~SCTP_STATE_MASK) | (_state) +#define SCTP_CLEAR_SUBSTATE(_stcb, _substate) \ + (_stcb)->asoc.state &= ~(_substate) +#define SCTP_ADD_SUBSTATE(_stcb, _substate) \ + (_stcb)->asoc.state |= (_substate) /* SCTP reachability state for each address */ #define SCTP_ADDR_REACHABLE 0x001 Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Aug 13 11:56:23 2018 (r337707) +++ head/sys/netinet/sctp_indata.c Mon Aug 13 13:58:45 2018 (r337708) @@ -2573,7 +2573,7 @@ sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) * Now we need to see if we need to queue a sack or just start the * timer (if allowed). */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) { /* * Ok special case, in SHUTDOWN-SENT case. here we maker * sure SACK timer is off and instead send a SHUTDOWN and a @@ -2930,7 +2930,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_last_rcvd); } /* now service all of the reassm queue if needed */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) { /* Assure that we ack right away */ stcb->asoc.send_sack = 1; } @@ -4329,12 +4329,12 @@ again: /* clean up */ if ((asoc->stream_queue_cnt == 1) && ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); } if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && (asoc->stream_queue_cnt == 1) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { struct mbuf *op_err; @@ -4350,12 +4350,12 @@ again: (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (asoc->alternate) { netp = asoc->alternate; @@ -4367,13 +4367,13 @@ again: stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); - } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && + } else if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; SCTP_STAT_DECR_GAUGE32(sctps_currestab); - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_ACK_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (asoc->alternate) { netp = asoc->alternate; @@ -5026,12 +5026,12 @@ hopeless_peer: /* clean up */ if ((asoc->stream_queue_cnt == 1) && ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); } if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && (asoc->stream_queue_cnt == 1) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { struct mbuf *op_err; @@ -5047,12 +5047,12 @@ hopeless_peer: (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (asoc->alternate) { netp = asoc->alternate; @@ -5065,13 +5065,13 @@ hopeless_peer: sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); return; - } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && + } else if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; SCTP_STAT_DECR_GAUGE32(sctps_currestab); - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_ACK_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (asoc->alternate) { netp = asoc->alternate; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Aug 13 11:56:23 2018 (r337707) +++ head/sys/netinet/sctp_input.c Mon Aug 13 13:58:45 2018 (r337708) @@ -190,7 +190,7 @@ sctp_handle_init(struct mbuf *m, int iphlen, int offse goto outnow; } if ((stcb != NULL) && - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending SHUTDOWN-ACK\n"); sctp_send_shutdown_ack(stcb, NULL); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); @@ -713,15 +713,15 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ struct sctpasochead *head; - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_INP_INFO_WLOCK(); SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) { /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); @@ -735,14 +735,14 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) SCTP_INP_INFO_WUNLOCK(); return (1); } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { /* * treat like a case where the cookie expired i.e.: - dump * current cookie. - generate a new vtag. - resend init. */ /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); - SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_toss_old_cookies(stcb, &stcb->asoc); stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); @@ -824,8 +824,8 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, sctp_abort_notification(stcb, 1, error, abort, SCTP_SO_NOT_LOCKED); /* free the tcb */ SCTP_STAT_INCR_COUNTER32(sctps_aborted); - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } #ifdef SCTP_ASOCLOG_OF_TSNS @@ -839,7 +839,7 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif - SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_WAS_ABORTED); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_WAS_ABORTED); (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -894,15 +894,15 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, if (stcb == NULL) return; asoc = &stcb->asoc; - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { return; } if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_shutdown_chunk)) { /* Shutdown NOT the expected size */ return; } - old_state = SCTP_GET_STATE(asoc); + old_state = SCTP_GET_STATE(stcb); sctp_update_acked(stcb, cp, abort_flag); if (*abort_flag) { return; @@ -958,11 +958,11 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, } /* goto SHUTDOWN_RECEIVED state to block new requests */ if (stcb->sctp_socket) { - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT)) { - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_RECEIVED); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT)) { + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_RECEIVED); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); /* * notify upper layer that peer has initiated a * shutdown @@ -973,7 +973,7 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); } } - if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) { /* * stop the shutdown timer, since we WILL move to * SHUTDOWN-ACK-SENT. @@ -993,13 +993,13 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, /* no outstanding data to send, so move on... */ /* send SHUTDOWN-ACK */ /* move to SHUTDOWN-ACK-SENT state */ - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) { - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); + if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) { + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_ACK_SENT); sctp_stop_timers_for_shutdown(stcb); sctp_send_shutdown_ack(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, @@ -1028,15 +1028,15 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chun asoc = &stcb->asoc; /* process according to association state */ - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { /* unexpected SHUTDOWN-ACK... do OOTB handling... */ sctp_send_shutdown_complete(stcb, net, 1); SCTP_TCB_UNLOCK(stcb); return; } - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { /* unexpected SHUTDOWN-ACK... so ignore... */ SCTP_TCB_UNLOCK(stcb); return; @@ -1232,7 +1232,7 @@ sctp_handle_error(struct sctp_chunkhdr *ch, * waiting. */ if ((cause_length >= sizeof(struct sctp_error_stale_cookie)) && - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { struct sctp_error_stale_cookie *stale_cookie; stale_cookie = (struct sctp_error_stale_cookie *)cause; @@ -1265,7 +1265,7 @@ sctp_handle_error(struct sctp_chunkhdr *ch, } /* blast back to INIT state */ sctp_toss_old_cookies(stcb, &stcb->asoc); - SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); } @@ -1416,7 +1416,7 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int o return (-1); } /* process according to association state... */ - switch (SCTP_GET_STATE(&stcb->asoc)) { + switch (SCTP_GET_STATE(stcb)) { case SCTP_STATE_COOKIE_WAIT: /* this is the expected state for this chunk */ /* process the INIT-ACK parameters */ @@ -1442,7 +1442,7 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int o } /* update our state */ SCTPDBG(SCTP_DEBUG_INPUT2, "moving to COOKIE-ECHOED state\n"); - SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_ECHOED); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_ECHOED); /* reset the RTO calc */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { @@ -1536,7 +1536,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle if (how_indx < sizeof(asoc->cookie_how)) { asoc->cookie_how[how_indx] = 1; } - if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) { /* SHUTDOWN came in after sending INIT-ACK */ sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); op_err = sctp_generate_cause(SCTP_CAUSE_COOKIE_IN_SHUTDOWN, ""); @@ -1605,7 +1605,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle return (NULL); } - switch (SCTP_GET_STATE(asoc)) { + switch (SCTP_GET_STATE(stcb)) { case SCTP_STATE_COOKIE_WAIT: case SCTP_STATE_COOKIE_ECHOED: /* @@ -1629,12 +1629,12 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_14); /* update current state */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) SCTP_STAT_INCR_COUNTER32(sctps_activeestab); else SCTP_STAT_INCR_COUNTER32(sctps_collisionestab); - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); @@ -1734,7 +1734,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle * If nat support, and the below and stcb is established, send back * a ABORT(colliding state) if we are established. */ - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) && + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) && (asoc->peer_supports_nat) && ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && ((ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) || @@ -1839,8 +1839,8 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle asoc->cookie_how[how_indx] = 10; return (NULL); } - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { *notification = SCTP_NOTIFY_ASSOC_UP; if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || @@ -1868,17 +1868,17 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle SCTP_SOCKET_UNLOCK(so, 1); #endif } - if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) SCTP_STAT_INCR_COUNTER32(sctps_activeestab); else SCTP_STAT_INCR_COUNTER32(sctps_collisionestab); SCTP_STAT_INCR_GAUGE32(sctps_currestab); - } else if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { + } else if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { SCTP_STAT_INCR_COUNTER32(sctps_restartestab); } else { SCTP_STAT_INCR_COUNTER32(sctps_collisionestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); @@ -1938,24 +1938,24 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle /* notify upper layer */ *notification = SCTP_NOTIFY_ASSOC_RESTART; atomic_add_int(&stcb->asoc.refcnt, 1); - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_OPEN) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT)) { SCTP_STAT_INCR_GAUGE32(sctps_currestab); } - if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { SCTP_STAT_INCR_GAUGE32(sctps_restartestab); - } else if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) { + } else if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) { SCTP_STAT_INCR_GAUGE32(sctps_collisionestab); } if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); - } else if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) { + } else if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) { /* move to OPEN state, if not in SHUTDOWN_SENT */ - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); } asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); @@ -2344,7 +2344,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in /* update current state */ SCTPDBG(SCTP_DEBUG_INPUT2, "moving to OPEN state\n"); - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); @@ -2881,7 +2881,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in * the accept state waiting for the accept! */ if (*stcb) { - SCTP_ADD_SUBSTATE(&(*stcb)->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_ADD_SUBSTATE(*stcb, SCTP_STATE_IN_ACCEPT_QUEUE); } sctp_move_pcb_and_assoc(*inp_p, inp, *stcb); @@ -2969,10 +2969,10 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c asoc->overall_error_count = 0; sctp_stop_all_cookie_timers(stcb); /* process according to association state */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { /* state change only needed when I am in right state */ SCTPDBG(SCTP_DEBUG_INPUT2, "moving to OPEN state\n"); - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); sctp_start_net_timers(stcb); if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, @@ -3243,7 +3243,7 @@ sctp_handle_shutdown_complete(struct sctp_shutdown_com asoc = &stcb->asoc; /* process according to association state */ - if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) { + if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) { /* unexpected SHUTDOWN-COMPLETE... so ignore... */ SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_complete: not in SCTP_STATE_SHUTDOWN_ACK_SENT --- ignore\n"); @@ -4758,7 +4758,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (((ch->chunk_type == SCTP_SELECTIVE_ACK) || (ch->chunk_type == SCTP_NR_SELECTIVE_ACK) || (ch->chunk_type == SCTP_HEARTBEAT_REQUEST)) && - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { /* implied cookie-ack.. we must have lost the ack */ sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp); @@ -4952,7 +4952,7 @@ process_control_chunks: break; } } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) { /*- * If we have sent a shutdown-ack, we will pay no * attention to a sack sent in to us since @@ -5773,7 +5773,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph * not get here unless we really did have a tag, so we don't * abort if this happens, just dump the chunk silently. */ - switch (SCTP_GET_STATE(&stcb->asoc)) { + switch (SCTP_GET_STATE(stcb)) { case SCTP_STATE_COOKIE_ECHOED: /* * we consider data with valid tags in this state Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Aug 13 11:56:23 2018 (r337707) +++ head/sys/netinet/sctp_output.c Mon Aug 13 13:58:45 2018 (r337708) @@ -5529,7 +5529,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct asoc = NULL; } if ((asoc != NULL) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT)) { + (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT)) { if (sctp_are_there_new_addresses(asoc, init_pkt, offset, src)) { /* * new addresses, out of here in non-cookie-wait @@ -5832,9 +5832,9 @@ do_a_abort: initack->ch.chunk_length = 0; /* place in my tag */ if ((asoc != NULL) && - ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_INUSE) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED))) { + ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_INUSE) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED))) { /* re-use the v-tags and init-seq here */ initack->init.initiate_tag = htonl(asoc->my_vtag); initack->init.initial_tsn = htonl(asoc->init_seq_number); @@ -6363,9 +6363,9 @@ sctp_msg_append(struct sctp_tcb *stcb, } strm = &stcb->asoc.strmout[srcv->sinfo_stream]; /* Now can we send this? */ - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_SENT) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || (stcb->asoc.state & SCTP_STATE_SHUTDOWN_PENDING)) { /* got data while shutting down */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ECONNRESET); @@ -6698,18 +6698,18 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s * there is nothing queued to send, so I'm * done... */ - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { /* * only send SHUTDOWN the first time * through */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); sctp_send_shutdown(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, @@ -6730,13 +6730,13 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s * we will allow user data to be sent first * and move to SHUTDOWN-PENDING */ - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); } - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { @@ -7856,7 +7856,7 @@ sctp_med_chunk_output(struct sctp_inpcb *inp, *reason_code = 0; auth_keyid = stcb->asoc.authinfo.active_keyid; if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR))) { eeor_mode = 1; } else { @@ -8614,8 +8614,8 @@ again_one_more_time: omtu = 0; break; } - if ((((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + if ((((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && (skip_data_for_this_net == 0)) || (cookie)) { TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { @@ -9565,8 +9565,8 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, if (TAILQ_EMPTY(&asoc->sent_queue)) { return (SCTP_RETRAN_DONE); } - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT)) { /* not yet open, resend the cookie and that is it */ return (1); } @@ -12388,9 +12388,9 @@ sctp_copy_it_in(struct sctp_tcb *stcb, *error = 0; /* Now can we send this? */ - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { /* got data while shutting down */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ECONNRESET); @@ -12776,7 +12776,7 @@ sctp_lower_sosend(struct socket *so, */ queue_only = 1; asoc = &stcb->asoc; - SCTP_SET_STATE(asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); /* initialize authentication params for the assoc */ @@ -12898,8 +12898,8 @@ sctp_lower_sosend(struct socket *so, SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, error); goto out_unlocked; } - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { queue_only = 1; } /* we are now done with all control */ @@ -12907,9 +12907,9 @@ sctp_lower_sosend(struct socket *so, sctp_m_freem(control); control = NULL; } - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { if (srcv->sinfo_flags & SCTP_ABORT) { ; @@ -12929,8 +12929,8 @@ sctp_lower_sosend(struct socket *so, int tot_demand, tot_out = 0, max_out; SCTP_STAT_INCR(sctps_sends_with_abort); - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { /* It has to be up before we abort */ /* how big is the user initiated abort? */ SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); @@ -13309,12 +13309,12 @@ skip_preblock: SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { /* a collision took us forward? */ queue_only = 0; } else { sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); - SCTP_SET_STATE(asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); queue_only = 1; } } @@ -13497,17 +13497,17 @@ dataless_eof: goto abort_anyway; } /* there is nothing queued to send, so I'm done... */ - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; /* only send SHUTDOWN the first time through */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (stcb->asoc.alternate) { netp = stcb->asoc.alternate; @@ -13531,17 +13531,17 @@ dataless_eof: * data to be sent first and move to * SHUTDOWN-PENDING */ - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { if (hold_tcblock == 0) { SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); } - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { @@ -13582,12 +13582,12 @@ skip_out_eof: SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { /* a collision took us forward? */ queue_only = 0; } else { sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); - SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); queue_only = 1; } } Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Aug 13 11:56:23 2018 (r337707) +++ head/sys/netinet/sctp_pcb.c Mon Aug 13 13:58:45 2018 (r337708) @@ -3373,14 +3373,14 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, * was not closed. So go ahead and * start it now. */ - SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); } SCTP_TCB_UNLOCK(asoc); continue; } - if (((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_COOKIE_ECHOED)) && + if (((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) && (asoc->asoc.total_output_queue_size == 0)) { /* * If we have data in queue, we don't want @@ -3397,7 +3397,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, } /* Disconnect the socket please */ asoc->sctp_socket = NULL; - SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_CLOSED_SOCKET); + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_CLOSED_SOCKET); if ((asoc->asoc.size_on_reasm_queue > 0) || (asoc->asoc.control_pdapi) || (asoc->asoc.size_on_all_streams > 0) || @@ -3409,8 +3409,8 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_3; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); - if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } if (sctp_free_assoc(inp, asoc, @@ -3424,20 +3424,20 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, if ((*asoc->asoc.ss_functions.sctp_ss_is_user_msgs_incomplete) (asoc, &asoc->asoc)) { goto abort_anyway; } - if ((SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; /* * there is nothing queued to send, * so I send shutdown */ - if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(asoc); if (asoc->asoc.alternate) { netp = asoc->asoc.alternate; @@ -3453,11 +3453,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, } } else { /* mark into shutdown pending */ - SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, asoc->sctp_ep, asoc, asoc->asoc.primary_destination); if ((*asoc->asoc.ss_functions.sctp_ss_is_user_msgs_incomplete) (asoc, &asoc->asoc)) { - SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (TAILQ_EMPTY(&asoc->asoc.send_queue) && TAILQ_EMPTY(&asoc->asoc.sent_queue) && @@ -3469,8 +3469,8 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_5; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); - if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } if (sctp_free_assoc(inp, asoc, @@ -3518,7 +3518,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, SCTP_TCB_LOCK(asoc); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { - SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); } cnt++; @@ -3526,7 +3526,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, continue; } /* Free associations that are NOT killing us */ - if ((SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_COOKIE_WAIT) && + if ((SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT) && ((asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0)) { struct mbuf *op_err; @@ -3539,8 +3539,8 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, SCTP_TCB_UNLOCK(asoc); continue; } - if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } if (sctp_free_assoc(inp, asoc, SCTP_PCBFREE_FORCE, @@ -4803,7 +4803,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc } /* Now the read queue needs to be cleaned up (only once) */ if ((stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0) { - SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_ABOUT_TO_BE_FREED); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_ABOUT_TO_BE_FREED); SCTP_INP_READ_LOCK(inp); TAILQ_FOREACH(sq, &inp->read_queue, next) { if (sq->stcb == stcb) { @@ -4857,7 +4857,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc if ((stcb->asoc.refcnt) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { - SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); } SCTP_TCB_UNLOCK(stcb); @@ -4939,7 +4939,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc atomic_add_int(&stcb->asoc.refcnt, -1); } if (stcb->asoc.refcnt) { - SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); if (from_inpcbfree == SCTP_NORMAL_PROC) { SCTP_INP_INFO_WUNLOCK(); @@ -6277,7 +6277,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * assoc? straighten out locks. */ if (stcb_tmp) { - if (SCTP_GET_STATE(&stcb_tmp->asoc) == SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(stcb_tmp) == SCTP_STATE_COOKIE_WAIT) { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; @@ -6377,7 +6377,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * assoc? straighten out locks. */ if (stcb_tmp) { - if (SCTP_GET_STATE(&stcb_tmp->asoc) == SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(stcb_tmp) == SCTP_STATE_COOKIE_WAIT) { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Mon Aug 13 11:56:23 2018 (r337707) +++ head/sys/netinet/sctp_peeloff.c Mon Aug 13 13:58:45 2018 (r337708) @@ -74,7 +74,7 @@ sctp_can_peel_off(struct socket *head, sctp_assoc_t as SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOENT); return (ENOENT); } - state = SCTP_GET_STATE((&stcb->asoc)); + state = SCTP_GET_STATE(stcb); if ((state == SCTP_STATE_EMPTY) || (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); @@ -104,7 +104,7 @@ sctp_do_peeloff(struct socket *head, struct socket *so return (ENOTCONN); } - state = SCTP_GET_STATE((&stcb->asoc)); + state = SCTP_GET_STATE(stcb); if ((state == SCTP_STATE_EMPTY) || (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Mon Aug 13 11:56:23 2018 (r337707) +++ head/sys/netinet/sctp_timer.c Mon Aug 13 13:58:45 2018 (r337708) @@ -962,7 +962,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * Special case for cookie-echo'ed case, we don't do output but must * await the COOKIE-ACK before retransmission */ - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { /* * Here we just reset the timer and start again since we * have not established the asoc @@ -1004,7 +1004,7 @@ sctp_t1init_timer(struct sctp_inpcb *inp, sctp_send_initiate(inp, stcb, SCTP_SO_NOT_LOCKED); return (0); } - if (SCTP_GET_STATE((&stcb->asoc)) != SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT) { return (0); } if (sctp_threshold_management(inp, stcb, net, @@ -1052,7 +1052,7 @@ sctp_cookie_timer(struct sctp_inpcb *inp, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 13 14:13:26 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 C247A1073F2E; Mon, 13 Aug 2018 14:13:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78B147B983; Mon, 13 Aug 2018 14:13:26 +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 5A9DE5D83; Mon, 13 Aug 2018 14:13:26 +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 w7DEDQJY049136; Mon, 13 Aug 2018 14:13:26 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DEDQFr049135; Mon, 13 Aug 2018 14:13:26 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201808131413.w7DEDQFr049135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Mon, 13 Aug 2018 14:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337709 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 337709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 14:13:26 -0000 Author: gallatin Date: Mon Aug 13 14:13:25 2018 New Revision: 337709 URL: https://svnweb.freebsd.org/changeset/base/337709 Log: lagg: allow lacp to manage the link state Lacp needs to manage the link state itself. Unlike other lagg protocols, the ability of lacp to pass traffic depends not only on the lagg members having link, but also on the lacp protocol converging to a distributing state with the link partner. If we prematurely mark the link as up, then we will send a gratuitous arp (via arp_handle_ifllchange()) before the lacp interface is capable of passing traffic. When this happens, the gratuitous arp is lost, and our link partner may cache a stale mac address (eg, when the base mac address for the lagg bundle changes, due to a BIOS change re-ordering NIC unit numbers) Reviewed by: jtl, hselasky Sponsored by: Netflix Modified: head/sys/net/ieee8023ad_lacp.c head/sys/net/if_lagg.c Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Mon Aug 13 13:58:45 2018 (r337708) +++ head/sys/net/ieee8023ad_lacp.c Mon Aug 13 14:13:25 2018 (r337709) @@ -711,6 +711,8 @@ lacp_disable_distributing(struct lacp_port *lp) } lp->lp_state &= ~LACP_STATE_DISTRIBUTING; + if_link_state_change(sc->sc_ifp, + sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN); } static void @@ -745,6 +747,9 @@ lacp_enable_distributing(struct lacp_port *lp) } else /* try to become the active aggregator */ lacp_select_active_aggregator(lsc); + + if_link_state_change(sc->sc_ifp, + sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN); } static void Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon Aug 13 13:58:45 2018 (r337708) +++ head/sys/net/if_lagg.c Mon Aug 13 14:13:25 2018 (r337709) @@ -1737,6 +1737,10 @@ lagg_linkstate(struct lagg_softc *sc) LAGG_XLOCK_ASSERT(sc); + /* LACP handles link state itself */ + if (sc->sc_proto == LAGG_PROTO_LACP) + return; + /* Our link is considered up if at least one of our ports is active */ LAGG_RLOCK(); CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { From owner-svn-src-all@freebsd.org Mon Aug 13 14:24: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 C353C10742B8; Mon, 13 Aug 2018 14:24:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 695B77BF9D; Mon, 13 Aug 2018 14:24:01 +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 4A69C5F11; Mon, 13 Aug 2018 14:24:01 +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 w7DEO1rv054164; Mon, 13 Aug 2018 14:24:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DEO1hu054163; Mon, 13 Aug 2018 14:24:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808131424.w7DEO1hu054163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 13 Aug 2018 14:24:01 +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: r337710 - in stable: 10/release/tools 11/release/tools X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/tools 11/release/tools X-SVN-Commit-Revision: 337710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 14:24:01 -0000 Author: gjb Date: Mon Aug 13 14:24:00 2018 New Revision: 337710 URL: https://svnweb.freebsd.org/changeset/base/337710 Log: MFC r337555, r337556: r337555: Update and replace old rc daemons for GCE images. r337556: Invoke the growfs rc script for each boot on GCE. PR: 229000, 230275 Sponsored by: The FreeBSD Foundation Modified: stable/10/release/tools/gce.conf Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/tools/gce.conf Directory Properties: stable/11/ (props changed) Modified: stable/10/release/tools/gce.conf ============================================================================== --- stable/10/release/tools/gce.conf Mon Aug 13 14:13:25 2018 (r337709) +++ stable/10/release/tools/gce.conf Mon Aug 13 14:24:00 2018 (r337710) @@ -5,15 +5,13 @@ # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ - google-cloud-sdk panicmail sudo firstboot-growfs \ - sysutils/py-google-compute-engine" + google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="ntpd sshd firstboot_growfs \ +export VM_RC_LIST="ntpd sshd growfs\ firstboot_pkgs firstboot_freebsd_update google_startup \ google_accounts_daemon google_clock_skew_daemon \ - google_instance_setup google_ip_forwarding_daemon \ - google_network_setup" + google_instance_setup google_network_daemon" vm_extra_install_base() { echo 'search google.internal' > ${DESTDIR}/etc/resolv.conf @@ -22,6 +20,10 @@ vm_extra_install_base() { } vm_extra_pre_umount() { + # Enable growfs on every boot, not only the first, as as instance's disk can + # be enlarged post-creation + sed -i -e '/KEYWORD: firstboot/d' /etc/rc.d/growfs + cat << EOF >> ${DESTDIR}/etc/rc.conf dumpdev="AUTO" ifconfig_DEFAULT="SYNCDHCP mtu 1460" From owner-svn-src-all@freebsd.org Mon Aug 13 14:24:02 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 2D41310742BD; Mon, 13 Aug 2018 14:24:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7F1D7BF9E; Mon, 13 Aug 2018 14:24:01 +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 B900B5F12; Mon, 13 Aug 2018 14:24:01 +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 w7DEO13b054170; Mon, 13 Aug 2018 14:24:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DEO1LF054169; Mon, 13 Aug 2018 14:24:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808131424.w7DEO1LF054169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 13 Aug 2018 14:24:01 +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: r337710 - in stable: 10/release/tools 11/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/tools 11/release/tools X-SVN-Commit-Revision: 337710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 14:24:02 -0000 Author: gjb Date: Mon Aug 13 14:24:00 2018 New Revision: 337710 URL: https://svnweb.freebsd.org/changeset/base/337710 Log: MFC r337555, r337556: r337555: Update and replace old rc daemons for GCE images. r337556: Invoke the growfs rc script for each boot on GCE. PR: 229000, 230275 Sponsored by: The FreeBSD Foundation Modified: stable/11/release/tools/gce.conf Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/release/tools/gce.conf Directory Properties: stable/10/ (props changed) Modified: stable/11/release/tools/gce.conf ============================================================================== --- stable/11/release/tools/gce.conf Mon Aug 13 14:13:25 2018 (r337709) +++ stable/11/release/tools/gce.conf Mon Aug 13 14:24:00 2018 (r337710) @@ -5,15 +5,13 @@ # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ - google-cloud-sdk panicmail sudo firstboot-growfs \ - sysutils/py-google-compute-engine" + google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="ntpd sshd firstboot_growfs \ +export VM_RC_LIST="ntpd sshd growfs\ firstboot_pkgs firstboot_freebsd_update google_startup \ google_accounts_daemon google_clock_skew_daemon \ - google_instance_setup google_ip_forwarding_daemon \ - google_network_setup" + google_instance_setup google_network_daemon" vm_extra_install_base() { echo 'search google.internal' > ${DESTDIR}/etc/resolv.conf @@ -22,6 +20,10 @@ vm_extra_install_base() { } vm_extra_pre_umount() { + # Enable growfs on every boot, not only the first, as as instance's disk can + # be enlarged post-creation + sed -i -e '/KEYWORD: firstboot/d' /etc/rc.d/growfs + cat << EOF >> ${DESTDIR}/etc/rc.conf dumpdev="AUTO" ifconfig_DEFAULT="SYNCDHCP mtu 1460" From owner-svn-src-all@freebsd.org Mon Aug 13 14:49: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 421401074BE1; Mon, 13 Aug 2018 14:49:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC2C27CEB7; Mon, 13 Aug 2018 14:49:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8BD46242; Mon, 13 Aug 2018 14:49:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DEn7lT066515; Mon, 13 Aug 2018 14:49:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DEn7s6066514; Mon, 13 Aug 2018 14:49:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808131449.w7DEn7s6066514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 13 Aug 2018 14:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337711 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 337711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 14:49:08 -0000 Author: kevans Date: Mon Aug 13 14:49:07 2018 New Revision: 337711 URL: https://svnweb.freebsd.org/changeset/base/337711 Log: lualoader: Fix parsing of negative number loader.conf(5) variables They would previously cause errors, as the regex for these did not tolerate a leading negative sign, and the variable would simply not parse. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Mon Aug 13 14:24:00 2018 (r337710) +++ head/stand/lua/config.lua Mon Aug 13 14:49:07 2018 (r337711) @@ -198,7 +198,7 @@ local pattern_table = { }, -- env_var=num { - str = "^%s*([%w%p]+)%s*=%s*(%d+)%s*(.*)", + str = "^%s*([%w%p]+)%s*=%s*(-?%d+)%s*(.*)", process = function(k, v) if setEnv(k, processEnvVar(v)) ~= 0 then print(MSG_FAILSETENV:format(k, tostring(v))) From owner-svn-src-all@freebsd.org Mon Aug 13 16:07: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 10E181076765; Mon, 13 Aug 2018 16:07:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6D377FFBF; Mon, 13 Aug 2018 16:07:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93D016FAC; Mon, 13 Aug 2018 16:07:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DG7IDj014817; Mon, 13 Aug 2018 16:07:18 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DG7IT4014816; Mon, 13 Aug 2018 16:07:18 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808131607.w7DG7IT4014816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 13 Aug 2018 16:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337712 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 337712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 16:07:19 -0000 Author: br Date: Mon Aug 13 16:07:18 2018 New Revision: 337712 URL: https://svnweb.freebsd.org/changeset/base/337712 Log: Add RISC-V instructions encoding. This is the output of $ cat opcodes opcodes-rvc-pseudo opcodes-rvc opcodes-custom | ./parse-opcodes -c It is confirmed by author that the output of parse-opcodes is in the public domain. This will be required for DDB disassembler. Discussed with: Andrew Waterman Obtained from: https://github.com/riscv/riscv-opcodes Sponsored by: DARPA, AFRL Added: head/sys/riscv/include/encoding.h (contents, props changed) Added: head/sys/riscv/include/encoding.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/encoding.h Mon Aug 13 16:07:18 2018 (r337712) @@ -0,0 +1,1253 @@ +/*- + * This file is in the public domain. + */ +/* $FreeBSD$ */ + +/* Automatically generated by parse-opcodes. */ +#ifndef RISCV_ENCODING_H +#define RISCV_ENCODING_H +#define MATCH_BEQ 0x63 +#define MASK_BEQ 0x707f +#define MATCH_BNE 0x1063 +#define MASK_BNE 0x707f +#define MATCH_BLT 0x4063 +#define MASK_BLT 0x707f +#define MATCH_BGE 0x5063 +#define MASK_BGE 0x707f +#define MATCH_BLTU 0x6063 +#define MASK_BLTU 0x707f +#define MATCH_BGEU 0x7063 +#define MASK_BGEU 0x707f +#define MATCH_JALR 0x67 +#define MASK_JALR 0x707f +#define MATCH_JAL 0x6f +#define MASK_JAL 0x7f +#define MATCH_LUI 0x37 +#define MASK_LUI 0x7f +#define MATCH_AUIPC 0x17 +#define MASK_AUIPC 0x7f +#define MATCH_ADDI 0x13 +#define MASK_ADDI 0x707f +#define MATCH_SLLI 0x1013 +#define MASK_SLLI 0xfc00707f +#define MATCH_SLTI 0x2013 +#define MASK_SLTI 0x707f +#define MATCH_SLTIU 0x3013 +#define MASK_SLTIU 0x707f +#define MATCH_XORI 0x4013 +#define MASK_XORI 0x707f +#define MATCH_SRLI 0x5013 +#define MASK_SRLI 0xfc00707f +#define MATCH_SRAI 0x40005013 +#define MASK_SRAI 0xfc00707f +#define MATCH_ORI 0x6013 +#define MASK_ORI 0x707f +#define MATCH_ANDI 0x7013 +#define MASK_ANDI 0x707f +#define MATCH_ADD 0x33 +#define MASK_ADD 0xfe00707f +#define MATCH_SUB 0x40000033 +#define MASK_SUB 0xfe00707f +#define MATCH_SLL 0x1033 +#define MASK_SLL 0xfe00707f +#define MATCH_SLT 0x2033 +#define MASK_SLT 0xfe00707f +#define MATCH_SLTU 0x3033 +#define MASK_SLTU 0xfe00707f +#define MATCH_XOR 0x4033 +#define MASK_XOR 0xfe00707f +#define MATCH_SRL 0x5033 +#define MASK_SRL 0xfe00707f +#define MATCH_SRA 0x40005033 +#define MASK_SRA 0xfe00707f +#define MATCH_OR 0x6033 +#define MASK_OR 0xfe00707f +#define MATCH_AND 0x7033 +#define MASK_AND 0xfe00707f +#define MATCH_ADDIW 0x1b +#define MASK_ADDIW 0x707f +#define MATCH_SLLIW 0x101b +#define MASK_SLLIW 0xfe00707f +#define MATCH_SRLIW 0x501b +#define MASK_SRLIW 0xfe00707f +#define MATCH_SRAIW 0x4000501b +#define MASK_SRAIW 0xfe00707f +#define MATCH_ADDW 0x3b +#define MASK_ADDW 0xfe00707f +#define MATCH_SUBW 0x4000003b +#define MASK_SUBW 0xfe00707f +#define MATCH_SLLW 0x103b +#define MASK_SLLW 0xfe00707f +#define MATCH_SRLW 0x503b +#define MASK_SRLW 0xfe00707f +#define MATCH_SRAW 0x4000503b +#define MASK_SRAW 0xfe00707f +#define MATCH_LB 0x3 +#define MASK_LB 0x707f +#define MATCH_LH 0x1003 +#define MASK_LH 0x707f +#define MATCH_LW 0x2003 +#define MASK_LW 0x707f +#define MATCH_LD 0x3003 +#define MASK_LD 0x707f +#define MATCH_LBU 0x4003 +#define MASK_LBU 0x707f +#define MATCH_LHU 0x5003 +#define MASK_LHU 0x707f +#define MATCH_LWU 0x6003 +#define MASK_LWU 0x707f +#define MATCH_SB 0x23 +#define MASK_SB 0x707f +#define MATCH_SH 0x1023 +#define MASK_SH 0x707f +#define MATCH_SW 0x2023 +#define MASK_SW 0x707f +#define MATCH_SD 0x3023 +#define MASK_SD 0x707f +#define MATCH_FENCE 0xf +#define MASK_FENCE 0x707f +#define MATCH_FENCE_I 0x100f +#define MASK_FENCE_I 0x707f +#define MATCH_MUL 0x2000033 +#define MASK_MUL 0xfe00707f +#define MATCH_MULH 0x2001033 +#define MASK_MULH 0xfe00707f +#define MATCH_MULHSU 0x2002033 +#define MASK_MULHSU 0xfe00707f +#define MATCH_MULHU 0x2003033 +#define MASK_MULHU 0xfe00707f +#define MATCH_DIV 0x2004033 +#define MASK_DIV 0xfe00707f +#define MATCH_DIVU 0x2005033 +#define MASK_DIVU 0xfe00707f +#define MATCH_REM 0x2006033 +#define MASK_REM 0xfe00707f +#define MATCH_REMU 0x2007033 +#define MASK_REMU 0xfe00707f +#define MATCH_MULW 0x200003b +#define MASK_MULW 0xfe00707f +#define MATCH_DIVW 0x200403b +#define MASK_DIVW 0xfe00707f +#define MATCH_DIVUW 0x200503b +#define MASK_DIVUW 0xfe00707f +#define MATCH_REMW 0x200603b +#define MASK_REMW 0xfe00707f +#define MATCH_REMUW 0x200703b +#define MASK_REMUW 0xfe00707f +#define MATCH_AMOADD_W 0x202f +#define MASK_AMOADD_W 0xf800707f +#define MATCH_AMOXOR_W 0x2000202f +#define MASK_AMOXOR_W 0xf800707f +#define MATCH_AMOOR_W 0x4000202f +#define MASK_AMOOR_W 0xf800707f +#define MATCH_AMOAND_W 0x6000202f +#define MASK_AMOAND_W 0xf800707f +#define MATCH_AMOMIN_W 0x8000202f +#define MASK_AMOMIN_W 0xf800707f +#define MATCH_AMOMAX_W 0xa000202f +#define MASK_AMOMAX_W 0xf800707f +#define MATCH_AMOMINU_W 0xc000202f +#define MASK_AMOMINU_W 0xf800707f +#define MATCH_AMOMAXU_W 0xe000202f +#define MASK_AMOMAXU_W 0xf800707f +#define MATCH_AMOSWAP_W 0x800202f +#define MASK_AMOSWAP_W 0xf800707f +#define MATCH_LR_W 0x1000202f +#define MASK_LR_W 0xf9f0707f +#define MATCH_SC_W 0x1800202f +#define MASK_SC_W 0xf800707f +#define MATCH_AMOADD_D 0x302f +#define MASK_AMOADD_D 0xf800707f +#define MATCH_AMOXOR_D 0x2000302f +#define MASK_AMOXOR_D 0xf800707f +#define MATCH_AMOOR_D 0x4000302f +#define MASK_AMOOR_D 0xf800707f +#define MATCH_AMOAND_D 0x6000302f +#define MASK_AMOAND_D 0xf800707f +#define MATCH_AMOMIN_D 0x8000302f +#define MASK_AMOMIN_D 0xf800707f +#define MATCH_AMOMAX_D 0xa000302f +#define MASK_AMOMAX_D 0xf800707f +#define MATCH_AMOMINU_D 0xc000302f +#define MASK_AMOMINU_D 0xf800707f +#define MATCH_AMOMAXU_D 0xe000302f +#define MASK_AMOMAXU_D 0xf800707f +#define MATCH_AMOSWAP_D 0x800302f +#define MASK_AMOSWAP_D 0xf800707f +#define MATCH_LR_D 0x1000302f +#define MASK_LR_D 0xf9f0707f +#define MATCH_SC_D 0x1800302f +#define MASK_SC_D 0xf800707f +#define MATCH_ECALL 0x73 +#define MASK_ECALL 0xffffffff +#define MATCH_EBREAK 0x100073 +#define MASK_EBREAK 0xffffffff +#define MATCH_URET 0x200073 +#define MASK_URET 0xffffffff +#define MATCH_SRET 0x10200073 +#define MASK_SRET 0xffffffff +#define MATCH_MRET 0x30200073 +#define MASK_MRET 0xffffffff +#define MATCH_DRET 0x7b200073 +#define MASK_DRET 0xffffffff +#define MATCH_SFENCE_VMA 0x12000073 +#define MASK_SFENCE_VMA 0xfe007fff +#define MATCH_WFI 0x10500073 +#define MASK_WFI 0xffffffff +#define MATCH_CSRRW 0x1073 +#define MASK_CSRRW 0x707f +#define MATCH_CSRRS 0x2073 +#define MASK_CSRRS 0x707f +#define MATCH_CSRRC 0x3073 +#define MASK_CSRRC 0x707f +#define MATCH_CSRRWI 0x5073 +#define MASK_CSRRWI 0x707f +#define MATCH_CSRRSI 0x6073 +#define MASK_CSRRSI 0x707f +#define MATCH_CSRRCI 0x7073 +#define MASK_CSRRCI 0x707f +#define MATCH_FADD_S 0x53 +#define MASK_FADD_S 0xfe00007f +#define MATCH_FSUB_S 0x8000053 +#define MASK_FSUB_S 0xfe00007f +#define MATCH_FMUL_S 0x10000053 +#define MASK_FMUL_S 0xfe00007f +#define MATCH_FDIV_S 0x18000053 +#define MASK_FDIV_S 0xfe00007f +#define MATCH_FSGNJ_S 0x20000053 +#define MASK_FSGNJ_S 0xfe00707f +#define MATCH_FSGNJN_S 0x20001053 +#define MASK_FSGNJN_S 0xfe00707f +#define MATCH_FSGNJX_S 0x20002053 +#define MASK_FSGNJX_S 0xfe00707f +#define MATCH_FMIN_S 0x28000053 +#define MASK_FMIN_S 0xfe00707f +#define MATCH_FMAX_S 0x28001053 +#define MASK_FMAX_S 0xfe00707f +#define MATCH_FSQRT_S 0x58000053 +#define MASK_FSQRT_S 0xfff0007f +#define MATCH_FADD_D 0x2000053 +#define MASK_FADD_D 0xfe00007f +#define MATCH_FSUB_D 0xa000053 +#define MASK_FSUB_D 0xfe00007f +#define MATCH_FMUL_D 0x12000053 +#define MASK_FMUL_D 0xfe00007f +#define MATCH_FDIV_D 0x1a000053 +#define MASK_FDIV_D 0xfe00007f +#define MATCH_FSGNJ_D 0x22000053 +#define MASK_FSGNJ_D 0xfe00707f +#define MATCH_FSGNJN_D 0x22001053 +#define MASK_FSGNJN_D 0xfe00707f +#define MATCH_FSGNJX_D 0x22002053 +#define MASK_FSGNJX_D 0xfe00707f +#define MATCH_FMIN_D 0x2a000053 +#define MASK_FMIN_D 0xfe00707f +#define MATCH_FMAX_D 0x2a001053 +#define MASK_FMAX_D 0xfe00707f +#define MATCH_FCVT_S_D 0x40100053 +#define MASK_FCVT_S_D 0xfff0007f +#define MATCH_FCVT_D_S 0x42000053 +#define MASK_FCVT_D_S 0xfff0007f +#define MATCH_FSQRT_D 0x5a000053 +#define MASK_FSQRT_D 0xfff0007f +#define MATCH_FADD_Q 0x6000053 +#define MASK_FADD_Q 0xfe00007f +#define MATCH_FSUB_Q 0xe000053 +#define MASK_FSUB_Q 0xfe00007f +#define MATCH_FMUL_Q 0x16000053 +#define MASK_FMUL_Q 0xfe00007f +#define MATCH_FDIV_Q 0x1e000053 +#define MASK_FDIV_Q 0xfe00007f +#define MATCH_FSGNJ_Q 0x26000053 +#define MASK_FSGNJ_Q 0xfe00707f +#define MATCH_FSGNJN_Q 0x26001053 +#define MASK_FSGNJN_Q 0xfe00707f +#define MATCH_FSGNJX_Q 0x26002053 +#define MASK_FSGNJX_Q 0xfe00707f +#define MATCH_FMIN_Q 0x2e000053 +#define MASK_FMIN_Q 0xfe00707f +#define MATCH_FMAX_Q 0x2e001053 +#define MASK_FMAX_Q 0xfe00707f +#define MATCH_FCVT_S_Q 0x40300053 +#define MASK_FCVT_S_Q 0xfff0007f +#define MATCH_FCVT_Q_S 0x46000053 +#define MASK_FCVT_Q_S 0xfff0007f +#define MATCH_FCVT_D_Q 0x42300053 +#define MASK_FCVT_D_Q 0xfff0007f +#define MATCH_FCVT_Q_D 0x46100053 +#define MASK_FCVT_Q_D 0xfff0007f +#define MATCH_FSQRT_Q 0x5e000053 +#define MASK_FSQRT_Q 0xfff0007f +#define MATCH_FLE_S 0xa0000053 +#define MASK_FLE_S 0xfe00707f +#define MATCH_FLT_S 0xa0001053 +#define MASK_FLT_S 0xfe00707f +#define MATCH_FEQ_S 0xa0002053 +#define MASK_FEQ_S 0xfe00707f +#define MATCH_FLE_D 0xa2000053 +#define MASK_FLE_D 0xfe00707f +#define MATCH_FLT_D 0xa2001053 +#define MASK_FLT_D 0xfe00707f +#define MATCH_FEQ_D 0xa2002053 +#define MASK_FEQ_D 0xfe00707f +#define MATCH_FLE_Q 0xa6000053 +#define MASK_FLE_Q 0xfe00707f +#define MATCH_FLT_Q 0xa6001053 +#define MASK_FLT_Q 0xfe00707f +#define MATCH_FEQ_Q 0xa6002053 +#define MASK_FEQ_Q 0xfe00707f +#define MATCH_FCVT_W_S 0xc0000053 +#define MASK_FCVT_W_S 0xfff0007f +#define MATCH_FCVT_WU_S 0xc0100053 +#define MASK_FCVT_WU_S 0xfff0007f +#define MATCH_FCVT_L_S 0xc0200053 +#define MASK_FCVT_L_S 0xfff0007f +#define MATCH_FCVT_LU_S 0xc0300053 +#define MASK_FCVT_LU_S 0xfff0007f +#define MATCH_FMV_X_W 0xe0000053 +#define MASK_FMV_X_W 0xfff0707f +#define MATCH_FCLASS_S 0xe0001053 +#define MASK_FCLASS_S 0xfff0707f +#define MATCH_FCVT_W_D 0xc2000053 +#define MASK_FCVT_W_D 0xfff0007f +#define MATCH_FCVT_WU_D 0xc2100053 +#define MASK_FCVT_WU_D 0xfff0007f +#define MATCH_FCVT_L_D 0xc2200053 +#define MASK_FCVT_L_D 0xfff0007f +#define MATCH_FCVT_LU_D 0xc2300053 +#define MASK_FCVT_LU_D 0xfff0007f +#define MATCH_FMV_X_D 0xe2000053 +#define MASK_FMV_X_D 0xfff0707f +#define MATCH_FCLASS_D 0xe2001053 +#define MASK_FCLASS_D 0xfff0707f +#define MATCH_FCVT_W_Q 0xc6000053 +#define MASK_FCVT_W_Q 0xfff0007f +#define MATCH_FCVT_WU_Q 0xc6100053 +#define MASK_FCVT_WU_Q 0xfff0007f +#define MATCH_FCVT_L_Q 0xc6200053 +#define MASK_FCVT_L_Q 0xfff0007f +#define MATCH_FCVT_LU_Q 0xc6300053 +#define MASK_FCVT_LU_Q 0xfff0007f +#define MATCH_FMV_X_Q 0xe6000053 +#define MASK_FMV_X_Q 0xfff0707f +#define MATCH_FCLASS_Q 0xe6001053 +#define MASK_FCLASS_Q 0xfff0707f +#define MATCH_FCVT_S_W 0xd0000053 +#define MASK_FCVT_S_W 0xfff0007f +#define MATCH_FCVT_S_WU 0xd0100053 +#define MASK_FCVT_S_WU 0xfff0007f +#define MATCH_FCVT_S_L 0xd0200053 +#define MASK_FCVT_S_L 0xfff0007f +#define MATCH_FCVT_S_LU 0xd0300053 +#define MASK_FCVT_S_LU 0xfff0007f +#define MATCH_FMV_W_X 0xf0000053 +#define MASK_FMV_W_X 0xfff0707f +#define MATCH_FCVT_D_W 0xd2000053 +#define MASK_FCVT_D_W 0xfff0007f +#define MATCH_FCVT_D_WU 0xd2100053 +#define MASK_FCVT_D_WU 0xfff0007f +#define MATCH_FCVT_D_L 0xd2200053 +#define MASK_FCVT_D_L 0xfff0007f +#define MATCH_FCVT_D_LU 0xd2300053 +#define MASK_FCVT_D_LU 0xfff0007f +#define MATCH_FMV_D_X 0xf2000053 +#define MASK_FMV_D_X 0xfff0707f +#define MATCH_FCVT_Q_W 0xd6000053 +#define MASK_FCVT_Q_W 0xfff0007f +#define MATCH_FCVT_Q_WU 0xd6100053 +#define MASK_FCVT_Q_WU 0xfff0007f +#define MATCH_FCVT_Q_L 0xd6200053 +#define MASK_FCVT_Q_L 0xfff0007f +#define MATCH_FCVT_Q_LU 0xd6300053 +#define MASK_FCVT_Q_LU 0xfff0007f +#define MATCH_FMV_Q_X 0xf6000053 +#define MASK_FMV_Q_X 0xfff0707f +#define MATCH_FLW 0x2007 +#define MASK_FLW 0x707f +#define MATCH_FLD 0x3007 +#define MASK_FLD 0x707f +#define MATCH_FLQ 0x4007 +#define MASK_FLQ 0x707f +#define MATCH_FSW 0x2027 +#define MASK_FSW 0x707f +#define MATCH_FSD 0x3027 +#define MASK_FSD 0x707f +#define MATCH_FSQ 0x4027 +#define MASK_FSQ 0x707f +#define MATCH_FMADD_S 0x43 +#define MASK_FMADD_S 0x600007f +#define MATCH_FMSUB_S 0x47 +#define MASK_FMSUB_S 0x600007f +#define MATCH_FNMSUB_S 0x4b +#define MASK_FNMSUB_S 0x600007f +#define MATCH_FNMADD_S 0x4f +#define MASK_FNMADD_S 0x600007f +#define MATCH_FMADD_D 0x2000043 +#define MASK_FMADD_D 0x600007f +#define MATCH_FMSUB_D 0x2000047 +#define MASK_FMSUB_D 0x600007f +#define MATCH_FNMSUB_D 0x200004b +#define MASK_FNMSUB_D 0x600007f +#define MATCH_FNMADD_D 0x200004f +#define MASK_FNMADD_D 0x600007f +#define MATCH_FMADD_Q 0x6000043 +#define MASK_FMADD_Q 0x600007f +#define MATCH_FMSUB_Q 0x6000047 +#define MASK_FMSUB_Q 0x600007f +#define MATCH_FNMSUB_Q 0x600004b +#define MASK_FNMSUB_Q 0x600007f +#define MATCH_FNMADD_Q 0x600004f +#define MASK_FNMADD_Q 0x600007f +#define MATCH_C_NOP 0x1 +#define MASK_C_NOP 0xffff +#define MATCH_C_ADDI16SP 0x6101 +#define MASK_C_ADDI16SP 0xef83 +#define MATCH_C_JR 0x8002 +#define MASK_C_JR 0xf07f +#define MATCH_C_JALR 0x9002 +#define MASK_C_JALR 0xf07f +#define MATCH_C_EBREAK 0x9002 +#define MASK_C_EBREAK 0xffff +#define MATCH_C_LD 0x6000 +#define MASK_C_LD 0xe003 +#define MATCH_C_SD 0xe000 +#define MASK_C_SD 0xe003 +#define MATCH_C_ADDIW 0x2001 +#define MASK_C_ADDIW 0xe003 +#define MATCH_C_LDSP 0x6002 +#define MASK_C_LDSP 0xe003 +#define MATCH_C_SDSP 0xe002 +#define MASK_C_SDSP 0xe003 +#define MATCH_C_ADDI4SPN 0x0 +#define MASK_C_ADDI4SPN 0xe003 +#define MATCH_C_FLD 0x2000 +#define MASK_C_FLD 0xe003 +#define MATCH_C_LW 0x4000 +#define MASK_C_LW 0xe003 +#define MATCH_C_FLW 0x6000 +#define MASK_C_FLW 0xe003 +#define MATCH_C_FSD 0xa000 +#define MASK_C_FSD 0xe003 +#define MATCH_C_SW 0xc000 +#define MASK_C_SW 0xe003 +#define MATCH_C_FSW 0xe000 +#define MASK_C_FSW 0xe003 +#define MATCH_C_ADDI 0x1 +#define MASK_C_ADDI 0xe003 +#define MATCH_C_JAL 0x2001 +#define MASK_C_JAL 0xe003 +#define MATCH_C_LI 0x4001 +#define MASK_C_LI 0xe003 +#define MATCH_C_LUI 0x6001 +#define MASK_C_LUI 0xe003 +#define MATCH_C_SRLI 0x8001 +#define MASK_C_SRLI 0xec03 +#define MATCH_C_SRAI 0x8401 +#define MASK_C_SRAI 0xec03 +#define MATCH_C_ANDI 0x8801 +#define MASK_C_ANDI 0xec03 +#define MATCH_C_SUB 0x8c01 +#define MASK_C_SUB 0xfc63 +#define MATCH_C_XOR 0x8c21 +#define MASK_C_XOR 0xfc63 +#define MATCH_C_OR 0x8c41 +#define MASK_C_OR 0xfc63 +#define MATCH_C_AND 0x8c61 +#define MASK_C_AND 0xfc63 +#define MATCH_C_SUBW 0x9c01 +#define MASK_C_SUBW 0xfc63 +#define MATCH_C_ADDW 0x9c21 +#define MASK_C_ADDW 0xfc63 +#define MATCH_C_J 0xa001 +#define MASK_C_J 0xe003 +#define MATCH_C_BEQZ 0xc001 +#define MASK_C_BEQZ 0xe003 +#define MATCH_C_BNEZ 0xe001 +#define MASK_C_BNEZ 0xe003 +#define MATCH_C_SLLI 0x2 +#define MASK_C_SLLI 0xe003 +#define MATCH_C_FLDSP 0x2002 +#define MASK_C_FLDSP 0xe003 +#define MATCH_C_LWSP 0x4002 +#define MASK_C_LWSP 0xe003 +#define MATCH_C_FLWSP 0x6002 +#define MASK_C_FLWSP 0xe003 +#define MATCH_C_MV 0x8002 +#define MASK_C_MV 0xf003 +#define MATCH_C_ADD 0x9002 +#define MASK_C_ADD 0xf003 +#define MATCH_C_FSDSP 0xa002 +#define MASK_C_FSDSP 0xe003 +#define MATCH_C_SWSP 0xc002 +#define MASK_C_SWSP 0xe003 +#define MATCH_C_FSWSP 0xe002 +#define MASK_C_FSWSP 0xe003 +#define MATCH_CUSTOM0 0xb +#define MASK_CUSTOM0 0x707f +#define MATCH_CUSTOM0_RS1 0x200b +#define MASK_CUSTOM0_RS1 0x707f +#define MATCH_CUSTOM0_RS1_RS2 0x300b +#define MASK_CUSTOM0_RS1_RS2 0x707f +#define MATCH_CUSTOM0_RD 0x400b +#define MASK_CUSTOM0_RD 0x707f +#define MATCH_CUSTOM0_RD_RS1 0x600b +#define MASK_CUSTOM0_RD_RS1 0x707f +#define MATCH_CUSTOM0_RD_RS1_RS2 0x700b +#define MASK_CUSTOM0_RD_RS1_RS2 0x707f +#define MATCH_CUSTOM1 0x2b +#define MASK_CUSTOM1 0x707f +#define MATCH_CUSTOM1_RS1 0x202b +#define MASK_CUSTOM1_RS1 0x707f +#define MATCH_CUSTOM1_RS1_RS2 0x302b +#define MASK_CUSTOM1_RS1_RS2 0x707f +#define MATCH_CUSTOM1_RD 0x402b +#define MASK_CUSTOM1_RD 0x707f +#define MATCH_CUSTOM1_RD_RS1 0x602b +#define MASK_CUSTOM1_RD_RS1 0x707f +#define MATCH_CUSTOM1_RD_RS1_RS2 0x702b +#define MASK_CUSTOM1_RD_RS1_RS2 0x707f +#define MATCH_CUSTOM2 0x5b +#define MASK_CUSTOM2 0x707f +#define MATCH_CUSTOM2_RS1 0x205b +#define MASK_CUSTOM2_RS1 0x707f +#define MATCH_CUSTOM2_RS1_RS2 0x305b +#define MASK_CUSTOM2_RS1_RS2 0x707f +#define MATCH_CUSTOM2_RD 0x405b +#define MASK_CUSTOM2_RD 0x707f +#define MATCH_CUSTOM2_RD_RS1 0x605b +#define MASK_CUSTOM2_RD_RS1 0x707f +#define MATCH_CUSTOM2_RD_RS1_RS2 0x705b +#define MASK_CUSTOM2_RD_RS1_RS2 0x707f +#define MATCH_CUSTOM3 0x7b +#define MASK_CUSTOM3 0x707f +#define MATCH_CUSTOM3_RS1 0x207b +#define MASK_CUSTOM3_RS1 0x707f +#define MATCH_CUSTOM3_RS1_RS2 0x307b +#define MASK_CUSTOM3_RS1_RS2 0x707f +#define MATCH_CUSTOM3_RD 0x407b +#define MASK_CUSTOM3_RD 0x707f +#define MATCH_CUSTOM3_RD_RS1 0x607b +#define MASK_CUSTOM3_RD_RS1 0x707f +#define MATCH_CUSTOM3_RD_RS1_RS2 0x707b +#define MASK_CUSTOM3_RD_RS1_RS2 0x707f +#define CSR_FFLAGS 0x1 +#define CSR_FRM 0x2 +#define CSR_FCSR 0x3 +#define CSR_CYCLE 0xc00 +#define CSR_TIME 0xc01 +#define CSR_INSTRET 0xc02 +#define CSR_HPMCOUNTER3 0xc03 +#define CSR_HPMCOUNTER4 0xc04 +#define CSR_HPMCOUNTER5 0xc05 +#define CSR_HPMCOUNTER6 0xc06 +#define CSR_HPMCOUNTER7 0xc07 +#define CSR_HPMCOUNTER8 0xc08 +#define CSR_HPMCOUNTER9 0xc09 +#define CSR_HPMCOUNTER10 0xc0a +#define CSR_HPMCOUNTER11 0xc0b +#define CSR_HPMCOUNTER12 0xc0c +#define CSR_HPMCOUNTER13 0xc0d +#define CSR_HPMCOUNTER14 0xc0e +#define CSR_HPMCOUNTER15 0xc0f +#define CSR_HPMCOUNTER16 0xc10 +#define CSR_HPMCOUNTER17 0xc11 +#define CSR_HPMCOUNTER18 0xc12 +#define CSR_HPMCOUNTER19 0xc13 +#define CSR_HPMCOUNTER20 0xc14 +#define CSR_HPMCOUNTER21 0xc15 +#define CSR_HPMCOUNTER22 0xc16 +#define CSR_HPMCOUNTER23 0xc17 +#define CSR_HPMCOUNTER24 0xc18 +#define CSR_HPMCOUNTER25 0xc19 +#define CSR_HPMCOUNTER26 0xc1a +#define CSR_HPMCOUNTER27 0xc1b +#define CSR_HPMCOUNTER28 0xc1c +#define CSR_HPMCOUNTER29 0xc1d +#define CSR_HPMCOUNTER30 0xc1e +#define CSR_HPMCOUNTER31 0xc1f +#define CSR_SSTATUS 0x100 +#define CSR_SIE 0x104 +#define CSR_STVEC 0x105 +#define CSR_SCOUNTEREN 0x106 +#define CSR_SSCRATCH 0x140 +#define CSR_SEPC 0x141 +#define CSR_SCAUSE 0x142 +#define CSR_STVAL 0x143 +#define CSR_SIP 0x144 +#define CSR_SATP 0x180 +#define CSR_MSTATUS 0x300 +#define CSR_MISA 0x301 +#define CSR_MEDELEG 0x302 +#define CSR_MIDELEG 0x303 +#define CSR_MIE 0x304 +#define CSR_MTVEC 0x305 +#define CSR_MCOUNTEREN 0x306 +#define CSR_MSCRATCH 0x340 +#define CSR_MEPC 0x341 +#define CSR_MCAUSE 0x342 +#define CSR_MTVAL 0x343 +#define CSR_MIP 0x344 +#define CSR_PMPCFG0 0x3a0 +#define CSR_PMPCFG1 0x3a1 +#define CSR_PMPCFG2 0x3a2 +#define CSR_PMPCFG3 0x3a3 +#define CSR_PMPADDR0 0x3b0 +#define CSR_PMPADDR1 0x3b1 +#define CSR_PMPADDR2 0x3b2 +#define CSR_PMPADDR3 0x3b3 +#define CSR_PMPADDR4 0x3b4 +#define CSR_PMPADDR5 0x3b5 +#define CSR_PMPADDR6 0x3b6 +#define CSR_PMPADDR7 0x3b7 +#define CSR_PMPADDR8 0x3b8 +#define CSR_PMPADDR9 0x3b9 +#define CSR_PMPADDR10 0x3ba +#define CSR_PMPADDR11 0x3bb +#define CSR_PMPADDR12 0x3bc +#define CSR_PMPADDR13 0x3bd +#define CSR_PMPADDR14 0x3be +#define CSR_PMPADDR15 0x3bf +#define CSR_TSELECT 0x7a0 +#define CSR_TDATA1 0x7a1 +#define CSR_TDATA2 0x7a2 +#define CSR_TDATA3 0x7a3 +#define CSR_DCSR 0x7b0 +#define CSR_DPC 0x7b1 +#define CSR_DSCRATCH 0x7b2 +#define CSR_MCYCLE 0xb00 +#define CSR_MINSTRET 0xb02 +#define CSR_MHPMCOUNTER3 0xb03 +#define CSR_MHPMCOUNTER4 0xb04 +#define CSR_MHPMCOUNTER5 0xb05 +#define CSR_MHPMCOUNTER6 0xb06 +#define CSR_MHPMCOUNTER7 0xb07 +#define CSR_MHPMCOUNTER8 0xb08 +#define CSR_MHPMCOUNTER9 0xb09 +#define CSR_MHPMCOUNTER10 0xb0a +#define CSR_MHPMCOUNTER11 0xb0b +#define CSR_MHPMCOUNTER12 0xb0c +#define CSR_MHPMCOUNTER13 0xb0d +#define CSR_MHPMCOUNTER14 0xb0e +#define CSR_MHPMCOUNTER15 0xb0f +#define CSR_MHPMCOUNTER16 0xb10 +#define CSR_MHPMCOUNTER17 0xb11 +#define CSR_MHPMCOUNTER18 0xb12 +#define CSR_MHPMCOUNTER19 0xb13 +#define CSR_MHPMCOUNTER20 0xb14 +#define CSR_MHPMCOUNTER21 0xb15 +#define CSR_MHPMCOUNTER22 0xb16 +#define CSR_MHPMCOUNTER23 0xb17 +#define CSR_MHPMCOUNTER24 0xb18 +#define CSR_MHPMCOUNTER25 0xb19 +#define CSR_MHPMCOUNTER26 0xb1a +#define CSR_MHPMCOUNTER27 0xb1b +#define CSR_MHPMCOUNTER28 0xb1c +#define CSR_MHPMCOUNTER29 0xb1d +#define CSR_MHPMCOUNTER30 0xb1e +#define CSR_MHPMCOUNTER31 0xb1f +#define CSR_MHPMEVENT3 0x323 +#define CSR_MHPMEVENT4 0x324 +#define CSR_MHPMEVENT5 0x325 +#define CSR_MHPMEVENT6 0x326 +#define CSR_MHPMEVENT7 0x327 +#define CSR_MHPMEVENT8 0x328 +#define CSR_MHPMEVENT9 0x329 +#define CSR_MHPMEVENT10 0x32a +#define CSR_MHPMEVENT11 0x32b +#define CSR_MHPMEVENT12 0x32c +#define CSR_MHPMEVENT13 0x32d +#define CSR_MHPMEVENT14 0x32e +#define CSR_MHPMEVENT15 0x32f +#define CSR_MHPMEVENT16 0x330 +#define CSR_MHPMEVENT17 0x331 +#define CSR_MHPMEVENT18 0x332 +#define CSR_MHPMEVENT19 0x333 +#define CSR_MHPMEVENT20 0x334 +#define CSR_MHPMEVENT21 0x335 +#define CSR_MHPMEVENT22 0x336 +#define CSR_MHPMEVENT23 0x337 +#define CSR_MHPMEVENT24 0x338 +#define CSR_MHPMEVENT25 0x339 +#define CSR_MHPMEVENT26 0x33a +#define CSR_MHPMEVENT27 0x33b +#define CSR_MHPMEVENT28 0x33c +#define CSR_MHPMEVENT29 0x33d +#define CSR_MHPMEVENT30 0x33e +#define CSR_MHPMEVENT31 0x33f +#define CSR_MVENDORID 0xf11 +#define CSR_MARCHID 0xf12 +#define CSR_MIMPID 0xf13 +#define CSR_MHARTID 0xf14 +#define CSR_CYCLEH 0xc80 +#define CSR_TIMEH 0xc81 +#define CSR_INSTRETH 0xc82 +#define CSR_HPMCOUNTER3H 0xc83 +#define CSR_HPMCOUNTER4H 0xc84 +#define CSR_HPMCOUNTER5H 0xc85 +#define CSR_HPMCOUNTER6H 0xc86 +#define CSR_HPMCOUNTER7H 0xc87 +#define CSR_HPMCOUNTER8H 0xc88 +#define CSR_HPMCOUNTER9H 0xc89 +#define CSR_HPMCOUNTER10H 0xc8a +#define CSR_HPMCOUNTER11H 0xc8b +#define CSR_HPMCOUNTER12H 0xc8c +#define CSR_HPMCOUNTER13H 0xc8d +#define CSR_HPMCOUNTER14H 0xc8e +#define CSR_HPMCOUNTER15H 0xc8f +#define CSR_HPMCOUNTER16H 0xc90 +#define CSR_HPMCOUNTER17H 0xc91 +#define CSR_HPMCOUNTER18H 0xc92 +#define CSR_HPMCOUNTER19H 0xc93 +#define CSR_HPMCOUNTER20H 0xc94 +#define CSR_HPMCOUNTER21H 0xc95 +#define CSR_HPMCOUNTER22H 0xc96 +#define CSR_HPMCOUNTER23H 0xc97 +#define CSR_HPMCOUNTER24H 0xc98 +#define CSR_HPMCOUNTER25H 0xc99 +#define CSR_HPMCOUNTER26H 0xc9a +#define CSR_HPMCOUNTER27H 0xc9b +#define CSR_HPMCOUNTER28H 0xc9c +#define CSR_HPMCOUNTER29H 0xc9d +#define CSR_HPMCOUNTER30H 0xc9e +#define CSR_HPMCOUNTER31H 0xc9f +#define CSR_MCYCLEH 0xb80 +#define CSR_MINSTRETH 0xb82 +#define CSR_MHPMCOUNTER3H 0xb83 +#define CSR_MHPMCOUNTER4H 0xb84 +#define CSR_MHPMCOUNTER5H 0xb85 +#define CSR_MHPMCOUNTER6H 0xb86 +#define CSR_MHPMCOUNTER7H 0xb87 +#define CSR_MHPMCOUNTER8H 0xb88 +#define CSR_MHPMCOUNTER9H 0xb89 +#define CSR_MHPMCOUNTER10H 0xb8a +#define CSR_MHPMCOUNTER11H 0xb8b +#define CSR_MHPMCOUNTER12H 0xb8c +#define CSR_MHPMCOUNTER13H 0xb8d +#define CSR_MHPMCOUNTER14H 0xb8e +#define CSR_MHPMCOUNTER15H 0xb8f +#define CSR_MHPMCOUNTER16H 0xb90 +#define CSR_MHPMCOUNTER17H 0xb91 +#define CSR_MHPMCOUNTER18H 0xb92 +#define CSR_MHPMCOUNTER19H 0xb93 +#define CSR_MHPMCOUNTER20H 0xb94 +#define CSR_MHPMCOUNTER21H 0xb95 +#define CSR_MHPMCOUNTER22H 0xb96 +#define CSR_MHPMCOUNTER23H 0xb97 +#define CSR_MHPMCOUNTER24H 0xb98 +#define CSR_MHPMCOUNTER25H 0xb99 +#define CSR_MHPMCOUNTER26H 0xb9a +#define CSR_MHPMCOUNTER27H 0xb9b +#define CSR_MHPMCOUNTER28H 0xb9c +#define CSR_MHPMCOUNTER29H 0xb9d +#define CSR_MHPMCOUNTER30H 0xb9e +#define CSR_MHPMCOUNTER31H 0xb9f +#define CAUSE_MISALIGNED_FETCH 0x0 +#define CAUSE_FETCH_ACCESS 0x1 +#define CAUSE_ILLEGAL_INSTRUCTION 0x2 +#define CAUSE_BREAKPOINT 0x3 +#define CAUSE_MISALIGNED_LOAD 0x4 +#define CAUSE_LOAD_ACCESS 0x5 +#define CAUSE_MISALIGNED_STORE 0x6 +#define CAUSE_STORE_ACCESS 0x7 +#define CAUSE_USER_ECALL 0x8 +#define CAUSE_SUPERVISOR_ECALL 0x9 +#define CAUSE_HYPERVISOR_ECALL 0xa +#define CAUSE_MACHINE_ECALL 0xb +#define CAUSE_FETCH_PAGE_FAULT 0xc +#define CAUSE_LOAD_PAGE_FAULT 0xd +#define CAUSE_STORE_PAGE_FAULT 0xf +#endif +#ifdef DECLARE_INSN +DECLARE_INSN(beq, MATCH_BEQ, MASK_BEQ) +DECLARE_INSN(bne, MATCH_BNE, MASK_BNE) +DECLARE_INSN(blt, MATCH_BLT, MASK_BLT) +DECLARE_INSN(bge, MATCH_BGE, MASK_BGE) +DECLARE_INSN(bltu, MATCH_BLTU, MASK_BLTU) +DECLARE_INSN(bgeu, MATCH_BGEU, MASK_BGEU) +DECLARE_INSN(jalr, MATCH_JALR, MASK_JALR) +DECLARE_INSN(jal, MATCH_JAL, MASK_JAL) +DECLARE_INSN(lui, MATCH_LUI, MASK_LUI) +DECLARE_INSN(auipc, MATCH_AUIPC, MASK_AUIPC) +DECLARE_INSN(addi, MATCH_ADDI, MASK_ADDI) +DECLARE_INSN(slli, MATCH_SLLI, MASK_SLLI) +DECLARE_INSN(slti, MATCH_SLTI, MASK_SLTI) +DECLARE_INSN(sltiu, MATCH_SLTIU, MASK_SLTIU) +DECLARE_INSN(xori, MATCH_XORI, MASK_XORI) +DECLARE_INSN(srli, MATCH_SRLI, MASK_SRLI) +DECLARE_INSN(srai, MATCH_SRAI, MASK_SRAI) +DECLARE_INSN(ori, MATCH_ORI, MASK_ORI) +DECLARE_INSN(andi, MATCH_ANDI, MASK_ANDI) +DECLARE_INSN(add, MATCH_ADD, MASK_ADD) +DECLARE_INSN(sub, MATCH_SUB, MASK_SUB) +DECLARE_INSN(sll, MATCH_SLL, MASK_SLL) +DECLARE_INSN(slt, MATCH_SLT, MASK_SLT) +DECLARE_INSN(sltu, MATCH_SLTU, MASK_SLTU) +DECLARE_INSN(xor, MATCH_XOR, MASK_XOR) +DECLARE_INSN(srl, MATCH_SRL, MASK_SRL) +DECLARE_INSN(sra, MATCH_SRA, MASK_SRA) +DECLARE_INSN(or, MATCH_OR, MASK_OR) +DECLARE_INSN(and, MATCH_AND, MASK_AND) +DECLARE_INSN(addiw, MATCH_ADDIW, MASK_ADDIW) +DECLARE_INSN(slliw, MATCH_SLLIW, MASK_SLLIW) +DECLARE_INSN(srliw, MATCH_SRLIW, MASK_SRLIW) +DECLARE_INSN(sraiw, MATCH_SRAIW, MASK_SRAIW) +DECLARE_INSN(addw, MATCH_ADDW, MASK_ADDW) +DECLARE_INSN(subw, MATCH_SUBW, MASK_SUBW) +DECLARE_INSN(sllw, MATCH_SLLW, MASK_SLLW) +DECLARE_INSN(srlw, MATCH_SRLW, MASK_SRLW) +DECLARE_INSN(sraw, MATCH_SRAW, MASK_SRAW) +DECLARE_INSN(lb, MATCH_LB, MASK_LB) +DECLARE_INSN(lh, MATCH_LH, MASK_LH) +DECLARE_INSN(lw, MATCH_LW, MASK_LW) +DECLARE_INSN(ld, MATCH_LD, MASK_LD) +DECLARE_INSN(lbu, MATCH_LBU, MASK_LBU) +DECLARE_INSN(lhu, MATCH_LHU, MASK_LHU) +DECLARE_INSN(lwu, MATCH_LWU, MASK_LWU) +DECLARE_INSN(sb, MATCH_SB, MASK_SB) +DECLARE_INSN(sh, MATCH_SH, MASK_SH) +DECLARE_INSN(sw, MATCH_SW, MASK_SW) +DECLARE_INSN(sd, MATCH_SD, MASK_SD) +DECLARE_INSN(fence, MATCH_FENCE, MASK_FENCE) +DECLARE_INSN(fence_i, MATCH_FENCE_I, MASK_FENCE_I) +DECLARE_INSN(mul, MATCH_MUL, MASK_MUL) +DECLARE_INSN(mulh, MATCH_MULH, MASK_MULH) +DECLARE_INSN(mulhsu, MATCH_MULHSU, MASK_MULHSU) +DECLARE_INSN(mulhu, MATCH_MULHU, MASK_MULHU) +DECLARE_INSN(div, MATCH_DIV, MASK_DIV) +DECLARE_INSN(divu, MATCH_DIVU, MASK_DIVU) +DECLARE_INSN(rem, MATCH_REM, MASK_REM) +DECLARE_INSN(remu, MATCH_REMU, MASK_REMU) +DECLARE_INSN(mulw, MATCH_MULW, MASK_MULW) +DECLARE_INSN(divw, MATCH_DIVW, MASK_DIVW) +DECLARE_INSN(divuw, MATCH_DIVUW, MASK_DIVUW) +DECLARE_INSN(remw, MATCH_REMW, MASK_REMW) +DECLARE_INSN(remuw, MATCH_REMUW, MASK_REMUW) +DECLARE_INSN(amoadd_w, MATCH_AMOADD_W, MASK_AMOADD_W) +DECLARE_INSN(amoxor_w, MATCH_AMOXOR_W, MASK_AMOXOR_W) +DECLARE_INSN(amoor_w, MATCH_AMOOR_W, MASK_AMOOR_W) +DECLARE_INSN(amoand_w, MATCH_AMOAND_W, MASK_AMOAND_W) +DECLARE_INSN(amomin_w, MATCH_AMOMIN_W, MASK_AMOMIN_W) +DECLARE_INSN(amomax_w, MATCH_AMOMAX_W, MASK_AMOMAX_W) +DECLARE_INSN(amominu_w, MATCH_AMOMINU_W, MASK_AMOMINU_W) +DECLARE_INSN(amomaxu_w, MATCH_AMOMAXU_W, MASK_AMOMAXU_W) +DECLARE_INSN(amoswap_w, MATCH_AMOSWAP_W, MASK_AMOSWAP_W) +DECLARE_INSN(lr_w, MATCH_LR_W, MASK_LR_W) +DECLARE_INSN(sc_w, MATCH_SC_W, MASK_SC_W) +DECLARE_INSN(amoadd_d, MATCH_AMOADD_D, MASK_AMOADD_D) +DECLARE_INSN(amoxor_d, MATCH_AMOXOR_D, MASK_AMOXOR_D) +DECLARE_INSN(amoor_d, MATCH_AMOOR_D, MASK_AMOOR_D) +DECLARE_INSN(amoand_d, MATCH_AMOAND_D, MASK_AMOAND_D) +DECLARE_INSN(amomin_d, MATCH_AMOMIN_D, MASK_AMOMIN_D) +DECLARE_INSN(amomax_d, MATCH_AMOMAX_D, MASK_AMOMAX_D) +DECLARE_INSN(amominu_d, MATCH_AMOMINU_D, MASK_AMOMINU_D) +DECLARE_INSN(amomaxu_d, MATCH_AMOMAXU_D, MASK_AMOMAXU_D) +DECLARE_INSN(amoswap_d, MATCH_AMOSWAP_D, MASK_AMOSWAP_D) +DECLARE_INSN(lr_d, MATCH_LR_D, MASK_LR_D) +DECLARE_INSN(sc_d, MATCH_SC_D, MASK_SC_D) +DECLARE_INSN(ecall, MATCH_ECALL, MASK_ECALL) +DECLARE_INSN(ebreak, MATCH_EBREAK, MASK_EBREAK) +DECLARE_INSN(uret, MATCH_URET, MASK_URET) +DECLARE_INSN(sret, MATCH_SRET, MASK_SRET) +DECLARE_INSN(mret, MATCH_MRET, MASK_MRET) +DECLARE_INSN(dret, MATCH_DRET, MASK_DRET) +DECLARE_INSN(sfence_vma, MATCH_SFENCE_VMA, MASK_SFENCE_VMA) +DECLARE_INSN(wfi, MATCH_WFI, MASK_WFI) +DECLARE_INSN(csrrw, MATCH_CSRRW, MASK_CSRRW) +DECLARE_INSN(csrrs, MATCH_CSRRS, MASK_CSRRS) +DECLARE_INSN(csrrc, MATCH_CSRRC, MASK_CSRRC) +DECLARE_INSN(csrrwi, MATCH_CSRRWI, MASK_CSRRWI) +DECLARE_INSN(csrrsi, MATCH_CSRRSI, MASK_CSRRSI) +DECLARE_INSN(csrrci, MATCH_CSRRCI, MASK_CSRRCI) +DECLARE_INSN(fadd_s, MATCH_FADD_S, MASK_FADD_S) +DECLARE_INSN(fsub_s, MATCH_FSUB_S, MASK_FSUB_S) +DECLARE_INSN(fmul_s, MATCH_FMUL_S, MASK_FMUL_S) +DECLARE_INSN(fdiv_s, MATCH_FDIV_S, MASK_FDIV_S) +DECLARE_INSN(fsgnj_s, MATCH_FSGNJ_S, MASK_FSGNJ_S) +DECLARE_INSN(fsgnjn_s, MATCH_FSGNJN_S, MASK_FSGNJN_S) +DECLARE_INSN(fsgnjx_s, MATCH_FSGNJX_S, MASK_FSGNJX_S) +DECLARE_INSN(fmin_s, MATCH_FMIN_S, MASK_FMIN_S) +DECLARE_INSN(fmax_s, MATCH_FMAX_S, MASK_FMAX_S) +DECLARE_INSN(fsqrt_s, MATCH_FSQRT_S, MASK_FSQRT_S) +DECLARE_INSN(fadd_d, MATCH_FADD_D, MASK_FADD_D) +DECLARE_INSN(fsub_d, MATCH_FSUB_D, MASK_FSUB_D) +DECLARE_INSN(fmul_d, MATCH_FMUL_D, MASK_FMUL_D) +DECLARE_INSN(fdiv_d, MATCH_FDIV_D, MASK_FDIV_D) +DECLARE_INSN(fsgnj_d, MATCH_FSGNJ_D, MASK_FSGNJ_D) +DECLARE_INSN(fsgnjn_d, MATCH_FSGNJN_D, MASK_FSGNJN_D) +DECLARE_INSN(fsgnjx_d, MATCH_FSGNJX_D, MASK_FSGNJX_D) +DECLARE_INSN(fmin_d, MATCH_FMIN_D, MASK_FMIN_D) +DECLARE_INSN(fmax_d, MATCH_FMAX_D, MASK_FMAX_D) +DECLARE_INSN(fcvt_s_d, MATCH_FCVT_S_D, MASK_FCVT_S_D) +DECLARE_INSN(fcvt_d_s, MATCH_FCVT_D_S, MASK_FCVT_D_S) +DECLARE_INSN(fsqrt_d, MATCH_FSQRT_D, MASK_FSQRT_D) +DECLARE_INSN(fadd_q, MATCH_FADD_Q, MASK_FADD_Q) +DECLARE_INSN(fsub_q, MATCH_FSUB_Q, MASK_FSUB_Q) +DECLARE_INSN(fmul_q, MATCH_FMUL_Q, MASK_FMUL_Q) +DECLARE_INSN(fdiv_q, MATCH_FDIV_Q, MASK_FDIV_Q) +DECLARE_INSN(fsgnj_q, MATCH_FSGNJ_Q, MASK_FSGNJ_Q) +DECLARE_INSN(fsgnjn_q, MATCH_FSGNJN_Q, MASK_FSGNJN_Q) +DECLARE_INSN(fsgnjx_q, MATCH_FSGNJX_Q, MASK_FSGNJX_Q) +DECLARE_INSN(fmin_q, MATCH_FMIN_Q, MASK_FMIN_Q) +DECLARE_INSN(fmax_q, MATCH_FMAX_Q, MASK_FMAX_Q) +DECLARE_INSN(fcvt_s_q, MATCH_FCVT_S_Q, MASK_FCVT_S_Q) +DECLARE_INSN(fcvt_q_s, MATCH_FCVT_Q_S, MASK_FCVT_Q_S) +DECLARE_INSN(fcvt_d_q, MATCH_FCVT_D_Q, MASK_FCVT_D_Q) +DECLARE_INSN(fcvt_q_d, MATCH_FCVT_Q_D, MASK_FCVT_Q_D) +DECLARE_INSN(fsqrt_q, MATCH_FSQRT_Q, MASK_FSQRT_Q) +DECLARE_INSN(fle_s, MATCH_FLE_S, MASK_FLE_S) +DECLARE_INSN(flt_s, MATCH_FLT_S, MASK_FLT_S) +DECLARE_INSN(feq_s, MATCH_FEQ_S, MASK_FEQ_S) +DECLARE_INSN(fle_d, MATCH_FLE_D, MASK_FLE_D) +DECLARE_INSN(flt_d, MATCH_FLT_D, MASK_FLT_D) +DECLARE_INSN(feq_d, MATCH_FEQ_D, MASK_FEQ_D) +DECLARE_INSN(fle_q, MATCH_FLE_Q, MASK_FLE_Q) +DECLARE_INSN(flt_q, MATCH_FLT_Q, MASK_FLT_Q) +DECLARE_INSN(feq_q, MATCH_FEQ_Q, MASK_FEQ_Q) +DECLARE_INSN(fcvt_w_s, MATCH_FCVT_W_S, MASK_FCVT_W_S) +DECLARE_INSN(fcvt_wu_s, MATCH_FCVT_WU_S, MASK_FCVT_WU_S) +DECLARE_INSN(fcvt_l_s, MATCH_FCVT_L_S, MASK_FCVT_L_S) +DECLARE_INSN(fcvt_lu_s, MATCH_FCVT_LU_S, MASK_FCVT_LU_S) +DECLARE_INSN(fmv_x_w, MATCH_FMV_X_W, MASK_FMV_X_W) +DECLARE_INSN(fclass_s, MATCH_FCLASS_S, MASK_FCLASS_S) +DECLARE_INSN(fcvt_w_d, MATCH_FCVT_W_D, MASK_FCVT_W_D) +DECLARE_INSN(fcvt_wu_d, MATCH_FCVT_WU_D, MASK_FCVT_WU_D) +DECLARE_INSN(fcvt_l_d, MATCH_FCVT_L_D, MASK_FCVT_L_D) +DECLARE_INSN(fcvt_lu_d, MATCH_FCVT_LU_D, MASK_FCVT_LU_D) +DECLARE_INSN(fmv_x_d, MATCH_FMV_X_D, MASK_FMV_X_D) +DECLARE_INSN(fclass_d, MATCH_FCLASS_D, MASK_FCLASS_D) +DECLARE_INSN(fcvt_w_q, MATCH_FCVT_W_Q, MASK_FCVT_W_Q) +DECLARE_INSN(fcvt_wu_q, MATCH_FCVT_WU_Q, MASK_FCVT_WU_Q) +DECLARE_INSN(fcvt_l_q, MATCH_FCVT_L_Q, MASK_FCVT_L_Q) +DECLARE_INSN(fcvt_lu_q, MATCH_FCVT_LU_Q, MASK_FCVT_LU_Q) +DECLARE_INSN(fmv_x_q, MATCH_FMV_X_Q, MASK_FMV_X_Q) +DECLARE_INSN(fclass_q, MATCH_FCLASS_Q, MASK_FCLASS_Q) +DECLARE_INSN(fcvt_s_w, MATCH_FCVT_S_W, MASK_FCVT_S_W) +DECLARE_INSN(fcvt_s_wu, MATCH_FCVT_S_WU, MASK_FCVT_S_WU) +DECLARE_INSN(fcvt_s_l, MATCH_FCVT_S_L, MASK_FCVT_S_L) +DECLARE_INSN(fcvt_s_lu, MATCH_FCVT_S_LU, MASK_FCVT_S_LU) +DECLARE_INSN(fmv_w_x, MATCH_FMV_W_X, MASK_FMV_W_X) +DECLARE_INSN(fcvt_d_w, MATCH_FCVT_D_W, MASK_FCVT_D_W) +DECLARE_INSN(fcvt_d_wu, MATCH_FCVT_D_WU, MASK_FCVT_D_WU) +DECLARE_INSN(fcvt_d_l, MATCH_FCVT_D_L, MASK_FCVT_D_L) +DECLARE_INSN(fcvt_d_lu, MATCH_FCVT_D_LU, MASK_FCVT_D_LU) +DECLARE_INSN(fmv_d_x, MATCH_FMV_D_X, MASK_FMV_D_X) +DECLARE_INSN(fcvt_q_w, MATCH_FCVT_Q_W, MASK_FCVT_Q_W) +DECLARE_INSN(fcvt_q_wu, MATCH_FCVT_Q_WU, MASK_FCVT_Q_WU) +DECLARE_INSN(fcvt_q_l, MATCH_FCVT_Q_L, MASK_FCVT_Q_L) +DECLARE_INSN(fcvt_q_lu, MATCH_FCVT_Q_LU, MASK_FCVT_Q_LU) +DECLARE_INSN(fmv_q_x, MATCH_FMV_Q_X, MASK_FMV_Q_X) +DECLARE_INSN(flw, MATCH_FLW, MASK_FLW) +DECLARE_INSN(fld, MATCH_FLD, MASK_FLD) +DECLARE_INSN(flq, MATCH_FLQ, MASK_FLQ) +DECLARE_INSN(fsw, MATCH_FSW, MASK_FSW) +DECLARE_INSN(fsd, MATCH_FSD, MASK_FSD) +DECLARE_INSN(fsq, MATCH_FSQ, MASK_FSQ) +DECLARE_INSN(fmadd_s, MATCH_FMADD_S, MASK_FMADD_S) +DECLARE_INSN(fmsub_s, MATCH_FMSUB_S, MASK_FMSUB_S) +DECLARE_INSN(fnmsub_s, MATCH_FNMSUB_S, MASK_FNMSUB_S) +DECLARE_INSN(fnmadd_s, MATCH_FNMADD_S, MASK_FNMADD_S) +DECLARE_INSN(fmadd_d, MATCH_FMADD_D, MASK_FMADD_D) +DECLARE_INSN(fmsub_d, MATCH_FMSUB_D, MASK_FMSUB_D) +DECLARE_INSN(fnmsub_d, MATCH_FNMSUB_D, MASK_FNMSUB_D) +DECLARE_INSN(fnmadd_d, MATCH_FNMADD_D, MASK_FNMADD_D) +DECLARE_INSN(fmadd_q, MATCH_FMADD_Q, MASK_FMADD_Q) +DECLARE_INSN(fmsub_q, MATCH_FMSUB_Q, MASK_FMSUB_Q) +DECLARE_INSN(fnmsub_q, MATCH_FNMSUB_Q, MASK_FNMSUB_Q) +DECLARE_INSN(fnmadd_q, MATCH_FNMADD_Q, MASK_FNMADD_Q) +DECLARE_INSN(c_nop, MATCH_C_NOP, MASK_C_NOP) +DECLARE_INSN(c_addi16sp, MATCH_C_ADDI16SP, MASK_C_ADDI16SP) +DECLARE_INSN(c_jr, MATCH_C_JR, MASK_C_JR) +DECLARE_INSN(c_jalr, MATCH_C_JALR, MASK_C_JALR) +DECLARE_INSN(c_ebreak, MATCH_C_EBREAK, MASK_C_EBREAK) +DECLARE_INSN(c_ld, MATCH_C_LD, MASK_C_LD) +DECLARE_INSN(c_sd, MATCH_C_SD, MASK_C_SD) +DECLARE_INSN(c_addiw, MATCH_C_ADDIW, MASK_C_ADDIW) +DECLARE_INSN(c_ldsp, MATCH_C_LDSP, MASK_C_LDSP) +DECLARE_INSN(c_sdsp, MATCH_C_SDSP, MASK_C_SDSP) +DECLARE_INSN(c_addi4spn, MATCH_C_ADDI4SPN, MASK_C_ADDI4SPN) +DECLARE_INSN(c_fld, MATCH_C_FLD, MASK_C_FLD) +DECLARE_INSN(c_lw, MATCH_C_LW, MASK_C_LW) +DECLARE_INSN(c_flw, MATCH_C_FLW, MASK_C_FLW) +DECLARE_INSN(c_fsd, MATCH_C_FSD, MASK_C_FSD) +DECLARE_INSN(c_sw, MATCH_C_SW, MASK_C_SW) +DECLARE_INSN(c_fsw, MATCH_C_FSW, MASK_C_FSW) +DECLARE_INSN(c_addi, MATCH_C_ADDI, MASK_C_ADDI) +DECLARE_INSN(c_jal, MATCH_C_JAL, MASK_C_JAL) +DECLARE_INSN(c_li, MATCH_C_LI, MASK_C_LI) +DECLARE_INSN(c_lui, MATCH_C_LUI, MASK_C_LUI) +DECLARE_INSN(c_srli, MATCH_C_SRLI, MASK_C_SRLI) +DECLARE_INSN(c_srai, MATCH_C_SRAI, MASK_C_SRAI) +DECLARE_INSN(c_andi, MATCH_C_ANDI, MASK_C_ANDI) +DECLARE_INSN(c_sub, MATCH_C_SUB, MASK_C_SUB) +DECLARE_INSN(c_xor, MATCH_C_XOR, MASK_C_XOR) +DECLARE_INSN(c_or, MATCH_C_OR, MASK_C_OR) +DECLARE_INSN(c_and, MATCH_C_AND, MASK_C_AND) +DECLARE_INSN(c_subw, MATCH_C_SUBW, MASK_C_SUBW) +DECLARE_INSN(c_addw, MATCH_C_ADDW, MASK_C_ADDW) +DECLARE_INSN(c_j, MATCH_C_J, MASK_C_J) +DECLARE_INSN(c_beqz, MATCH_C_BEQZ, MASK_C_BEQZ) +DECLARE_INSN(c_bnez, MATCH_C_BNEZ, MASK_C_BNEZ) +DECLARE_INSN(c_slli, MATCH_C_SLLI, MASK_C_SLLI) +DECLARE_INSN(c_fldsp, MATCH_C_FLDSP, MASK_C_FLDSP) +DECLARE_INSN(c_lwsp, MATCH_C_LWSP, MASK_C_LWSP) +DECLARE_INSN(c_flwsp, MATCH_C_FLWSP, MASK_C_FLWSP) +DECLARE_INSN(c_mv, MATCH_C_MV, MASK_C_MV) +DECLARE_INSN(c_add, MATCH_C_ADD, MASK_C_ADD) +DECLARE_INSN(c_fsdsp, MATCH_C_FSDSP, MASK_C_FSDSP) +DECLARE_INSN(c_swsp, MATCH_C_SWSP, MASK_C_SWSP) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 13 16:26: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 6073D1076EDE; Mon, 13 Aug 2018 16:26:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F68D80949; Mon, 13 Aug 2018 16:26:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E00B972E9; Mon, 13 Aug 2018 16:26:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DGQVmQ026953; Mon, 13 Aug 2018 16:26:31 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DGQRYn026925; Mon, 13 Aug 2018 16:26:27 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201808131626.w7DGQRYn026925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 13 Aug 2018 16:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337713 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/hardware sys/contrib/... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/hardware sys/contrib/dev/acpica/components/nam... X-SVN-Commit-Revision: 337713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 16:26:32 -0000 Author: jkim Date: Mon Aug 13 16:26:26 2018 New Revision: 337713 URL: https://svnweb.freebsd.org/changeset/base/337713 Log: Merge ACPICA 20180810. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/tables/tbdata.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c head/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acutils.h head/usr.sbin/acpi/acpidb/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/changes.txt Mon Aug 13 16:26:26 2018 (r337713) @@ -1,4 +1,51 @@ ---------------------------------------- +10 August 2018. Summary of changes for version 20180810: + + +1) ACPICA kernel-resident subsystem: + +Initial ACPI table loading: Attempt to continue loading ACPI tables +regardless of malformed AML. Since migrating table initialization to the +new module-level code support, the AML interpreter rejected tables upon +any ACPI error encountered during table load. This is a problem because +non-serious ACPI errors during table load do not necessarily mean that +the entire definition block (DSDT or SSDT) is invalid. This change +improves the table loading by ignoring some types of errors that can be +generated by incorrect AML. This can range from object type errors, scope +errors, and index errors. + +Suspend/Resume support: Update to stop unconditionally clearing ACPI IRQs +during suspend/resume. The status of ACPI events is no longer cleared +when entering the ACPI S5 system state (power off) which caused some +systems to power up immediately after turning off power in certain +situations. This was a functional regression. It was fixed by clearing +the status of all ACPI events again when entering S5 (for system-wide +suspend or hibernation the clearing of the status of all events is not +desirable, as it might cause the kernel to miss wakeup events sometimes). +Rafael Wysocki. + + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec: Enhanced the -fi option (Namespace initialization file). Field +elements listed in the initialization file were previously initialized +after the table load and before executing module-level code blocks. +Recent changes in the module-level code support means that the table load +becomes a large control method execution. If fields are used within +module-level code and we are executing with the -fi option, the +initialization values were used to initialize the namespace object(s) +only after the table was finished loading. This change Provides an early +initialization of objects specified in the initialization file so that +field unit values are populated during the table load (not after the +load). + +AcpiExec: Fixed a small memory leak regression that could result in +warnings during exit of the utility. These warnings were similar to +these: + 0002D690 Length 0x0006 nsnames-0502 [Not a Descriptor - too small] + 0002CD70 Length 0x002C utcache-0453 [Operand] Integer RefCount 0x0001 + +---------------------------------------- 29 June 2018. Summary of changes for version 20180629: Modified: head/sys/contrib/dev/acpica/components/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbinput.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/debugger/dbinput.c Mon Aug 13 16:26:26 2018 (r337713) @@ -969,7 +969,11 @@ AcpiDbCommandDispatch ( case CMD_DISASSEMBLE: case CMD_DISASM: +#ifdef ACPI_DISASSEMBLER (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]); +#else + AcpiOsPrintf ("The AML Disassembler is not configured/present\n"); +#endif break; case CMD_DUMP: @@ -1083,7 +1087,11 @@ AcpiDbCommandDispatch ( case CMD_LIST: - AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op); +#ifdef ACPI_DISASSEMBLER + AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op);; +#else + AcpiOsPrintf ("The AML Disassembler is not configured/present\n"); +#endif break; case CMD_LOCKS: Modified: head/sys/contrib/dev/acpica/components/debugger/dbmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbmethod.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/debugger/dbmethod.c Mon Aug 13 16:26:26 2018 (r337713) @@ -393,6 +393,7 @@ Cleanup: } +#ifdef ACPI_DISASSEMBLER /******************************************************************************* * * FUNCTION: AcpiDbDisassembleAml @@ -426,9 +427,7 @@ AcpiDbDisassembleAml ( NumStatements = strtoul (Statements, NULL, 0); } -#ifdef ACPI_DISASSEMBLER AcpiDmDisassemble (NULL, Op, NumStatements); -#endif } @@ -511,8 +510,6 @@ AcpiDbDisassembleMethod ( WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; Status = AcpiPsParseAml (WalkState); - -#ifdef ACPI_DISASSEMBLER (void) AcpiDmParseDeferredOps (Op); /* Now we can disassemble the method */ @@ -520,7 +517,6 @@ AcpiDbDisassembleMethod ( AcpiGbl_DmOpt_Verbose = FALSE; AcpiDmDisassemble (NULL, Op, 0); AcpiGbl_DmOpt_Verbose = TRUE; -#endif AcpiPsDeleteParseTree (Op); @@ -531,6 +527,7 @@ AcpiDbDisassembleMethod ( AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId); return (AE_OK); } +#endif /******************************************************************************* Modified: head/sys/contrib/dev/acpica/components/debugger/dbxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbxface.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/debugger/dbxface.c Mon Aug 13 16:26:26 2018 (r337713) @@ -154,6 +154,7 @@ #include #include #include +#include #define _COMPONENT ACPI_CA_DEBUGGER @@ -435,10 +436,17 @@ AcpiDbSingleStep ( } } - /* Now we can display it */ + /* Now we can disassemble and display it */ #ifdef ACPI_DISASSEMBLER AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX); +#else + /* + * The AML Disassembler is not configured - at least we can + * display the opcode value and name + */ + AcpiOsPrintf ("AML Opcode: %4.4X %s\n", Op->Common.AmlOpcode, + AcpiPsGetOpcodeName (Op->Common.AmlOpcode)); #endif if ((Op->Common.AmlOpcode == AML_IF_OP) || Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Mon Aug 13 16:26:26 2018 (r337713) @@ -157,7 +157,11 @@ #include #include +#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP) +#include "aecommon.h" +#endif + #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsfield") @@ -430,7 +434,14 @@ AcpiDsGetFieldNames ( UINT64 Position; ACPI_PARSE_OBJECT *Child; +#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP) + UINT64 Value = 0; + ACPI_OPERAND_OBJECT *ResultDesc; + ACPI_OPERAND_OBJECT *ObjDesc; + char *NamePath; +#endif + ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info); @@ -564,6 +575,18 @@ AcpiDsGetFieldNames ( { return_ACPI_STATUS (Status); } +#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP) + NamePath = AcpiNsGetExternalPathname (Info->FieldNode); + ObjDesc = AcpiUtCreateIntegerObject (Value); + if (ACPI_SUCCESS (AeLookupInitFileEntry (NamePath, &Value))) + { + AcpiExWriteDataToField (ObjDesc, + AcpiNsGetAttachedObject (Info->FieldNode), + &ResultDesc); + } + AcpiUtRemoveReference (ObjDesc); + ACPI_FREE (NamePath); +#endif } } @@ -756,6 +779,9 @@ AcpiDsInitFieldObjects ( Flags |= ACPI_NS_TEMPORARY; } +#ifdef ACPI_EXEC_APP + Flags |= ACPI_NS_OVERRIDE_IF_FOUND; +#endif /* * Walk the list of entries in the FieldList * Note: FieldList can be of zero length. In this case, Arg will be NULL. Modified: head/sys/contrib/dev/acpica/components/hardware/hwregs.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwregs.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/hardware/hwregs.c Mon Aug 13 16:26:26 2018 (r337713) @@ -724,13 +724,20 @@ AcpiHwRegisterRead ( case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPm2ControlBlock); - Value = (UINT32) Value64; + if (ACPI_SUCCESS (Status)) + { + Value = (UINT32) Value64; + } break; case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPmTimerBlock); - Value = (UINT32) Value64; + if (ACPI_SUCCESS (Status)) + { + Value = (UINT32) Value64; + } + break; case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ Modified: head/sys/contrib/dev/acpica/components/hardware/hwsleep.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwsleep.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/hardware/hwsleep.c Mon Aug 13 16:26:26 2018 (r337713) @@ -198,16 +198,27 @@ AcpiHwLegacySleep ( return_ACPI_STATUS (Status); } - /* - * 1) Disable all GPEs - * 2) Enable all wakeup GPEs - */ + /* Disable all GPEs */ + Status = AcpiHwDisableAllGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } + /* + * If the target sleep state is S5, clear all GPEs and fixed events too + */ + if (SleepState == ACPI_STATE_S5) + { + Status = AcpiHwClearAcpiStatus(); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } AcpiGbl_SystemAwakeAndRunning = FALSE; + + /* Enable all wakeup GPEs */ Status = AcpiHwEnableAllWakeupGpes (); if (ACPI_FAILURE (Status)) Modified: head/sys/contrib/dev/acpica/components/namespace/nsaccess.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsaccess.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/namespace/nsaccess.c Mon Aug 13 16:26:26 2018 (r337713) @@ -724,6 +724,15 @@ AcpiNsLookup ( CurrentNode)); } +#ifdef ACPI_EXEC_APP + if ((Status == AE_ALREADY_EXISTS) && + (ThisNode->Flags & ANOBJ_NODE_EARLY_INIT)) + { + ThisNode->Flags &= ~ANOBJ_NODE_EARLY_INIT; + Status = AE_OK; + } +#endif + #ifdef ACPI_ASL_COMPILER /* * If this ACPI name already exists within the namespace as an @@ -844,6 +853,13 @@ AcpiNsLookup ( } } } + +#ifdef ACPI_EXEC_APP + if (Flags & ACPI_NS_EARLY_INIT) + { + ThisNode->Flags |= ANOBJ_NODE_EARLY_INIT; + } +#endif *ReturnNode = ThisNode; return_ACPI_STATUS (AE_OK); Modified: head/sys/contrib/dev/acpica/components/parser/psloop.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psloop.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/parser/psloop.c Mon Aug 13 16:26:26 2018 (r337713) @@ -164,6 +164,7 @@ #include #include #include +#include #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psloop") @@ -645,6 +646,18 @@ AcpiPsParseLoop ( Status = AcpiPsCreateOp (WalkState, AmlOpStart, &Op); if (ACPI_FAILURE (Status)) { + /* + * ACPI_PARSE_MODULE_LEVEL means that we are loading a table by + * executing it as a control method. However, if we encounter + * an error while loading the table, we need to keep trying to + * load the table rather than aborting the table load. Set the + * status to AE_OK to proceed with the table load. + */ + if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) && + Status == AE_ALREADY_EXISTS) + { + Status = AE_OK; + } if (Status == AE_CTRL_PARSE_CONTINUE) { continue; @@ -665,18 +678,20 @@ AcpiPsParseLoop ( { return_ACPI_STATUS (Status); } - if (WalkState->Opcode == AML_SCOPE_OP) + if (AcpiNsOpensScope ( + AcpiPsGetOpcodeInfo (WalkState->Opcode)->ObjectType)) { /* - * If the scope op fails to parse, skip the body of the - * scope op because the parse failure indicates that the - * device may not exist. + * If the scope/device op fails to parse, skip the body of + * the scope op because the parse failure indicates that + * the device may not exist. */ + ACPI_ERROR ((AE_INFO, "Skip parsing opcode %s", + AcpiPsGetOpcodeName (WalkState->Opcode))); WalkState->ParserState.Aml = WalkState->Aml + 1; WalkState->ParserState.Aml = AcpiPsGetNextPackageEnd(&WalkState->ParserState); WalkState->Aml = WalkState->ParserState.Aml; - ACPI_ERROR ((AE_INFO, "Skipping Scope block")); } continue; @@ -832,6 +847,22 @@ AcpiPsParseLoop ( Status = AcpiPsNextParseState (WalkState, Op, Status); if (Status == AE_CTRL_PENDING) { + Status = AE_OK; + } + else if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) && + (ACPI_AML_EXCEPTION(Status) || Status == AE_ALREADY_EXISTS || + Status == AE_NOT_FOUND)) + { + /* + * ACPI_PARSE_MODULE_LEVEL flag means that we are currently + * loading a table by executing it as a control method. + * However, if we encounter an error while loading the table, + * we need to keep trying to load the table rather than + * aborting the table load (setting the status to AE_OK + * continues the table load). If we get a failure at this + * point, it means that the dispatcher got an error while + * trying to execute the Op. + */ Status = AE_OK; } } Modified: head/sys/contrib/dev/acpica/components/tables/tbdata.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbdata.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/tables/tbdata.c Mon Aug 13 16:26:26 2018 (r337713) @@ -711,9 +711,9 @@ AcpiTbVerifyTempTable ( { if (Status != AE_CTRL_TERMINATE) { - ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, + ACPI_EXCEPTION ((AE_INFO, Status, "%4.4s 0x%8.8X%8.8X" - " Table is duplicated", + " Table is already loaded", AcpiUtValidNameseg (TableDesc->Signature.Ascii) ? TableDesc->Signature.Ascii : "????", ACPI_FORMAT_UINT64 (TableDesc->Address))); Modified: head/sys/contrib/dev/acpica/components/utilities/utdelete.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/utdelete.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/utilities/utdelete.c Mon Aug 13 16:26:26 2018 (r337713) @@ -520,6 +520,7 @@ AcpiUtUpdateRefCount ( UINT16 OriginalCount; UINT16 NewCount = 0; ACPI_CPU_FLAGS LockFlags; + char *Message; ACPI_FUNCTION_NAME (UtUpdateRefCount); @@ -560,6 +561,7 @@ AcpiUtUpdateRefCount ( "Obj %p Type %.2X [%s] Refs %.2X [Incremented]\n", Object, Object->Common.Type, AcpiUtGetObjectTypeName (Object), NewCount)); + Message = "Incremement"; break; case REF_DECREMENT: @@ -591,6 +593,7 @@ AcpiUtUpdateRefCount ( { AcpiUtDeleteInternalObj (Object); } + Message = "Decrement"; break; default: @@ -608,8 +611,8 @@ AcpiUtUpdateRefCount ( if (NewCount > ACPI_MAX_REFERENCE_COUNT) { ACPI_WARNING ((AE_INFO, - "Large Reference Count (0x%X) in object %p, Type=0x%.2X", - NewCount, Object, Object->Common.Type)); + "Large Reference Count (0x%X) in object %p, Type=0x%.2X Operation=%s", + NewCount, Object, Object->Common.Type, Message)); } } Modified: head/sys/contrib/dev/acpica/components/utilities/uterror.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/uterror.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/utilities/uterror.c Mon Aug 13 16:26:26 2018 (r337713) @@ -352,19 +352,19 @@ AcpiUtPrefixedNamespaceError ( { case AE_ALREADY_EXISTS: - AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); Message = "Failure creating"; break; case AE_NOT_FOUND: - AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); Message = "Could not resolve"; break; default: - AcpiOsPrintf ("\n" ACPI_MSG_ERROR); + AcpiOsPrintf (ACPI_MSG_ERROR); Message = "Failure resolving"; break; } Modified: head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c Mon Aug 13 16:26:26 2018 (r337713) @@ -419,15 +419,39 @@ BOOLEAN AcpiUtDetectHexPrefix ( char **String) { + char *InitialPosition = *String; + AcpiUtRemoveHexPrefix (String); + if (*String != InitialPosition) + { + return (TRUE); /* String is past leading 0x */ + } + + return (FALSE); /* Not a hex string */ +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtRemoveHexPrefix + * + * PARAMETERS: String - Pointer to input ASCII string + * + * RETURN: none + * + * DESCRIPTION: Remove a hex "0x" prefix + * + ******************************************************************************/ + +void +AcpiUtRemoveHexPrefix ( + char **String) +{ if ((**String == ACPI_ASCII_ZERO) && (tolower ((int) *(*String + 1)) == 'x')) { *String += 2; /* Go past the leading 0x */ - return (TRUE); } - - return (FALSE); /* Not a hex string */ } Modified: head/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c Mon Aug 13 16:26:26 2018 (r337713) @@ -383,7 +383,7 @@ AcpiUtImplicitStrtoul64 ( * implicit conversions, and the "0x" prefix is "not allowed". * However, allow a "0x" prefix as an ACPI extension. */ - AcpiUtDetectHexPrefix (&String); + AcpiUtRemoveHexPrefix (&String); if (!AcpiUtRemoveLeadingZeros (&String)) { Modified: head/sys/contrib/dev/acpica/include/acconfig.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acconfig.h Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/include/acconfig.h Mon Aug 13 16:26:26 2018 (r337713) @@ -233,7 +233,7 @@ /* Maximum object reference count (detects object deletion issues) */ -#define ACPI_MAX_REFERENCE_COUNT 0x800 +#define ACPI_MAX_REFERENCE_COUNT 0x4000 /* Default page size for use in mapping memory for operation regions */ Modified: head/sys/contrib/dev/acpica/include/acexcep.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acexcep.h Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/include/acexcep.h Mon Aug 13 16:26:26 2018 (r337713) @@ -204,6 +204,13 @@ typedef struct acpi_exception_info #define AE_OK (ACPI_STATUS) 0x0000 +#define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL) +#define ACPI_AML_EXCEPTION(Status) (Status & AE_CODE_AML) +#define ACPI_PROG_EXCEPTION(Status) (Status & AE_CODE_PROGRAMMER) +#define ACPI_TABLE_EXCEPTION(Status) (Status & AE_CODE_ACPI_TABLES) +#define ACPI_CNTL_EXCEPTION(Status) (Status & AE_CODE_CONTROL) + + /* * Environmental exceptions */ Modified: head/sys/contrib/dev/acpica/include/aclocal.h ============================================================================== --- head/sys/contrib/dev/acpica/include/aclocal.h Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/include/aclocal.h Mon Aug 13 16:26:26 2018 (r337713) @@ -327,6 +327,7 @@ typedef struct acpi_namespace_node #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ #define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */ #define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */ +#define ANOBJ_NODE_EARLY_INIT 0x80 /* AcpiExec only: Node was create via init file (-fi) */ #define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */ #define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */ Modified: head/sys/contrib/dev/acpica/include/acnamesp.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acnamesp.h Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/include/acnamesp.h Mon Aug 13 16:26:26 2018 (r337713) @@ -168,14 +168,15 @@ /* Flags for AcpiNsLookup, AcpiNsSearchAndEnter */ #define ACPI_NS_NO_UPSEARCH 0 -#define ACPI_NS_SEARCH_PARENT 0x01 -#define ACPI_NS_DONT_OPEN_SCOPE 0x02 -#define ACPI_NS_NO_PEER_SEARCH 0x04 -#define ACPI_NS_ERROR_IF_FOUND 0x08 -#define ACPI_NS_PREFIX_IS_SCOPE 0x10 -#define ACPI_NS_EXTERNAL 0x20 -#define ACPI_NS_TEMPORARY 0x40 -#define ACPI_NS_OVERRIDE_IF_FOUND 0x80 +#define ACPI_NS_SEARCH_PARENT 0x0001 +#define ACPI_NS_DONT_OPEN_SCOPE 0x0002 +#define ACPI_NS_NO_PEER_SEARCH 0x0004 +#define ACPI_NS_ERROR_IF_FOUND 0x0008 +#define ACPI_NS_PREFIX_IS_SCOPE 0x0010 +#define ACPI_NS_EXTERNAL 0x0020 +#define ACPI_NS_TEMPORARY 0x0040 +#define ACPI_NS_OVERRIDE_IF_FOUND 0x0080 +#define ACPI_NS_EARLY_INIT 0x0100 /* Flags for AcpiNsWalkNamespace */ Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/include/acpixf.h Mon Aug 13 16:26:26 2018 (r337713) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20180629 +#define ACPI_CA_VERSION 0x20180810 #include #include Modified: head/sys/contrib/dev/acpica/include/acutils.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acutils.h Mon Aug 13 16:07:18 2018 (r337712) +++ head/sys/contrib/dev/acpica/include/acutils.h Mon Aug 13 16:26:26 2018 (r337713) @@ -362,6 +362,10 @@ BOOLEAN AcpiUtDetectHexPrefix ( char **String); +void +AcpiUtRemoveHexPrefix ( + char **String); + BOOLEAN AcpiUtDetectOctalPrefix ( char **String); Modified: head/usr.sbin/acpi/acpidb/Makefile ============================================================================== --- head/usr.sbin/acpi/acpidb/Makefile Mon Aug 13 16:07:18 2018 (r337712) +++ head/usr.sbin/acpi/acpidb/Makefile Mon Aug 13 16:26:26 2018 (r337713) @@ -76,7 +76,7 @@ SRCS+= osgendbg.c osunixxf.c MAN= acpidb.8 WARNS?= 3 -CFLAGS+= -DACPI_EXEC_APP -fno-strict-aliasing +CFLAGS+= -DACPI_DB_APP -DACPI_EXEC_APP -fno-strict-aliasing LIBADD= pthread .include From owner-svn-src-all@freebsd.org Mon Aug 13 16:48:48 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 E2B5110777A1; Mon, 13 Aug 2018 16:48: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9620A815B5; Mon, 13 Aug 2018 16:48: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 730397634; Mon, 13 Aug 2018 16:48: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 w7DGmln5039221; Mon, 13 Aug 2018 16:48:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DGmlFv039220; Mon, 13 Aug 2018 16:48:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808131648.w7DGmlFv039220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Aug 2018 16:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337714 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 337714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 16:48:48 -0000 Author: kib Date: Mon Aug 13 16:48:46 2018 New Revision: 337714 URL: https://svnweb.freebsd.org/changeset/base/337714 Log: Prevent some parallel swap-ins, rate-limit swapper swap-ins. If faultin() was called outside swapper (from PHOLD()), do not allow swapper to initiate additional swap-ins. Swapper' initiated swap-ins are serialized because they are synchronous and executed in the context of the thread0. With the added limitation, we only allow parallel swap-ins from PHOLD(), which is up to PHOLD() users to manage, usually they do not need to. Rate-limit swapper' swap-ins to one in the MAXSLP / 2 seconds interval, counting faultin() swapins. Suggested by: alc Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D16610 Modified: head/sys/vm/vm_swapout.c Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Mon Aug 13 16:26:26 2018 (r337713) +++ head/sys/vm/vm_swapout.c Mon Aug 13 16:48:46 2018 (r337714) @@ -159,6 +159,8 @@ static struct mtx vm_daemon_mtx; MTX_SYSINIT(vm_daemon, &vm_daemon_mtx, "vm daemon", MTX_DEF); static int swapped_cnt; +static int swap_inprogress; /* Pending swap-ins done outside swapper. */ +static int last_swapin; static void swapclear(struct proc *); static int swapout(struct proc *); @@ -634,6 +636,8 @@ faultin(struct proc *p) sx_xlock(&allproc_lock); MPASS(swapped_cnt > 0); swapped_cnt--; + if (curthread != &thread0) + swap_inprogress++; sx_xunlock(&allproc_lock); /* @@ -644,6 +648,13 @@ faultin(struct proc *p) FOREACH_THREAD_IN_PROC(p, td) vm_thread_swapin(td, oom_alloc); + if (curthread != &thread0) { + sx_xlock(&allproc_lock); + MPASS(swap_inprogress > 0); + swap_inprogress--; + last_swapin = ticks; + sx_xunlock(&allproc_lock); + } PROC_LOCK(p); swapclear(p); p->p_swtick = ticks; @@ -661,18 +672,17 @@ faultin(struct proc *p) */ static struct proc * -swapper_selector(void) +swapper_selector(bool wkilled_only) { struct proc *p, *res; struct thread *td; - int min_flag, ppri, pri, slptime, swtime; + int ppri, pri, slptime, swtime; sx_assert(&allproc_lock, SA_SLOCKED); if (swapped_cnt == 0) return (NULL); res = NULL; ppri = INT_MIN; - min_flag = vm_page_count_min(); FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); if (p->p_state == PRS_NEW || (p->p_flag & (P_SWAPPINGOUT | @@ -690,7 +700,7 @@ swapper_selector(void) */ return (p); } - if (min_flag) { + if (wkilled_only) { PROC_UNLOCK(p); continue; } @@ -721,11 +731,29 @@ swapper_selector(void) } PROC_UNLOCK(p); } + if (res != NULL) PROC_LOCK(res); return (res); } +#define SWAPIN_INTERVAL (MAXSLP * hz / 2) + +/* + * Limit swapper to swap in one non-WKILLED process in MAXSLP/2 + * interval, assuming that there is: + * - no memory shortage; + * - no parallel swap-ins; + * - no other swap-ins in the current SWAPIN_INTERVAL. + */ +static bool +swapper_wkilled_only(void) +{ + + return (vm_page_count_min() || swap_inprogress > 0 || + (u_int)(ticks - last_swapin) < SWAPIN_INTERVAL); +} + void swapper(void) { @@ -733,11 +761,11 @@ swapper(void) for (;;) { sx_slock(&allproc_lock); - p = swapper_selector(); + p = swapper_selector(swapper_wkilled_only()); sx_sunlock(&allproc_lock); if (p == NULL) { - tsleep(&proc0, PVM, "swapin", MAXSLP * hz / 2); + tsleep(&proc0, PVM, "swapin", SWAPIN_INTERVAL); } else { PROC_LOCK_ASSERT(p, MA_OWNED); From owner-svn-src-all@freebsd.org Mon Aug 13 17:13: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 43E1E107835A; Mon, 13 Aug 2018 17:13:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE887826D0; Mon, 13 Aug 2018 17:13:11 +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 C0FDE7B08; Mon, 13 Aug 2018 17:13:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DHDB3V057432; Mon, 13 Aug 2018 17:13:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DHD9hg057418; Mon, 13 Aug 2018 17:13:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808131713.w7DHD9hg057418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 Aug 2018 17:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337715 - in head/sys: amd64/amd64 conf dev/cpuctl i386/i386 x86/acpica x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 conf dev/cpuctl i386/i386 x86/acpica x86/include x86/x86 X-SVN-Commit-Revision: 337715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 17:13:12 -0000 Author: markj Date: Mon Aug 13 17:13:09 2018 New Revision: 337715 URL: https://svnweb.freebsd.org/changeset/base/337715 Log: Implement kernel support for early loading of Intel microcode updates. Updates in the format described in section 9.11 of the Intel SDM can now be applied as one of the first steps in booting the kernel. Updates that are loaded this way are automatically re-applied upon exit from ACPI sleep states, in contrast with the existing cpucontrol(8)-based method. For the time being only Intel updates are supported. Microcode update files are passed to the kernel via loader(8). The file type must be "cpu_microcode" in order for the file to be recognized as a candidate microcode update. Updates for multiple CPU types may be concatenated together into a single file, in which case the kernel will select and apply a matching update. Memory used to store the update file will be freed back to the system once the update is applied, so this approach will not consume more memory than required. Reviewed by: kib MFC after: 6 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16370 Added: head/sys/x86/include/ucode.h (contents, props changed) head/sys/x86/x86/ucode.c (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/cpuctl/cpuctl.c head/sys/i386/i386/locore.s head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c head/sys/x86/acpica/acpi_wakeup.c head/sys/x86/x86/mp_x86.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/amd64/amd64/machdep.c Mon Aug 13 17:13:09 2018 (r337715) @@ -130,6 +130,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef SMP #include #endif @@ -1567,6 +1568,9 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) TSRAW(&thread0, TS_ENTER, __func__, NULL); kmdp = init_ops.parse_preload_data(modulep); + + physfree += ucode_load_bsp(physfree + KERNBASE); + physfree = roundup2(physfree, PAGE_SIZE); identify_cpu1(); identify_hypervisor(); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/amd64/amd64/mp_machdep.c Mon Aug 13 17:13:09 2018 (r337715) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -241,6 +242,9 @@ init_secondary(void) /* Set by the startup code for us to use */ cpu = bootAP; + + /* Update microcode before doing anything else. */ + ucode_load_ap(cpu); /* Init tss */ common_tss[cpu] = common_tss[0]; Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/conf/files.amd64 Mon Aug 13 17:13:09 2018 (r337715) @@ -745,6 +745,7 @@ x86/x86/nexus.c standard x86/x86/pvclock.c standard x86/x86/stack_machdep.c optional ddb | stack x86/x86/tsc.c standard +x86/x86/ucode.c standard x86/x86/delay.c standard x86/xen/hvm.c optional xenhvm x86/xen/xen_intr.c optional xenhvm Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/conf/files.i386 Mon Aug 13 17:13:09 2018 (r337715) @@ -621,6 +621,7 @@ x86/x86/msi.c optional apic pci x86/x86/nexus.c standard x86/x86/stack_machdep.c optional ddb | stack x86/x86/tsc.c standard +x86/x86/ucode.c standard x86/x86/pvclock.c standard x86/x86/delay.c standard x86/xen/hvm.c optional xenhvm Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/dev/cpuctl/cpuctl.c Mon Aug 13 17:13:09 2018 (r337715) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static d_open_t cpuctl_open; static d_ioctl_t cpuctl_ioctl; @@ -333,11 +334,7 @@ static int update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td) { void *ptr; - uint64_t rev0, rev1; - uint32_t tmp[4]; - int is_bound; - int oldcpu; - int ret; + int is_bound, oldcpu, ret; if (args->size == 0 || args->data == NULL) { DPRINTF("[cpuctl,%d]: zero-sized firmware image", __LINE__); @@ -358,34 +355,26 @@ update_intel(int cpu, cpuctl_update_args_t *args, stru DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed", __LINE__, args->data, ptr, args->size); ret = EFAULT; - goto fail; + goto out; } oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); critical_enter(); - rdmsr_safe(MSR_BIOS_SIGN, &rev0); /* Get current microcode revision. */ - /* - * Perform update. Flush caches first to work around seemingly - * undocumented errata applying to some Broadwell CPUs. - */ - wbinvd(); - wrmsr_safe(MSR_BIOS_UPDT_TRIG, (uintptr_t)(ptr)); - wrmsr_safe(MSR_BIOS_SIGN, 0); + ret = ucode_intel_load(ptr, true); - /* - * Serialize instruction flow. - */ - do_cpuid(0, tmp); critical_exit(); - rdmsr_safe(MSR_BIOS_SIGN, &rev1); /* Get new microcode revision. */ restore_cpu(oldcpu, is_bound, td); - if (rev1 > rev0) - ret = 0; - else - ret = EEXIST; -fail: + + /* + * Replace any existing update. This ensures that the new update + * will be reloaded automatically during ACPI resume. + */ + if (ret == 0) + ptr = ucode_update(ptr); + +out: free(ptr, M_CPUCTL); return (ret); } Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/i386/i386/locore.s Mon Aug 13 17:13:09 2018 (r337715) @@ -328,8 +328,10 @@ olddiskboot: * Identify the CPU and initialize anything special about it * */ -identify_cpu: +ENTRY(identify_cpu) + pushl %ebx + /* Try to toggle alignment check flag; does not exist on 386. */ pushfl popl %eax @@ -449,7 +451,9 @@ trycpuid: /* Use the `cpuid' instruction. */ /* Greater than Pentium...call it a Pentium Pro */ movl $CPU_686,cpu 3: + popl %ebx ret +END(identify_cpu) #ifdef XENHVM /* Xen Hypercall page */ Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/i386/i386/machdep.c Mon Aug 13 17:13:09 2018 (r337715) @@ -133,6 +133,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef PERFMON @@ -158,6 +159,7 @@ CTASSERT(offsetof(struct pcpu, pc_curthread) == 0); register_t init386(int first); void dblfault_handler(void); +void identify_cpu(void); static void cpu_startup(void *); static void fpstate_drop(struct thread *td); @@ -2311,6 +2313,7 @@ init386(int first) struct xstate_hdr *xhdr; caddr_t kmdp; vm_offset_t addend; + size_t ucode_len; int late_console; thread0.td_kstack = proc0kstack; @@ -2338,6 +2341,15 @@ init386(int first) init_static_kenv((char *)bootinfo.bi_envp + addend, 0); } else { init_static_kenv(NULL, 0); + } + + /* + * Re-evaluate CPU features if we loaded a microcode update. + */ + ucode_len = ucode_load_bsp(first); + if (ucode_len != 0) { + identify_cpu(); + first = roundup2(first + ucode_len, PAGE_SIZE); } identify_hypervisor(); Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/i386/i386/mp_machdep.c Mon Aug 13 17:13:09 2018 (r337715) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -80,7 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) @@ -216,6 +217,9 @@ init_secondary(void) /* bootAP is set in start_ap() to our ID. */ myid = bootAP; + + /* Update microcode before doing anything else. */ + ucode_load_ap(myid); /* Get per-cpu data */ pc = &__pcpu[myid]; Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/x86/acpica/acpi_wakeup.c Mon Aug 13 17:13:09 2018 (r337715) @@ -54,10 +54,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include +#include #ifdef DEV_APIC #include @@ -324,6 +325,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, if (!intr_enabled) { /* Wakeup MD procedures in interrupt disabled context */ if (sleep_result == 1) { + ucode_reload(); pmap_init_pat(); initializecpu(); PCPU_SET(switchtime, 0); Added: head/sys/x86/include/ucode.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/ucode.h Mon Aug 13 17:13:09 2018 (r337715) @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_UCODE_H_ +#define _MACHINE_UCODE_H_ + +struct ucode_intel_header { + uint32_t header_version; + int32_t update_revision; + uint32_t dat; + uint32_t processor_signature; + uint32_t checksum; + uint32_t loader_revision; + uint32_t processor_flags; +#define UCODE_INTEL_DEFAULT_DATA_SIZE 2000 + uint32_t data_size; + uint32_t total_size; + uint32_t reserved[3]; +}; + +struct ucode_intel_extsig_table { + uint32_t signature_count; + uint32_t signature_table_checksum; + uint32_t reserved[3]; + struct ucode_intel_extsig { + uint32_t processor_signature; + uint32_t processor_flags; + uint32_t checksum; + } entries[0]; +}; + +int ucode_intel_load(void *data, bool unsafe); +size_t ucode_load_bsp(uintptr_t free); +void ucode_load_ap(int cpu); +void ucode_reload(void); +void * ucode_update(void *data); + +#endif /* _MACHINE_UCODE_H_ */ Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Mon Aug 13 16:48:46 2018 (r337714) +++ head/sys/x86/x86/mp_x86.c Mon Aug 13 17:13:09 2018 (r337715) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -72,7 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include static MALLOC_DEFINE(M_CPUS, "cpus", "CPU items"); @@ -1471,6 +1472,9 @@ cpususpend_handler(void) /* Wait for resume directive */ while (!CPU_ISSET(cpu, &toresume_cpus)) ia32_pause(); + + /* Re-apply microcode updates. */ + ucode_reload(); #ifdef __i386__ /* Finish removing the identity mapping of low memory for this AP. */ Added: head/sys/x86/x86/ucode.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/x86/ucode.c Mon Aug 13 17:13:09 2018 (r337715) @@ -0,0 +1,383 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * 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 +#include +#include +#include + +static void *ucode_intel_match(uint8_t *data, size_t *len); +static int ucode_intel_verify(struct ucode_intel_header *hdr, + size_t resid); + +static struct ucode_ops { + const char *vendor; + int (*load)(void *, bool); + void *(*match)(uint8_t *, size_t *); +} loaders[] = { + { + .vendor = INTEL_VENDOR_ID, + .load = ucode_intel_load, + .match = ucode_intel_match, + }, +}; + +/* Selected microcode update data. */ +static void *early_ucode_data; +static void *ucode_data; + +static char errbuf[128]; + +static void __printflike(1, 2) +log_err(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vsnprintf(errbuf, sizeof(errbuf), fmt, ap); + va_end(ap); +} + +static void +print_err(void *arg __unused) +{ + + if (errbuf[0] != '\0') + printf("microcode load error: %s\n", errbuf); +} +SYSINIT(ucode_print_err, SI_SUB_CPU, SI_ORDER_FIRST, print_err, NULL); + +int +ucode_intel_load(void *data, bool unsafe) +{ + uint64_t rev0, rev1; + uint32_t cpuid[4]; + + rev0 = rdmsr(MSR_BIOS_SIGN); + + /* + * Perform update. Flush caches first to work around seemingly + * undocumented errata applying to some Broadwell CPUs. + */ + wbinvd(); + if (unsafe) + wrmsr_safe(MSR_BIOS_UPDT_TRIG, (uint64_t)(uintptr_t)data); + else + wrmsr(MSR_BIOS_UPDT_TRIG, (uint64_t)(uintptr_t)data); + wrmsr(MSR_BIOS_SIGN, 0); + + /* + * Serialize instruction flow. + */ + do_cpuid(0, cpuid); + + rev1 = rdmsr(MSR_BIOS_SIGN); + if (rev1 <= rev0) + return (EEXIST); + return (0); +} + +static int +ucode_intel_verify(struct ucode_intel_header *hdr, size_t resid) +{ + uint32_t cksum, *data, size; + int i; + + if (resid < sizeof(struct ucode_intel_header)) { + log_err("truncated update header"); + return (1); + } + size = hdr->total_size; + if (size == 0) + size = UCODE_INTEL_DEFAULT_DATA_SIZE + + sizeof(struct ucode_intel_header); + + if (hdr->header_version != 1) { + log_err("unexpected header version %u", hdr->header_version); + return (1); + } + if (size % 16 != 0) { + log_err("unexpected update size %u", hdr->total_size); + return (1); + } + if (resid < size) { + log_err("truncated update"); + return (1); + } + + cksum = 0; + data = (uint32_t *)hdr; + for (i = 0; i < size / sizeof(uint32_t); i++) + cksum += data[i]; + if (cksum != 0) { + log_err("checksum failed"); + return (1); + } + return (0); +} + +static void * +ucode_intel_match(uint8_t *data, size_t *len) +{ + struct ucode_intel_header *hdr; + struct ucode_intel_extsig_table *table; + struct ucode_intel_extsig *entry; + uint64_t platformid; + size_t resid; + uint32_t data_size, flags, regs[4], sig, total_size; + int i; + + do_cpuid(1, regs); + sig = regs[0]; + + platformid = rdmsr(MSR_IA32_PLATFORM_ID); + flags = 1 << ((platformid >> 50) & 0x7); + + for (resid = *len; resid > 0; data += total_size, resid -= total_size) { + hdr = (struct ucode_intel_header *)data; + if (ucode_intel_verify(hdr, resid) != 0) + break; + + data_size = hdr->data_size; + total_size = hdr->total_size; + if (data_size == 0) + data_size = UCODE_INTEL_DEFAULT_DATA_SIZE; + if (total_size == 0) + total_size = UCODE_INTEL_DEFAULT_DATA_SIZE + + sizeof(struct ucode_intel_header); + if (data_size > total_size + sizeof(struct ucode_intel_header)) + table = (struct ucode_intel_extsig_table *) + ((uint8_t *)(hdr + 1) + data_size); + else + table = NULL; + + if (hdr->processor_signature == sig) { + if ((hdr->processor_flags & flags) != 0) { + *len = data_size; + return (hdr + 1); + } + } else if (table != NULL) { + for (i = 0; i < table->signature_count; i++) { + entry = &table->entries[i]; + if (entry->processor_signature == sig && + (entry->processor_flags & flags) != 0) { + *len = data_size; + return (hdr + 1); + } + } + } + } + return (NULL); +} + +/* + * Release any memory backing unused microcode blobs back to the system. + * We copy the selected update and free the entire microcode file. + */ +static void +ucode_release(void *arg __unused) +{ + char *name, *type; + caddr_t file; + int release; + + if (early_ucode_data == NULL) + return; + release = 1; + TUNABLE_INT_FETCH("debug.ucode.release", &release); + if (!release) + return; + +restart: + file = 0; + for (;;) { + file = preload_search_next_name(file); + if (file == 0) + break; + type = (char *)preload_search_info(file, MODINFO_TYPE); + if (type == NULL || strcmp(type, "cpu_microcode") != 0) + continue; + + name = preload_search_info(file, MODINFO_NAME); + preload_delete_name(name); + goto restart; + } +} +SYSINIT(ucode_release, SI_SUB_KMEM + 1, SI_ORDER_ANY, ucode_release, NULL); + +void +ucode_load_ap(int cpu) +{ + + KASSERT(cpu_info[cpu_apic_ids[cpu]].cpu_present, + ("cpu %d not present", cpu)); + + if (ucode_data != NULL && !cpu_info[cpu_apic_ids[cpu]].cpu_hyperthread) + (void)ucode_intel_load(ucode_data, false); +} + +static void * +map_ucode(vm_paddr_t free, size_t len) +{ + +#ifdef __i386__ + for (vm_paddr_t pa = free; pa < free + len; pa += PAGE_SIZE) + pmap_kenter(pa, pa); +#else + (void)len; +#endif + return ((void *)free); +} + +static void +unmap_ucode(vm_paddr_t free, size_t len) +{ + +#ifdef __i386__ + for (vm_paddr_t pa = free; pa < free + len; pa += PAGE_SIZE) + pmap_kremove((vm_offset_t)pa); +#else + (void)free; + (void)len; +#endif +} + +/* + * Search for an applicable microcode update, and load it. APs will load the + * selected update once they come online. + * + * "free" is the address of the next free physical page. If a microcode update + * is selected, it will be copied to this region prior to loading in order to + * satisfy alignment requirements. + */ +size_t +ucode_load_bsp(uintptr_t free) +{ + union { + uint32_t regs[4]; + char vendor[13]; + } cpuid; + struct ucode_ops *loader; + uint8_t *addr, *fileaddr, *match; + char *type; + caddr_t file; + size_t len, ucode_len; + int i; + + KASSERT(free % PAGE_SIZE == 0, ("unaligned boundary %p", (void *)free)); + + do_cpuid(0, cpuid.regs); + cpuid.regs[0] = cpuid.regs[1]; + cpuid.regs[1] = cpuid.regs[3]; + cpuid.vendor[12] = '\0'; + for (i = 0, loader = NULL; i < nitems(loaders); i++) + if (strcmp(cpuid.vendor, loaders[i].vendor) == 0) { + loader = &loaders[i]; + break; + } + if (loader == NULL) + return (0); + + file = 0; + fileaddr = match = NULL; + ucode_len = 0; + for (;;) { + file = preload_search_next_name(file); + if (file == 0) + break; + type = (char *)preload_search_info(file, MODINFO_TYPE); + if (type == NULL || strcmp(type, "cpu_microcode") != 0) + continue; + + fileaddr = preload_fetch_addr(file); + len = preload_fetch_size(file); + match = loader->match(fileaddr, &len); + if (match != NULL) { + addr = map_ucode(free, len); + memcpy(addr, match, len); + match = addr; + + if (loader->load(match, false) == 0) { + ucode_data = match; + ucode_len = len; + early_ucode_data = ucode_data; + break; + } + unmap_ucode(free, len); + } + } + if (fileaddr != NULL && ucode_data == NULL) + log_err("no matching update found"); + return (ucode_len); +} + +/* + * Reload microcode following an ACPI resume. + */ +void +ucode_reload(void) +{ + + ucode_load_ap(PCPU_GET(cpuid)); +} + +/* + * Replace an existing microcode update. + */ +void * +ucode_update(void *newdata) +{ + + newdata = (void *)atomic_swap_ptr((void *)&ucode_data, + (uintptr_t)newdata); + if (newdata == early_ucode_data) + newdata = NULL; + return (newdata); +} From owner-svn-src-all@freebsd.org Mon Aug 13 17:14: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 B95FA10783B4; Mon, 13 Aug 2018 17:14:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7012B82852; Mon, 13 Aug 2018 17:14: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 51B4E7B12; Mon, 13 Aug 2018 17:14: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 w7DHE7bo057608; Mon, 13 Aug 2018 17:14:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DHE7kL057607; Mon, 13 Aug 2018 17:14:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808131714.w7DHE7kL057607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 Aug 2018 17:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337716 - head/stand/defaults X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/stand/defaults X-SVN-Commit-Revision: 337716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 17:14:07 -0000 Author: markj Date: Mon Aug 13 17:14:06 2018 New Revision: 337716 URL: https://svnweb.freebsd.org/changeset/base/337716 Log: Add microcode update configuration to the default loader.conf. MFC after: 6 weeks Sponsored by: The FreeBSD Foundation Modified: head/stand/defaults/loader.conf Modified: head/stand/defaults/loader.conf ============================================================================== --- head/stand/defaults/loader.conf Mon Aug 13 17:13:09 2018 (r337715) +++ head/stand/defaults/loader.conf Mon Aug 13 17:14:06 2018 (r337716) @@ -52,6 +52,14 @@ ram_blacklist_name="/boot/blacklist.txt" # Set this to ram_blacklist_type="ram_blacklist" # Required for the kernel to find # the blacklist module +### Microcode loading configuration ######################## +cpu_microcode_load="NO" # Set this to YES to load and apply a + # microcode update file during boot. +cpu_microcode_name="/boot/firmware/ucode.bin" # Set this to the microcode + # update file path. +cpu_microcode_type="cpu_microcode" # Required for the kernel to find + # the microcode update file. + ### ACPI settings ########################################## acpi_dsdt_load="NO" # DSDT Overriding acpi_dsdt_type="acpi_dsdt" # Don't change this From owner-svn-src-all@freebsd.org Mon Aug 13 17:23: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 3B4CA107864F; Mon, 13 Aug 2018 17:23:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E535582E70; Mon, 13 Aug 2018 17:23:43 +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 C74887CA1; Mon, 13 Aug 2018 17:23:43 +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 w7DHNhPJ063801; Mon, 13 Aug 2018 17:23:43 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DHNhYG063800; Mon, 13 Aug 2018 17:23:43 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808131723.w7DHNhYG063800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 13 Aug 2018 17:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337717 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 337717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 17:23:44 -0000 Author: gjb Date: Mon Aug 13 17:23:43 2018 New Revision: 337717 URL: https://svnweb.freebsd.org/changeset/base/337717 Log: Add lang/python2, lang/python3, and lang/python to GCE images to help avoid hard-coding 'python.' in several scripts in the client-side scripts. PR: 230248 MFC after: 3 days Submitted by: gustavo.scalet@collabora.com Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Mon Aug 13 17:14:06 2018 (r337716) +++ head/release/tools/gce.conf Mon Aug 13 17:23:43 2018 (r337717) @@ -5,7 +5,8 @@ # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ - google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine" + google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ + lang/python lang/python2 lang/python3" # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="ntpd sshd growfs\ From owner-svn-src-all@freebsd.org Mon Aug 13 17:24: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 5AF6810786A5; Mon, 13 Aug 2018 17:24:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03E9182FF5; Mon, 13 Aug 2018 17:24:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D91F87CA3; Mon, 13 Aug 2018 17:24:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DHOVog063971; Mon, 13 Aug 2018 17:24:31 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DHOV4N063970; Mon, 13 Aug 2018 17:24:31 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808131724.w7DHOV4N063970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 13 Aug 2018 17:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337718 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 337718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 17:24:32 -0000 Author: gjb Date: Mon Aug 13 17:24:31 2018 New Revision: 337718 URL: https://svnweb.freebsd.org/changeset/base/337718 Log: Add a space between a variable and escaped new line. MFC after: 3 days MFC with: r337717 Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Mon Aug 13 17:23:43 2018 (r337717) +++ head/release/tools/gce.conf Mon Aug 13 17:24:31 2018 (r337718) @@ -9,7 +9,7 @@ export VM_EXTRA_PACKAGES="firstboot-freebsd-update fir lang/python lang/python2 lang/python3" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="ntpd sshd growfs\ +export VM_RC_LIST="ntpd sshd growfs \ firstboot_pkgs firstboot_freebsd_update google_startup \ google_accounts_daemon google_clock_skew_daemon \ google_instance_setup google_network_daemon" From owner-svn-src-all@freebsd.org Mon Aug 13 18:51: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 63BF6107A41D; Mon, 13 Aug 2018 18:51:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17E7286A86; Mon, 13 Aug 2018 18:51:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id ACD6E2461D; Mon, 13 Aug 2018 18:51:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f44.google.com with SMTP id u202-v6so11979743lff.9; Mon, 13 Aug 2018 11:51:02 -0700 (PDT) X-Gm-Message-State: AOUpUlH6reu76tLcra91YjF3R6ALuwSYZL+iPOUXGUiMTGLN0czqCX4F XgEvpP7Xsx6w8htniWVaMsoJ12NIBrqHQYHEx+k= X-Google-Smtp-Source: AA+uWPwiYA49X5uesAP82lXua/DBNqFrKxSaXnEJd2yfnbiYMS4t1PrDrmRiOU46L4MkuumGnkIu15NUqnphyEWwpCQ= X-Received: by 2002:a19:3b11:: with SMTP id i17-v6mr11323817lfa.146.1534186261222; Mon, 13 Aug 2018 11:51:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Mon, 13 Aug 2018 11:50:40 -0700 (PDT) In-Reply-To: <2F95BCD1-0C8A-4D65-9C44-6F391D4F2F68@panasas.com> References: <201808112350.w7BNo9t8047126@repo.freebsd.org> <2F95BCD1-0C8A-4D65-9C44-6F391D4F2F68@panasas.com> From: Kyle Evans Date: Mon, 13 Aug 2018 13:50:40 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337663 - in head: . cddl/lib cddl/lib/libbe contrib/mdocml lib/libbe sbin sbin/bectl share/mk To: Ravi Pokala Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 18:51:03 -0000 On Mon, Aug 13, 2018 at 12:44 AM, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Kyle Evans > Date: 2018-08-11, Saturday at 16:50 > To: , , > Subject: svn commit: r337663 - in head: . cddl/lib cddl/lib/libbe contrib/mdocml lib/libbe sbin sbin/bectl share/mk > >> Author: kevans >> Date: Sat Aug 11 23:50:09 2018 >> New Revision: 337663 >> URL: https://svnweb.freebsd.org/changeset/base/337663 >> >> Log: >> Merge libbe(3)/bectl(8) from projects/bectl into head >> >> bectl(8) is an administrative interface for working with ZFS boot >> environments, intended to provide a superset of the functionality provided >> by sysutils/beadm. >> >> libbe(3) is the back-end library that the required functionality has been >> pulled out into for later reuse. >> >> These were originally written for GSoC 2017 under the mentorship of >> allanjude@. > > Originally written by who? > > -Ravi (rpokala@) > Heh, sorry. =p This was meant to read "written for GSoC 2017 by Kyle Kneitinger ..." From owner-svn-src-all@freebsd.org Mon Aug 13 18:53:16 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 D6A85107A5C4; Mon, 13 Aug 2018 18:53:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2D186E40; Mon, 13 Aug 2018 18:53:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A75B10B23; Mon, 13 Aug 2018 18:53:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DIrFGi016485; Mon, 13 Aug 2018 18:53:15 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DIrF84016483; Mon, 13 Aug 2018 18:53:15 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201808131853.w7DIrF84016483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 13 Aug 2018 18:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337719 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 337719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 18:53:16 -0000 Author: gonzo Date: Mon Aug 13 18:53:14 2018 New Revision: 337719 URL: https://svnweb.freebsd.org/changeset/base/337719 Log: [ig4] Fix initialization sequence for newer ig4 chips Newer chips may require assert/deassert after power down for proper startup. Check respective flag in DEVIDLE_CTRL and perform operation if neccesssary. PR: 221777 Submitted by: marc.priggemeyer@gmail.com Obtained from: DragonFly BSD Tested on: Thinkpad T470 Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_reg.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Mon Aug 13 17:24:31 2018 (r337718) +++ head/sys/dev/ichiic/ig4_iic.c Mon Aug 13 18:53:14 2018 (r337719) @@ -525,6 +525,16 @@ ig4iic_attach(ig4iic_softc_t *sc) mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); sx_init(&sc->call_lock, "IG4 call lock"); + v = reg_read(sc, IG4_REG_DEVIDLE_CTRL); + if (sc->version == IG4_SKYLAKE && (v & IG4_RESTORE_REQUIRED) ) { + reg_write(sc, IG4_REG_DEVIDLE_CTRL, IG4_DEVICE_IDLE | IG4_RESTORE_REQUIRED); + reg_write(sc, IG4_REG_DEVIDLE_CTRL, 0); + + reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_ASSERT_SKL); + reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_DEASSERT_SKL); + DELAY(1000); + } + if (sc->version == IG4_ATOM) v = reg_read(sc, IG4_REG_COMP_TYPE); Modified: head/sys/dev/ichiic/ig4_reg.h ============================================================================== --- head/sys/dev/ichiic/ig4_reg.h Mon Aug 13 17:24:31 2018 (r337718) +++ head/sys/dev/ichiic/ig4_reg.h Mon Aug 13 18:53:14 2018 (r337719) @@ -78,6 +78,7 @@ #define IG4_REG_CTL 0x0000 /* RW Control Register */ #define IG4_REG_TAR_ADD 0x0004 /* RW Target Address */ +#define IG4_REG_HS_MADDR 0x000C /* RW High Speed Master Mode Code Address*/ #define IG4_REG_DATA_CMD 0x0010 /* RW Data Buffer and Command */ #define IG4_REG_SS_SCL_HCNT 0x0014 /* RW Std Speed clock High Count */ #define IG4_REG_SS_SCL_LCNT 0x0018 /* RW Std Speed clock Low Count */ @@ -92,7 +93,9 @@ #define IG4_REG_CLR_RX_UNDER 0x0044 /* RO Clear RX_Under Interrupt */ #define IG4_REG_CLR_RX_OVER 0x0048 /* RO Clear RX_Over Interrupt */ #define IG4_REG_CLR_TX_OVER 0x004C /* RO Clear TX_Over Interrupt */ +#define IG4_REG_CLR_RD_REQ 0x0050 /* RO Clear RD_Req Interrupt */ #define IG4_REG_CLR_TX_ABORT 0x0054 /* RO Clear TX_Abort Interrupt */ +#define IG4_REG_CLR_RX_DONE 0x0058 /* RO Clear RX_Done Interrupt */ #define IG4_REG_CLR_ACTIVITY 0x005C /* RO Clear Activity Interrupt */ #define IG4_REG_CLR_STOP_DET 0x0060 /* RO Clear STOP Detection Int */ #define IG4_REG_CLR_START_DET 0x0064 /* RO Clear START Detection Int */ @@ -108,6 +111,7 @@ #define IG4_REG_DMA_TDLR 0x008C /* RW DMA Transmit Data Level */ #define IG4_REG_DMA_RDLR 0x0090 /* RW DMA Receive Data Level */ #define IG4_REG_SDA_SETUP 0x0094 /* RW SDA Setup */ +#define IG4_REG_ACK_GENERAL_CALL 0x0098 /* RW I2C ACK General Call */ #define IG4_REG_ENABLE_STATUS 0x009C /* RO Enable Status */ /* Available at least on Atom SoCs and Haswell mobile. */ #define IG4_REG_COMP_PARAM1 0x00F4 /* RO Component Parameter */ @@ -118,6 +122,9 @@ #define IG4_REG_RESETS_SKL 0x0204 /* RW Reset Register */ #define IG4_REG_ACTIVE_LTR_VALUE 0x0210 /* RW Active LTR Value */ #define IG4_REG_IDLE_LTR_VALUE 0x0214 /* RW Idle LTR Value */ +#define IG4_REG_TX_ACK_COUNT 0x0218 /* RO TX ACK Count */ +#define IG4_REG_RX_BYTE_COUNT 0x021C /* RO RX ACK Count */ +#define IG4_REG_DEVIDLE_CTRL 0x024C /* RW Device Control */ /* Available at least on Atom SoCs */ #define IG4_REG_CLK_PARMS 0x0800 /* RW Clock Parameters */ /* Available at least on Atom SoCs and Haswell mobile */ @@ -581,6 +588,17 @@ /* Skylake-U/Y and Kaby Lake-U/Y have the reset bits inverted */ #define IG4_RESETS_DEASSERT_SKL 0x0003 #define IG4_RESETS_ASSERT_SKL 0x0000 + +/* Newer versions of the I2C controller allow to check whether + * the above ASSERT/DEASSERT is necessary by querying the DEVIDLE_CONTROL + * register. + * + * the RESTORE_REQUIRED bit can be cleared by writing 1 + * the DEVICE_IDLE status can be set to put the controller in an idle state + * + */ +#define IG4_RESTORE_REQUIRED 0x0008 +#define IG4_DEVICE_IDLE 0x0004 /* * GENERAL - (RW) General Reigster 22.2.38 From owner-svn-src-all@freebsd.org Mon Aug 13 19:00: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 C909A107A761; Mon, 13 Aug 2018 19:00:45 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC96871F6; Mon, 13 Aug 2018 19:00:45 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 600A410B59; Mon, 13 Aug 2018 19:00:45 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DJ0jck016912; Mon, 13 Aug 2018 19:00:45 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DJ0hWk016899; Mon, 13 Aug 2018 19:00:43 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201808131900.w7DJ0hWk016899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 13 Aug 2018 19:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337720 - in head/sys: arm/broadcom/bcm2835 dev/atkbdc dev/evdev dev/usb/input X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 dev/atkbdc dev/evdev dev/usb/input X-SVN-Commit-Revision: 337720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 19:00:46 -0000 Author: wulf Date: Mon Aug 13 19:00:42 2018 New Revision: 337720 URL: https://svnweb.freebsd.org/changeset/base/337720 Log: evdev: remove soft context from evdev methods parameter list. Now softc should be retrieved from struct edvev * pointer with evdev_get_softc() helper. wmt(4) is a sample of driver that support both KPI. Reviewed by: hselasky, gonzo Differential Revision: https://reviews.freebsd.org/D16614 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c head/sys/dev/atkbdc/psm.c head/sys/dev/evdev/cdev.c head/sys/dev/evdev/evdev.c head/sys/dev/evdev/evdev.h head/sys/dev/evdev/evdev_utils.c head/sys/dev/evdev/uinput.c head/sys/dev/usb/input/uep.c head/sys/dev/usb/input/ums.c head/sys/dev/usb/input/wmt.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c Mon Aug 13 19:00:42 2018 (r337720) @@ -172,20 +172,22 @@ out: callout_reset(&sc->sc_callout, sc->sc_tick, ft5406ts_callout, sc); } -static void -ft5406ts_ev_close(struct evdev_dev *evdev, void *data) +static int +ft5406ts_ev_close(struct evdev_dev *evdev) { - struct ft5406ts_softc *sc = (struct ft5406ts_softc *)data; + struct ft5406ts_softc *sc = evdev_get_softc(evdev); FT5406_LOCK_ASSERT(sc); callout_stop(&sc->sc_callout); + + return (0); } static int -ft5406ts_ev_open(struct evdev_dev *evdev, void *data) +ft5406ts_ev_open(struct evdev_dev *evdev) { - struct ft5406ts_softc *sc = (struct ft5406ts_softc *)data; + struct ft5406ts_softc *sc = evdev_get_softc(evdev); FT5406_LOCK_ASSERT(sc); Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/dev/atkbdc/psm.c Mon Aug 13 19:00:42 2018 (r337720) @@ -2023,9 +2023,9 @@ psmdetach(device_t dev) #ifdef EVDEV_SUPPORT static int -psm_ev_open_r(struct evdev_dev *evdev, void *ev_softc) +psm_ev_open_r(struct evdev_dev *evdev) { - struct psm_softc *sc = (struct psm_softc *)ev_softc; + struct psm_softc *sc = evdev_get_softc(evdev); int err = 0; /* Get device data */ @@ -2043,24 +2043,27 @@ psm_ev_open_r(struct evdev_dev *evdev, void *ev_softc) return (err); } -static void -psm_ev_close_r(struct evdev_dev *evdev, void *ev_softc) +static int +psm_ev_close_r(struct evdev_dev *evdev) { - struct psm_softc *sc = (struct psm_softc *)ev_softc; + struct psm_softc *sc = evdev_get_softc(evdev); + int err = 0; sc->state &= ~PSM_EV_OPEN_R; if (sc->state & (PSM_OPEN | PSM_EV_OPEN_A)) - return; + return (0); if (sc->state & PSM_VALID) - psmclose(sc); + err = psmclose(sc); + + return (err); } static int -psm_ev_open_a(struct evdev_dev *evdev, void *ev_softc) +psm_ev_open_a(struct evdev_dev *evdev) { - struct psm_softc *sc = (struct psm_softc *)ev_softc; + struct psm_softc *sc = evdev_get_softc(evdev); int err = 0; /* Get device data */ @@ -2078,18 +2081,21 @@ psm_ev_open_a(struct evdev_dev *evdev, void *ev_softc) return (err); } -static void -psm_ev_close_a(struct evdev_dev *evdev, void *ev_softc) +static int +psm_ev_close_a(struct evdev_dev *evdev) { - struct psm_softc *sc = (struct psm_softc *)ev_softc; + struct psm_softc *sc = evdev_get_softc(evdev); + int err = 0; sc->state &= ~PSM_EV_OPEN_A; if (sc->state & (PSM_OPEN | PSM_EV_OPEN_R)) - return; + return (0); if (sc->state & PSM_VALID) - psmclose(sc); + err = psmclose(sc); + + return (err); } #endif Modified: head/sys/dev/evdev/cdev.c ============================================================================== --- head/sys/dev/evdev/cdev.c Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/dev/evdev/cdev.c Mon Aug 13 19:00:42 2018 (r337720) @@ -419,7 +419,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd, caddr_t data return (ENOTSUP); ke = (struct input_keymap_entry *)data; - evdev->ev_methods->ev_get_keycode(evdev, evdev->ev_softc, ke); + evdev->ev_methods->ev_get_keycode(evdev, ke); return (0); case EVIOCSKEYCODE: @@ -432,7 +432,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd, caddr_t data return (ENOTSUP); ke = (struct input_keymap_entry *)data; - evdev->ev_methods->ev_set_keycode(evdev, evdev->ev_softc, ke); + evdev->ev_methods->ev_set_keycode(evdev, ke); return (0); case EVIOCGABS(0) ... EVIOCGABS(ABS_MAX): Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/dev/evdev/evdev.c Mon Aug 13 19:00:42 2018 (r337720) @@ -337,6 +337,13 @@ evdev_set_methods(struct evdev_dev *evdev, void *softc evdev->ev_softc = softc; } +inline void * +evdev_get_softc(struct evdev_dev *evdev) +{ + + return (evdev->ev_softc); +} + inline void evdev_support_prop(struct evdev_dev *evdev, uint16_t prop) { @@ -798,8 +805,7 @@ evdev_inject_event(struct evdev_dev *evdev, uint16_t t case EV_FF: if (evdev->ev_methods != NULL && evdev->ev_methods->ev_event != NULL) - evdev->ev_methods->ev_event(evdev, evdev->ev_softc, - type, code, value); + evdev->ev_methods->ev_event(evdev, type, code, value); /* * Leds and driver repeats should be reported in ev_event * method body to interoperate with kbdmux states and rates @@ -842,7 +848,7 @@ evdev_register_client(struct evdev_dev *evdev, struct evdev->ev_methods->ev_open != NULL) { debugf(evdev, "calling ev_open() on device %s", evdev->ev_shortname); - ret = evdev->ev_methods->ev_open(evdev, evdev->ev_softc); + ret = evdev->ev_methods->ev_open(evdev); } if (ret == 0) LIST_INSERT_HEAD(&evdev->ev_clients, client, ec_link); @@ -860,7 +866,7 @@ evdev_dispose_client(struct evdev_dev *evdev, struct e if (LIST_EMPTY(&evdev->ev_clients)) { if (evdev->ev_methods != NULL && evdev->ev_methods->ev_close != NULL) - evdev->ev_methods->ev_close(evdev, evdev->ev_softc); + (void)evdev->ev_methods->ev_close(evdev); if (evdev_event_supported(evdev, EV_REP) && bit_test(evdev->ev_flags, EVDEV_FLAG_SOFTREPEAT)) evdev_stop_repeat(evdev); Modified: head/sys/dev/evdev/evdev.h ============================================================================== --- head/sys/dev/evdev/evdev.h Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/dev/evdev/evdev.h Mon Aug 13 19:00:42 2018 (r337720) @@ -38,11 +38,10 @@ struct evdev_dev; -typedef int (evdev_open_t)(struct evdev_dev *, void *); -typedef void (evdev_close_t)(struct evdev_dev *, void *); -typedef void (evdev_event_t)(struct evdev_dev *, void *, uint16_t, - uint16_t, int32_t); -typedef void (evdev_keycode_t)(struct evdev_dev *, void *, +typedef int (evdev_open_t)(struct evdev_dev *); +typedef int (evdev_close_t)(struct evdev_dev *); +typedef void (evdev_event_t)(struct evdev_dev *, uint16_t, uint16_t, int32_t); +typedef void (evdev_keycode_t)(struct evdev_dev *, struct input_keymap_entry *); /* @@ -126,6 +125,7 @@ void evdev_support_sw(struct evdev_dev *, uint16_t); void evdev_set_repeat_params(struct evdev_dev *, uint16_t, int); int evdev_set_report_size(struct evdev_dev *, size_t); void evdev_set_flag(struct evdev_dev *, uint16_t); +void *evdev_get_softc(struct evdev_dev *); /* Multitouch related functions: */ int32_t evdev_get_mt_slot_by_tracking_id(struct evdev_dev *, int32_t); Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/dev/evdev/evdev_utils.c Mon Aug 13 19:00:42 2018 (r337720) @@ -301,10 +301,10 @@ evdev_push_repeats(struct evdev_dev *evdev, keyboard_t } void -evdev_ev_kbd_event(struct evdev_dev *evdev, void *softc, uint16_t type, - uint16_t code, int32_t value) +evdev_ev_kbd_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, + int32_t value) { - keyboard_t *kbd = (keyboard_t *)softc; + keyboard_t *kbd = (keyboard_t *)evdev_get_softc(evdev); int delay[2], leds, oleds; size_t i; Modified: head/sys/dev/evdev/uinput.c ============================================================================== --- head/sys/dev/evdev/uinput.c Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/dev/evdev/uinput.c Mon Aug 13 19:00:42 2018 (r337720) @@ -159,10 +159,10 @@ uinput_knl_assert_unlocked(void *arg) } static void -uinput_ev_event(struct evdev_dev *evdev, void *softc, uint16_t type, - uint16_t code, int32_t value) +uinput_ev_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, + int32_t value) { - struct uinput_cdev_state *state = softc; + struct uinput_cdev_state *state = evdev_get_softc(evdev); if (type == EV_LED) evdev_push_event(evdev, type, code, value); Modified: head/sys/dev/usb/input/uep.c ============================================================================== --- head/sys/dev/usb/input/uep.c Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/dev/usb/input/uep.c Mon Aug 13 19:00:42 2018 (r337720) @@ -430,19 +430,21 @@ uep_detach(device_t dev) #ifdef EVDEV_SUPPORT -static void -uep_ev_close(struct evdev_dev *evdev, void *ev_softc) +static int +uep_ev_close(struct evdev_dev *evdev) { - struct uep_softc *sc = (struct uep_softc *)ev_softc; + struct uep_softc *sc = evdev_get_softc(evdev); mtx_assert(&sc->mtx, MA_OWNED); usbd_transfer_stop(sc->xfer[UEP_INTR_DT]); + + return (0); } static int -uep_ev_open(struct evdev_dev *evdev, void *ev_softc) +uep_ev_open(struct evdev_dev *evdev) { - struct uep_softc *sc = (struct uep_softc *)ev_softc; + struct uep_softc *sc = evdev_get_softc(evdev); mtx_assert(&sc->mtx, MA_OWNED); usbd_transfer_start(sc->xfer[UEP_INTR_DT]); Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/dev/usb/input/ums.c Mon Aug 13 19:00:42 2018 (r337720) @@ -950,9 +950,9 @@ ums_reset_buf(struct ums_softc *sc) #ifdef EVDEV_SUPPORT static int -ums_ev_open(struct evdev_dev *evdev, void *ev_softc) +ums_ev_open(struct evdev_dev *evdev) { - struct ums_softc *sc = (struct ums_softc *)ev_softc; + struct ums_softc *sc = evdev_get_softc(evdev); mtx_assert(&sc->sc_mtx, MA_OWNED); @@ -966,10 +966,10 @@ ums_ev_open(struct evdev_dev *evdev, void *ev_softc) return (0); } -static void -ums_ev_close(struct evdev_dev *evdev, void *ev_softc) +static int +ums_ev_close(struct evdev_dev *evdev) { - struct ums_softc *sc = (struct ums_softc *)ev_softc; + struct ums_softc *sc = evdev_get_softc(evdev); mtx_assert(&sc->sc_mtx, MA_OWNED); @@ -977,6 +977,8 @@ ums_ev_close(struct evdev_dev *evdev, void *ev_softc) if (sc->sc_fflags == 0) ums_stop_rx(sc); + + return (0); } #endif Modified: head/sys/dev/usb/input/wmt.c ============================================================================== --- head/sys/dev/usb/input/wmt.c Mon Aug 13 18:53:14 2018 (r337719) +++ head/sys/dev/usb/input/wmt.c Mon Aug 13 19:00:42 2018 (r337720) @@ -226,12 +226,22 @@ static device_probe_t wmt_probe; static device_attach_t wmt_attach; static device_detach_t wmt_detach; +#if __FreeBSD_version >= 1200077 static evdev_open_t wmt_ev_open; static evdev_close_t wmt_ev_close; +#else +static evdev_open_t wmt_ev_open_11; +static evdev_close_t wmt_ev_close_11; +#endif static const struct evdev_methods wmt_evdev_methods = { +#if __FreeBSD_version >= 1200077 .ev_open = &wmt_ev_open, .ev_close = &wmt_ev_close, +#else + .ev_open = &wmt_ev_open_11, + .ev_close = &wmt_ev_close_11, +#endif }; static const struct usb_config wmt_config[WMT_N_TRANSFER] = { @@ -525,24 +535,45 @@ tr_setup: } static void -wmt_ev_close(struct evdev_dev *evdev, void *ev_softc) +wmt_ev_close_11(struct evdev_dev *evdev, void *ev_softc) { - struct wmt_softc *sc = (struct wmt_softc *)ev_softc; + struct wmt_softc *sc = ev_softc; mtx_assert(&sc->mtx, MA_OWNED); usbd_transfer_stop(sc->xfer[WMT_INTR_DT]); } static int -wmt_ev_open(struct evdev_dev *evdev, void *ev_softc) +wmt_ev_open_11(struct evdev_dev *evdev, void *ev_softc) { - struct wmt_softc *sc = (struct wmt_softc *)ev_softc; + struct wmt_softc *sc = ev_softc; mtx_assert(&sc->mtx, MA_OWNED); usbd_transfer_start(sc->xfer[WMT_INTR_DT]); return (0); } + +#if __FreeBSD_version >= 1200077 +static int +wmt_ev_close(struct evdev_dev *evdev) +{ + struct wmt_softc *sc = evdev_get_softc(evdev); + + wmt_ev_close_11(evdev, sc); + + return (0); +} + +static int +wmt_ev_open(struct evdev_dev *evdev) +{ + struct wmt_softc *sc = evdev_get_softc(evdev); + + return (wmt_ev_open_11(evdev, sc)); + +} +#endif /* port of userland hid_report_size() from usbhid(3) to kernel */ static int From owner-svn-src-all@freebsd.org Mon Aug 13 19:05:55 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 8DAF9107A927; Mon, 13 Aug 2018 19:05:55 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AC608763F; Mon, 13 Aug 2018 19:05:55 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BC3B10CDE; Mon, 13 Aug 2018 19:05:55 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DJ5src021786; Mon, 13 Aug 2018 19:05:54 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DJ5rod021779; Mon, 13 Aug 2018 19:05:53 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201808131905.w7DJ5rod021779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 13 Aug 2018 19:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337721 - in head/sys/dev: atkbdc evdev kbd kbdmux usb/input X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head/sys/dev: atkbdc evdev kbd kbdmux usb/input X-SVN-Commit-Revision: 337721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 19:05:55 -0000 Author: wulf Date: Mon Aug 13 19:05:53 2018 New Revision: 337721 URL: https://svnweb.freebsd.org/changeset/base/337721 Log: evdev: Remove evdev.ko linkage dependency on kbd driver Move evdev_ev_kbd_event() helper from evdev to kbd.c as otherwise evdev unconditionally requires all keyboard and console stuff to be compiled into the kernel. This dependency happens as evdev_ev_kbd_event() helper references kbdsw global variable defined in kbd.c through use of kbdd_ioctl() macro. While here make all keyboard drivers respect evdev_rcpt_mask while setting typematic rate and LEDs with evdev interface. Requested by: Milan Obuch Reviewed by: hselasky, gonzo Differential Revision: https://reviews.freebsd.org/D16614 Modified: head/sys/dev/atkbdc/atkbd.c head/sys/dev/evdev/evdev.h head/sys/dev/evdev/evdev_utils.c head/sys/dev/kbd/kbd.c head/sys/dev/kbd/kbdreg.h head/sys/dev/kbdmux/kbdmux.c head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Aug 13 19:00:42 2018 (r337720) +++ head/sys/dev/atkbdc/atkbd.c Mon Aug 13 19:05:53 2018 (r337721) @@ -267,8 +267,10 @@ static int typematic_delay(int delay); static int typematic_rate(int rate); #ifdef EVDEV_SUPPORT +static evdev_event_t atkbd_ev_event; + static const struct evdev_methods atkbd_evdev_methods = { - .ev_event = evdev_ev_kbd_event, + .ev_event = atkbd_ev_event, }; #endif @@ -1204,6 +1206,22 @@ atkbd_reset(KBDC kbdc, int flags, int c) } return (0); } + +#ifdef EVDEV_SUPPORT +static void +atkbd_ev_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, + int32_t value) +{ + keyboard_t *kbd = evdev_get_softc(evdev); + + if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && + (type == EV_LED || type == EV_REP)) { + mtx_lock(&Giant); + kbd_ev_event(kbd, type, code, value); + mtx_unlock(&Giant); + } +} +#endif /* local functions */ Modified: head/sys/dev/evdev/evdev.h ============================================================================== --- head/sys/dev/evdev/evdev.h Mon Aug 13 19:00:42 2018 (r337720) +++ head/sys/dev/evdev/evdev.h Mon Aug 13 19:05:53 2018 (r337721) @@ -141,7 +141,6 @@ uint16_t evdev_scancode2key(int *, int); void evdev_push_mouse_btn(struct evdev_dev *, int); void evdev_push_leds(struct evdev_dev *, int); void evdev_push_repeats(struct evdev_dev *, keyboard_t *); -evdev_event_t evdev_ev_kbd_event; /* Event reporting shortcuts: */ static __inline int Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Mon Aug 13 19:00:42 2018 (r337720) +++ head/sys/dev/evdev/evdev_utils.c Mon Aug 13 19:05:53 2018 (r337721) @@ -40,8 +40,6 @@ #include #include -#include - #define NONE KEY_RESERVED static uint16_t evdev_usb_scancodes[256] = { @@ -298,44 +296,4 @@ evdev_push_repeats(struct evdev_dev *evdev, keyboard_t evdev_push_event(evdev, EV_REP, REP_DELAY, kbd->kb_delay1); evdev_push_event(evdev, EV_REP, REP_PERIOD, kbd->kb_delay2); -} - -void -evdev_ev_kbd_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, - int32_t value) -{ - keyboard_t *kbd = (keyboard_t *)evdev_get_softc(evdev); - int delay[2], leds, oleds; - size_t i; - - if (type == EV_LED) { - leds = oleds = KBD_LED_VAL(kbd); - for (i = 0; i < nitems(evdev_led_codes); i++) { - if (evdev_led_codes[i] == code) { - if (value) - leds |= 1 << i; - else - leds &= ~(1 << i); - if (leds != oleds) { - mtx_lock(&Giant); - kbdd_ioctl(kbd, KDSETLED, - (caddr_t)&leds); - mtx_unlock(&Giant); - } - break; - } - } - } else if (type == EV_REP && code == REP_DELAY) { - delay[0] = value; - delay[1] = kbd->kb_delay2; - mtx_lock(&Giant); - kbdd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); - mtx_unlock(&Giant); - } else if (type == EV_REP && code == REP_PERIOD) { - delay[0] = kbd->kb_delay1; - delay[1] = value; - mtx_lock(&Giant); - kbdd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); - mtx_unlock(&Giant); - } } Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Mon Aug 13 19:00:42 2018 (r337720) +++ head/sys/dev/kbd/kbd.c Mon Aug 13 19:05:53 2018 (r337721) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #define KBD_INDEX(dev) dev2unit(dev) @@ -1474,4 +1475,42 @@ genkbd_keyaction(keyboard_t *kbd, int keycode, int up, } } /* NOT REACHED */ +} + +void +kbd_ev_event(keyboard_t *kbd, uint16_t type, uint16_t code, int32_t value) +{ + int delay[2], led = 0, leds, oleds; + + if (type == EV_LED) { + leds = oleds = KBD_LED_VAL(kbd); + switch (code) { + case LED_CAPSL: + led = CLKED; + break; + case LED_NUML: + led = NLKED; + break; + case LED_SCROLLL: + led = SLKED; + break; + } + + if (value) + leds |= led; + else + leds &= ~led; + + if (leds != oleds) + kbdd_ioctl(kbd, KDSETLED, (caddr_t)&leds); + + } else if (type == EV_REP && code == REP_DELAY) { + delay[0] = value; + delay[1] = kbd->kb_delay2; + kbdd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); + } else if (type == EV_REP && code == REP_PERIOD) { + delay[0] = kbd->kb_delay1; + delay[1] = value; + kbdd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); + } } Modified: head/sys/dev/kbd/kbdreg.h ============================================================================== --- head/sys/dev/kbd/kbdreg.h Mon Aug 13 19:00:42 2018 (r337720) +++ head/sys/dev/kbd/kbdreg.h Mon Aug 13 19:05:53 2018 (r337721) @@ -253,6 +253,10 @@ keyboard_t *kbd_get_keyboard(int index); int kbd_configure(int flags); /* see `kb_config' above for flag bit definitions */ +/* evdev2kbd mappings */ +void kbd_ev_event(keyboard_t *kbd, uint16_t type, + uint16_t code, int32_t value); + #ifdef KBD_INSTALL_CDEV /* virtual keyboard cdev driver functions */ Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Mon Aug 13 19:00:42 2018 (r337720) +++ head/sys/dev/kbdmux/kbdmux.c Mon Aug 13 19:05:53 2018 (r337721) @@ -384,8 +384,10 @@ static keyboard_switch_t kbdmuxsw = { }; #ifdef EVDEV_SUPPORT +static evdev_event_t kbdmux_ev_event; + static const struct evdev_methods kbdmux_evdev_methods = { - .ev_event = evdev_ev_kbd_event, + .ev_event = kbdmux_ev_event, }; #endif @@ -1389,6 +1391,22 @@ kbdmux_poll(keyboard_t *kbd, int on) return (0); } + +#ifdef EVDEV_SUPPORT +static void +kbdmux_ev_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, + int32_t value) +{ + keyboard_t *kbd = evdev_get_softc(evdev); + + if (evdev_rcpt_mask & EVDEV_RCPT_KBDMUX && + (type == EV_LED || type == EV_REP)) { + mtx_lock(&Giant); + kbd_ev_event(kbd, type, code, value); + mtx_unlock(&Giant); + } +} +#endif /***************************************************************************** ***************************************************************************** Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Mon Aug 13 19:00:42 2018 (r337720) +++ head/sys/dev/usb/input/ukbd.c Mon Aug 13 19:05:53 2018 (r337721) @@ -365,8 +365,10 @@ static device_detach_t ukbd_detach; static device_resume_t ukbd_resume; #ifdef EVDEV_SUPPORT +static evdev_event_t ukbd_ev_event; + static const struct evdev_methods ukbd_evdev_methods = { - .ev_event = evdev_ev_kbd_event, + .ev_event = ukbd_ev_event, }; #endif @@ -1471,6 +1473,22 @@ ukbd_resume(device_t dev) return (0); } + +#ifdef EVDEV_SUPPORT +static void +ukbd_ev_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, + int32_t value) +{ + keyboard_t *kbd = evdev_get_softc(evdev); + + if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && + (type == EV_LED || type == EV_REP)) { + mtx_lock(&Giant); + kbd_ev_event(kbd, type, code, value); + mtx_unlock(&Giant); + } +} +#endif /* early keyboard probe, not supported */ static int From owner-svn-src-all@freebsd.org Mon Aug 13 19:21: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 EED7D107AFBF; Mon, 13 Aug 2018 19:21:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A69FB887DB; Mon, 13 Aug 2018 19:21:28 +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 8770310FBA; Mon, 13 Aug 2018 19:21:28 +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 w7DJLSbT030525; Mon, 13 Aug 2018 19:21:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DJLSuf030524; Mon, 13 Aug 2018 19:21:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808131921.w7DJLSuf030524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 13 Aug 2018 19:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337722 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 337722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 19:21:29 -0000 Author: np Date: Mon Aug 13 19:21:28 2018 New Revision: 337722 URL: https://svnweb.freebsd.org/changeset/base/337722 Log: Whitespace nit in t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Mon Aug 13 19:05:53 2018 (r337721) +++ head/sys/dev/cxgbe/tom/t4_tom.h Mon Aug 13 19:21:28 2018 (r337722) @@ -281,7 +281,7 @@ struct tom_data { struct ppod_region pr; vmem_t *key_map; - + struct mtx clip_table_lock; struct clip_head clip_table; int clip_gen; From owner-svn-src-all@freebsd.org Mon Aug 13 19:59: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 97523107BB71; Mon, 13 Aug 2018 19:59:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2DB89DD6; Mon, 13 Aug 2018 19:59:33 +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 28AF011526; Mon, 13 Aug 2018 19:59:33 +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 w7DJxX8v047486; Mon, 13 Aug 2018 19:59:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DJxWUZ047484; Mon, 13 Aug 2018 19:59:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808131959.w7DJxWUZ047484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 13 Aug 2018 19:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337723 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 337723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 19:59:33 -0000 Author: imp Date: Mon Aug 13 19:59:32 2018 New Revision: 337723 URL: https://svnweb.freebsd.org/changeset/base/337723 Log: Create xpt_sim_poll and refactor a bit using it. xpt_sim_poll takes the sim to poll as an argument. It will do the proper locking protocol, call the SIM polling routine, and then call camisr_runqueue to process completions on any CCBs the SIM's poll routine completed. It will be used during late shutdown when a SIM is waiting for CCBs it sent during shutdown to finish and the scheduler isn't running because we've panic'd. This sequence was used twice in cam_xpt, so refactor those to use this new function. Sponsored by: Netflix Differential Review: https://reviews.freebsd.org/D16663 Modified: head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt.h Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Aug 13 19:21:28 2018 (r337722) +++ head/sys/cam/cam_xpt.c Mon Aug 13 19:59:32 2018 (r337723) @@ -3198,6 +3198,25 @@ call_sim: start_ccb->ccb_h.status)); } +/* + * Call the sim poll routine to allow the sim to complete + * any inflight requests, then call camisr_runqueue to + * complete any CCB that the polling completed. + */ +void +xpt_sim_poll(struct cam_sim *sim) +{ + struct mtx *mtx; + + mtx = sim->mtx; + if (mtx) + mtx_lock(mtx); + (*(sim->sim_poll))(sim); + if (mtx) + mtx_unlock(mtx); + camisr_runqueue(); +} + uint32_t xpt_poll_setup(union ccb *start_ccb) { @@ -3205,12 +3224,10 @@ xpt_poll_setup(union ccb *start_ccb) struct cam_sim *sim; struct cam_devq *devq; struct cam_ed *dev; - struct mtx *mtx; timeout = start_ccb->ccb_h.timeout * 10; sim = start_ccb->ccb_h.path->bus->sim; devq = sim->devq; - mtx = sim->mtx; dev = start_ccb->ccb_h.path->device; /* @@ -3223,12 +3240,7 @@ xpt_poll_setup(union ccb *start_ccb) (--timeout > 0)) { mtx_unlock(&devq->send_mtx); DELAY(100); - if (mtx) - mtx_lock(mtx); - (*(sim->sim_poll))(sim); - if (mtx) - mtx_unlock(mtx); - camisr_runqueue(); + xpt_sim_poll(sim); mtx_lock(&devq->send_mtx); } dev->ccbq.dev_openings++; @@ -3240,19 +3252,9 @@ xpt_poll_setup(union ccb *start_ccb) void xpt_pollwait(union ccb *start_ccb, uint32_t timeout) { - struct cam_sim *sim; - struct mtx *mtx; - sim = start_ccb->ccb_h.path->bus->sim; - mtx = sim->mtx; - while (--timeout > 0) { - if (mtx) - mtx_lock(mtx); - (*(sim->sim_poll))(sim); - if (mtx) - mtx_unlock(mtx); - camisr_runqueue(); + xpt_sim_poll(start_ccb->ccb_h.path->bus->sim); if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) break; Modified: head/sys/cam/cam_xpt.h ============================================================================== --- head/sys/cam/cam_xpt.h Mon Aug 13 19:21:28 2018 (r337722) +++ head/sys/cam/cam_xpt.h Mon Aug 13 19:59:32 2018 (r337723) @@ -148,6 +148,7 @@ void xpt_release_path(struct cam_path *path); const char * xpt_action_name(uint32_t action); void xpt_pollwait(union ccb *start_ccb, uint32_t timeout); uint32_t xpt_poll_setup(union ccb *start_ccb); +void xpt_sim_poll(struct cam_sim *sim); /* * Perform a path inquiry at the request priority. The bzero may be From owner-svn-src-all@freebsd.org Mon Aug 13 19:59: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 78EFB107BB97; Mon, 13 Aug 2018 19:59:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB55389E41; Mon, 13 Aug 2018 19:59:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD2B011527; Mon, 13 Aug 2018 19:59:37 +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 w7DJxbWk047537; Mon, 13 Aug 2018 19:59:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DJxbV2047536; Mon, 13 Aug 2018 19:59:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808131959.w7DJxbV2047536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 13 Aug 2018 19:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337724 - head/sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/mps X-SVN-Commit-Revision: 337724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 19:59:39 -0000 Author: imp Date: Mon Aug 13 19:59:37 2018 New Revision: 337724 URL: https://svnweb.freebsd.org/changeset/base/337724 Log: Call xpt_sim_poll in shutdown_final handler. When we're shutting down, we send a number of start/stop commands to the known targets. We have to wait for them to complete. During a panic, the interrupts are off, and using pause to wait for them to fire and complete won't work: we have to poll after pause returns so the completion routines of the CCBs run so we decrement work outstanding counts. Sponsored by: Netflix Differential Review: https://reviews.freebsd.org/D16663 Modified: head/sys/dev/mps/mps_sas_lsi.c Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Mon Aug 13 19:59:32 2018 (r337723) +++ head/sys/dev/mps/mps_sas_lsi.c Mon Aug 13 19:59:37 2018 (r337724) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1209,7 +1210,9 @@ mpssas_SSU_to_SATA_devices(struct mps_softc *sc, int h */ while (sc->SSU_refcount > 0) { pause("mpswait", hz/10); - + if (SCHEDULER_STOPPED()) + xpt_sim_poll(sassc->sim); + if (--timeout == 0) { mps_dprint(sc, MPS_FAULT, "Time has expired waiting " "for SSU commands to complete.\n"); From owner-svn-src-all@freebsd.org Mon Aug 13 19:59: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 ECC4D107BBB6; Mon, 13 Aug 2018 19:59:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C48389EF0; Mon, 13 Aug 2018 19:59:43 +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 E367211528; Mon, 13 Aug 2018 19:59:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DJxg8B047593; Mon, 13 Aug 2018 19:59:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DJxgKM047590; Mon, 13 Aug 2018 19:59:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808131959.w7DJxgKM047590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 13 Aug 2018 19:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337725 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 337725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 19:59:47 -0000 Author: imp Date: Mon Aug 13 19:59:42 2018 New Revision: 337725 URL: https://svnweb.freebsd.org/changeset/base/337725 Log: Port the mps panic-safe shutdown_final handling to mpr r330951 by smh fixed the mps driver to avoid deadlocks when panicing. The same code is needed for mpr, so port it here, along with the fix which allows the CCBs scheduled to complete avoiding at least a scary message and likely other unintended consequences. Sponsored by: Netflix Differential Review: https://reviews.freebsd.org/D16663 Modified: head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Mon Aug 13 19:59:37 2018 (r337724) +++ head/sys/dev/mpr/mpr_sas_lsi.c Mon Aug 13 19:59:42 2018 (r337725) @@ -46,10 +46,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include @@ -127,7 +129,7 @@ int mprsas_get_sas_address_for_sata_disk(struct mpr_so u64 *sas_address, u16 handle, u32 device_info, u8 *is_SATA_SSD); static int mprsas_volume_add(struct mpr_softc *sc, u16 handle); -static void mprsas_SSU_to_SATA_devices(struct mpr_softc *sc); +static void mprsas_SSU_to_SATA_devices(struct mpr_softc *sc, int howto); static void mprsas_stop_unit_done(struct cam_periph *periph, union ccb *done_ccb); @@ -1469,7 +1471,7 @@ out: * Return nothing. */ static void -mprsas_SSU_to_SATA_devices(struct mpr_softc *sc) +mprsas_SSU_to_SATA_devices(struct mpr_softc *sc, int howto) { struct mprsas_softc *sassc = sc->sassc; union ccb *ccb; @@ -1477,7 +1479,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc) target_id_t targetid; struct mprsas_target *target; char path_str[64]; - struct timeval cur_time, start_time; + int timeout; mpr_lock(sc); @@ -1544,17 +1546,25 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc) mpr_unlock(sc); /* - * Wait until all of the SSU commands have completed or time has - * expired (60 seconds). Pause for 100ms each time through. If any - * command times out, the target will be reset in the SCSI command - * timeout routine. + * Timeout after 60 seconds by default or 10 seconds if howto has + * RB_NOSYNC set which indicates we're likely handling a panic. */ - getmicrotime(&start_time); - while (sc->SSU_refcount) { + timeout = 600; + if (howto & RB_NOSYNC) + timeout = 100; + + /* + * Wait until all of the SSU commands have completed or time + * has expired. Pause for 100ms each time through. If any + * command times out, the target will be reset in the SCSI + * command timeout routine. + */ + while (sc->SSU_refcount > 0) { pause("mprwait", hz/10); + if (SCHEDULER_STOPPED()) + xpt_sim_poll(sassc->sim); - getmicrotime(&cur_time); - if ((cur_time.tv_sec - start_time.tv_sec) > 60) { + if (--timeout == 0) { mpr_dprint(sc, MPR_ERROR, "Time has expired waiting " "for SSU commands to complete.\n"); break; @@ -1596,7 +1606,7 @@ mprsas_stop_unit_done(struct cam_periph *periph, union * Return nothing. */ void -mprsas_ir_shutdown(struct mpr_softc *sc) +mprsas_ir_shutdown(struct mpr_softc *sc, int howto) { u16 volume_mapping_flags; u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags); @@ -1701,5 +1711,5 @@ out: } } } - mprsas_SSU_to_SATA_devices(sc); + mprsas_SSU_to_SATA_devices(sc, howto); } Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Mon Aug 13 19:59:37 2018 (r337724) +++ head/sys/dev/mpr/mprvar.h Mon Aug 13 19:59:42 2018 (r337725) @@ -807,7 +807,7 @@ int mpr_config_get_volume_wwid(struct mpr_softc *sc, u int mpr_config_get_raid_pd_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, Mpi2RaidPhysDiskPage0_t *config_page, u32 page_address); -void mprsas_ir_shutdown(struct mpr_softc *sc); +void mprsas_ir_shutdown(struct mpr_softc *sc, int howto); int mpr_reinit(struct mpr_softc *sc); void mprsas_handle_reinit(struct mpr_softc *sc); Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Mon Aug 13 19:59:37 2018 (r337724) +++ head/sys/dev/mps/mps_sas_lsi.c Mon Aug 13 19:59:42 2018 (r337725) @@ -1115,6 +1115,7 @@ out: /** * mpssas_SSU_to_SATA_devices * @sc: per adapter object + * @howto: mast of RB_* bits for how we're rebooting * * Looks through the target list and issues a StartStopUnit SCSI command to each * SATA direct-access device. This helps to ensure that data corruption is @@ -1248,6 +1249,7 @@ mpssas_stop_unit_done(struct cam_periph *periph, union /** * mpssas_ir_shutdown - IR shutdown notification * @sc: per adapter object + * @howto: mast of RB_* bits for how we're rebooting * * Sending RAID Action to alert the Integrated RAID subsystem of the IOC that * the host system is shutting down. From owner-svn-src-all@freebsd.org Mon Aug 13 20:29:40 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 907A0107CB2F; Mon, 13 Aug 2018 20:29:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 433CF8B979; Mon, 13 Aug 2018 20:29:40 +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 1A782119E1; Mon, 13 Aug 2018 20:29:40 +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 w7DKTd0t063315; Mon, 13 Aug 2018 20:29:39 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DKTduo063314; Mon, 13 Aug 2018 20:29:39 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201808132029.w7DKTduo063314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 13 Aug 2018 20:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337726 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 337726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 20:29:40 -0000 Author: marius Date: Mon Aug 13 20:29:39 2018 New Revision: 337726 URL: https://svnweb.freebsd.org/changeset/base/337726 Log: Remove the duplicated CSUM_IP6_TCP introduced in r311849 from the TX checksum capabilities of IGB-class MACs. While at it, fix the line wrapping. PR: 230571 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Aug 13 19:59:42 2018 (r337725) +++ head/sys/dev/e1000/if_em.c Mon Aug 13 20:29:39 2018 (r337726) @@ -793,8 +793,8 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_tso_size_max = EM_TSO_SIZE; scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; scctx->isc_capabilities = scctx->isc_capenable = IGB_CAPS; - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP \ - | CSUM_IP6_UDP | CSUM_IP6_TCP; + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_TSO | + CSUM_IP6_TCP | CSUM_IP6_UDP; if (adapter->hw.mac.type != e1000_82575) scctx->isc_tx_csum_flags |= CSUM_SCTP | CSUM_IP6_SCTP; From owner-svn-src-all@freebsd.org Mon Aug 13 21:53: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 44B67107ED29; Mon, 13 Aug 2018 21:53:19 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E560E8EF87; Mon, 13 Aug 2018 21:53:18 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1FEB128A0; Mon, 13 Aug 2018 21:53:18 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DLrI7L009388; Mon, 13 Aug 2018 21:53:18 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DLrI4W009387; Mon, 13 Aug 2018 21:53:18 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201808132153.w7DLrI4W009387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 13 Aug 2018 21:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337727 - head/sys/dev/sbni X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/sbni X-SVN-Commit-Revision: 337727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 21:53:19 -0000 Author: brooks Date: Mon Aug 13 21:53:18 2018 New Revision: 337727 URL: https://svnweb.freebsd.org/changeset/base/337727 Log: Copy out from kernel to data, not the other way around. MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/sys/dev/sbni/if_sbni.c Modified: head/sys/dev/sbni/if_sbni.c ============================================================================== --- head/sys/dev/sbni/if_sbni.c Mon Aug 13 20:29:39 2018 (r337726) +++ head/sys/dev/sbni/if_sbni.c Mon Aug 13 21:53:18 2018 (r337727) @@ -1153,7 +1153,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t SBNI_LOCK(sc); bcopy(&sc->in_stats, in_stats, sizeof(struct sbni_in_stats)); SBNI_UNLOCK(sc); - error = copyout(ifr_data_get_ptr(ifr), in_stats, + error = copyout(in_stats, ifr_data_get_ptr(ifr), sizeof(struct sbni_in_stats)); free(in_stats, M_DEVBUF); break; From owner-svn-src-all@freebsd.org Mon Aug 13 21:54:28 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 6B642107ED8E; Mon, 13 Aug 2018 21:54:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20EB98F0E4; Mon, 13 Aug 2018 21:54:28 +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 01F45128A1; Mon, 13 Aug 2018 21:54:28 +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 w7DLsRoT009481; Mon, 13 Aug 2018 21:54:27 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DLsRXm009478; Mon, 13 Aug 2018 21:54:27 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201808132154.w7DLsRXm009478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 13 Aug 2018 21:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337728 - head/usr.bin/printf/tests X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/usr.bin/printf/tests X-SVN-Commit-Revision: 337728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 21:54:28 -0000 Author: jilles Date: Mon Aug 13 21:54:27 2018 New Revision: 337728 URL: https://svnweb.freebsd.org/changeset/base/337728 Log: printf: Add test for width and precision in %b format PR: 229641 Submitted by: pfg Added: head/usr.bin/printf/tests/regress.bwidth.out (contents, props changed) Modified: head/usr.bin/printf/tests/Makefile head/usr.bin/printf/tests/regress.sh Modified: head/usr.bin/printf/tests/Makefile ============================================================================== --- head/usr.bin/printf/tests/Makefile Mon Aug 13 21:53:18 2018 (r337727) +++ head/usr.bin/printf/tests/Makefile Mon Aug 13 21:54:27 2018 (r337728) @@ -5,6 +5,7 @@ PACKAGE= tests TAP_TESTS_SH= legacy_test ${PACKAGE}FILES+= regress.b.out +${PACKAGE}FILES+= regress.bwidth.out ${PACKAGE}FILES+= regress.d.out ${PACKAGE}FILES+= regress.f.out ${PACKAGE}FILES+= regress.l1.out Added: head/usr.bin/printf/tests/regress.bwidth.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/printf/tests/regress.bwidth.out Mon Aug 13 21:54:27 2018 (r337728) @@ -0,0 +1 @@ + a Modified: head/usr.bin/printf/tests/regress.sh ============================================================================== --- head/usr.bin/printf/tests/regress.sh Mon Aug 13 21:53:18 2018 (r337727) +++ head/usr.bin/printf/tests/regress.sh Mon Aug 13 21:54:27 2018 (r337728) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..23' +echo '1..24' REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') @@ -27,5 +27,6 @@ REGRESSION_TEST(`missingpos1', `printf "%*.*1\$s" 1 1 REGRESSION_TEST(`missingpos1', `printf "%1\$*2\$.*s" 1 1 1 2>&1') REGRESSION_TEST(`missingpos1', `printf "%*1\$.*2\$s" 1 1 1 2>&1') REGRESSION_TEST(`missingpos1', `printf "%1\$*.*2\$s" 1 1 1 2>&1') +REGRESSION_TEST(`bwidth', `printf "%8.2b" "a\nb\n"') REGRESSION_END() From owner-svn-src-all@freebsd.org Mon Aug 13 22:34: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 39029107FA62; Mon, 13 Aug 2018 22:34:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2F19704B6; Mon, 13 Aug 2018 22:34:57 +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 BFD9812F04; Mon, 13 Aug 2018 22:34:57 +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 w7DMYvuR030260; Mon, 13 Aug 2018 22:34:57 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DMYvIw030258; Mon, 13 Aug 2018 22:34:57 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808132234.w7DMYvIw030258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 13 Aug 2018 22:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337729 - in head/lib/libpmc/pmu-events/arch/x86: . amdfam17h X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/lib/libpmc/pmu-events/arch/x86: . amdfam17h X-SVN-Commit-Revision: 337729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 22:34:58 -0000 Author: mmacy Date: Mon Aug 13 22:34:57 2018 New Revision: 337729 URL: https://svnweb.freebsd.org/changeset/base/337729 Log: Add PMC support for AMD Family CPUs Added: head/lib/libpmc/pmu-events/arch/x86/amdfam17h/ head/lib/libpmc/pmu-events/arch/x86/amdfam17h/cache.json (contents, props changed) head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json (contents, props changed) head/lib/libpmc/pmu-events/arch/x86/amdfam17h/floating-point.json (contents, props changed) head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json (contents, props changed) head/lib/libpmc/pmu-events/arch/x86/amdfam17h/other.json (contents, props changed) Modified: head/lib/libpmc/pmu-events/arch/x86/mapfile.csv Added: head/lib/libpmc/pmu-events/arch/x86/amdfam17h/cache.json ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpmc/pmu-events/arch/x86/amdfam17h/cache.json Mon Aug 13 22:34:57 2018 (r337729) @@ -0,0 +1,1987 @@ +[ + { + "EventName": "ic_fw32", + "EventCode": "0x80", + "BriefDescription": "The number of 32B fetch windows transferred from IC pipe to DE instruction decoder (includes non-cacheable and cacheable fill responses)." + }, + { + "EventName": "ic_fw32_miss", + "EventCode": "0x81", + "BriefDescription": "The number of 32B fetch windows tried to read the L1 IC and missed in the full tag." + }, + { + "EventName": "ic_cache_fill_l2", + "EventCode": "0x82", + "BriefDescription": "The number of 64 byte instruction cache line was fulfilled from the L2 cache." + }, + { + "EventName": "ic_cache_fill_sys", + "EventCode": "0x83", + "BriefDescription": "The number of 64 byte instruction cache line fulfilled from system memory or another cache." + }, + { + "EventName": "bp_l1_tlb_miss_l2_hit", + "EventCode": "0x84", + "BriefDescription": "The number of instruction fetches that miss in the L1 ITLB but hit in the L2 ITLB." + }, + { + "EventName": "bp_l1_tlb_miss_l2_miss", + "EventCode": "0x85", + "BriefDescription": "The number of instruction fetches that miss in both the L1 and L2 TLBs." + }, + { + "EventName": "bp_snp_re_sync", + "EventCode": "0x86", + "BriefDescription": "The number of pipeline restarts caused by invalidating probes that hit on the instruction stream currently being executed. This would happen if the active instruction stream was being modified by another processor in an MP system - typically a highly unlikely event." + }, + { + "EventName": "ic_fetch_stall.ic_stall_any", + "EventCode": "0x87", + "BriefDescription": "IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", + "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", + "UMask": "0x4" + }, + { + "EventName": "ic_fetch_stall.ic_stall_dq_empty", + "EventCode": "0x87", + "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", + "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", + "UMask": "0x2" + }, + { + "EventName": "ic_fetch_stall.ic_stall_back_pressure", + "EventCode": "0x87", + "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", + "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", + "UMask": "0x1" + }, + { + "EventName": "bp_l1_btb_correct", + "EventCode": "0x8a", + "BriefDescription": "L1 BTB Correction." + }, + { + "EventName": "bp_l2_btb_correct", + "EventCode": "0x8b", + "BriefDescription": "L2 BTB Correction." + }, + { + "EventName": "ic_cache_inval.l2_invalidating_probe", + "EventCode": "0x8c", + "BriefDescription": "IC line invalidated due to L2 invalidating probe (external or LS).", + "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to L2 invalidating probe (external or LS).", + "UMask": "0x2" + }, + { + "EventName": "ic_cache_inval.fill_invalidated", + "EventCode": "0x8c", + "BriefDescription": "IC line invalidated due to overwriting fill response.", + "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to overwriting fill response.", + "UMask": "0x1" + }, + { + "EventName": "bp_tlb_rel", + "EventCode": "0x99", + "BriefDescription": "The number of ITLB reload requests." + }, + { + "EventName": "ic_oc_mode_switch.oc_ic_mode_switch", + "EventCode": "0x28a", + "BriefDescription": "OC to IC mode switch.", + "PublicDescription": "OC Mode Switch. OC to IC mode switch.", + "UMask": "0x2" + }, + { + "EventName": "ic_oc_mode_switch.ic_oc_mode_switch", + "EventCode": "0x28a", + "BriefDescription": "IC to OC mode switch.", + "PublicDescription": "OC Mode Switch. IC to OC mode switch.", + "UMask": "0x1" + }, + { + "EventName": "l2_request_g1.rd_blk_l", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x80" + }, + { + "EventName": "l2_request_g1.rd_blk_x", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x40" + }, + { + "EventName": "l2_request_g1.ls_rd_blk_c_s", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x20" + }, + { + "EventName": "l2_request_g1.cacheable_ic_read", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x10" + }, + { + "EventName": "l2_request_g1.change_to_x", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x8" + }, + { + "EventName": "l2_request_g1.prefetch_l2", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x4" + }, + { + "EventName": "l2_request_g1.l2_hw_pf", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x2" + }, + { + "EventName": "l2_request_g1.other_requests", + "EventCode": "0x60", + "BriefDescription": "Events covered by l2_request_g2.", + "PublicDescription": "Requests to L2 Group1. Events covered by l2_request_g2.", + "UMask": "0x1" + }, + { + "EventName": "l2_request_g2.group1", + "EventCode": "0x61", + "BriefDescription": "All Group 1 commands not in unit0.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. All Group 1 commands not in unit0.", + "UMask": "0x80" + }, + { + "EventName": "l2_request_g2.ls_rd_sized", + "EventCode": "0x61", + "BriefDescription": "RdSized, RdSized32, RdSized64.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSized, RdSized32, RdSized64.", + "UMask": "0x40" + }, + { + "EventName": "l2_request_g2.ls_rd_sized_nc", + "EventCode": "0x61", + "BriefDescription": "RdSizedNC, RdSized32NC, RdSized64NC.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSizedNC, RdSized32NC, RdSized64NC.", + "UMask": "0x20" + }, + { + "EventName": "l2_request_g2.ic_rd_sized", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x10" + }, + { + "EventName": "l2_request_g2.ic_rd_sized_nc", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x8" + }, + { + "EventName": "l2_request_g2.smc_inval", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x4" + }, + { + "EventName": "l2_request_g2.bus_locks_originator", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x2" + }, + { + "EventName": "l2_request_g2.bus_locks_responses", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x1" + }, + { + "EventName": "l2_latency.l2_cycles_waiting_on_fills", + "EventCode": "0x62", + "BriefDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", + "PublicDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", + "UMask": "0x1" + }, + { + "EventName": "l2_wbc_req.wcb_write", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x40" + }, + { + "EventName": "l2_wbc_req.wcb_close", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x20" + }, + { + "EventName": "l2_wbc_req.cache_line_flush", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x10" + }, + { + "EventName": "l2_wbc_req.i_line_flush", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x8" + }, + { + "EventName": "l2_wbc_req.zero_byte_store", + "EventCode": "0x63", + "BriefDescription": "This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", + "PublicDescription": "LS to L2 WBC requests. This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", + "UMask": "0x4" + }, + { + "EventName": "l2_wbc_req.local_ic_clr", + "EventCode": "0x63", + "BriefDescription": "Local IC Clear.", + "PublicDescription": "LS to L2 WBC requests. Local IC Clear.", + "UMask": "0x2" + }, + { + "EventName": "l2_wbc_req.cl_zero", + "EventCode": "0x63", + "BriefDescription": "Cache Line Zero.", + "PublicDescription": "LS to L2 WBC requests. Cache Line Zero.", + "UMask": "0x1" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_cs", + "EventCode": "0x64", + "BriefDescription": "LS ReadBlock C/S Hit.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS ReadBlock C/S Hit.", + "UMask": "0x80" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_x", + "EventCode": "0x64", + "BriefDescription": "LS Read Block L Hit X.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block L Hit X.", + "UMask": "0x40" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_s", + "EventCode": "0x64", + "BriefDescription": "LsRdBlkL Hit Shared.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkL Hit Shared.", + "UMask": "0x20" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_x", + "EventCode": "0x64", + "BriefDescription": "LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", + "UMask": "0x10" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_c", + "EventCode": "0x64", + "BriefDescription": "LS Read Block C S L X Change to X Miss.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block C S L X Change to X Miss.", + "UMask": "0x8" + }, + { + "EventName": "l2_cache_req_stat.ic_fill_hit_x", + "EventCode": "0x64", + "BriefDescription": "IC Fill Hit Exclusive Stale.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Exclusive Stale.", + "UMask": "0x4" + }, + { + "EventName": "l2_cache_req_stat.ic_fill_hit_s", + "EventCode": "0x64", + "BriefDescription": "IC Fill Hit Shared.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Shared.", + "UMask": "0x2" + }, + { + "EventName": "l2_cache_req_stat.ic_fill_miss", + "EventCode": "0x64", + "BriefDescription": "IC Fill Miss.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Miss.", + "UMask": "0x1" + }, + { + "EventName": "l2_fill_pending.l2_fill_busy", + "EventCode": "0x6d", + "BriefDescription": "Total cycles spent with one or more fill requests in flight from L2.", + "PublicDescription": "Total cycles spent with one or more fill requests in flight from L2.", + "UMask": "0x1" + } +][ + { + "EventName": "ic_fw32", + "EventCode": "0x80", + "BriefDescription": "The number of 32B fetch windows transferred from IC pipe to DE instruction decoder (includes non-cacheable and cacheable fill responses)." + }, + { + "EventName": "ic_fw32_miss", + "EventCode": "0x81", + "BriefDescription": "The number of 32B fetch windows tried to read the L1 IC and missed in the full tag." + }, + { + "EventName": "ic_cache_fill_l2", + "EventCode": "0x82", + "BriefDescription": "The number of 64 byte instruction cache line was fulfilled from the L2 cache." + }, + { + "EventName": "ic_cache_fill_sys", + "EventCode": "0x83", + "BriefDescription": "The number of 64 byte instruction cache line fulfilled from system memory or another cache." + }, + { + "EventName": "bp_l1_tlb_miss_l2_hit", + "EventCode": "0x84", + "BriefDescription": "The number of instruction fetches that miss in the L1 ITLB but hit in the L2 ITLB." + }, + { + "EventName": "bp_l1_tlb_miss_l2_miss", + "EventCode": "0x85", + "BriefDescription": "The number of instruction fetches that miss in both the L1 and L2 TLBs." + }, + { + "EventName": "bp_snp_re_sync", + "EventCode": "0x86", + "BriefDescription": "The number of pipeline restarts caused by invalidating probes that hit on the instruction stream currently being executed. This would happen if the active instruction stream was being modified by another processor in an MP system - typically a highly unlikely event." + }, + { + "EventName": "ic_fetch_stall.ic_stall_any", + "EventCode": "0x87", + "BriefDescription": "IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", + "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", + "UMask": "0x4" + }, + { + "EventName": "ic_fetch_stall.ic_stall_dq_empty", + "EventCode": "0x87", + "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", + "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", + "UMask": "0x2" + }, + { + "EventName": "ic_fetch_stall.ic_stall_back_pressure", + "EventCode": "0x87", + "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", + "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", + "UMask": "0x1" + }, + { + "EventName": "bp_l1_btb_correct", + "EventCode": "0x8a", + "BriefDescription": "L1 BTB Correction." + }, + { + "EventName": "bp_l2_btb_correct", + "EventCode": "0x8b", + "BriefDescription": "L2 BTB Correction." + }, + { + "EventName": "ic_cache_inval.l2_invalidating_probe", + "EventCode": "0x8c", + "BriefDescription": "IC line invalidated due to L2 invalidating probe (external or LS).", + "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to L2 invalidating probe (external or LS).", + "UMask": "0x2" + }, + { + "EventName": "ic_cache_inval.fill_invalidated", + "EventCode": "0x8c", + "BriefDescription": "IC line invalidated due to overwriting fill response.", + "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to overwriting fill response.", + "UMask": "0x1" + }, + { + "EventName": "bp_tlb_rel", + "EventCode": "0x99", + "BriefDescription": "The number of ITLB reload requests." + }, + { + "EventName": "ic_oc_mode_switch.oc_ic_mode_switch", + "EventCode": "0x28a", + "BriefDescription": "OC to IC mode switch.", + "PublicDescription": "OC Mode Switch. OC to IC mode switch.", + "UMask": "0x2" + }, + { + "EventName": "ic_oc_mode_switch.ic_oc_mode_switch", + "EventCode": "0x28a", + "BriefDescription": "IC to OC mode switch.", + "PublicDescription": "OC Mode Switch. IC to OC mode switch.", + "UMask": "0x1" + }, + { + "EventName": "l2_request_g1.rd_blk_l", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x80" + }, + { + "EventName": "l2_request_g1.rd_blk_x", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x40" + }, + { + "EventName": "l2_request_g1.ls_rd_blk_c_s", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x20" + }, + { + "EventName": "l2_request_g1.cacheable_ic_read", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x10" + }, + { + "EventName": "l2_request_g1.change_to_x", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x8" + }, + { + "EventName": "l2_request_g1.prefetch_l2", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x4" + }, + { + "EventName": "l2_request_g1.l2_hw_pf", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x2" + }, + { + "EventName": "l2_request_g1.other_requests", + "EventCode": "0x60", + "BriefDescription": "Events covered by l2_request_g2.", + "PublicDescription": "Requests to L2 Group1. Events covered by l2_request_g2.", + "UMask": "0x1" + }, + { + "EventName": "l2_request_g2.group1", + "EventCode": "0x61", + "BriefDescription": "All Group 1 commands not in unit0.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. All Group 1 commands not in unit0.", + "UMask": "0x80" + }, + { + "EventName": "l2_request_g2.ls_rd_sized", + "EventCode": "0x61", + "BriefDescription": "RdSized, RdSized32, RdSized64.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSized, RdSized32, RdSized64.", + "UMask": "0x40" + }, + { + "EventName": "l2_request_g2.ls_rd_sized_nc", + "EventCode": "0x61", + "BriefDescription": "RdSizedNC, RdSized32NC, RdSized64NC.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSizedNC, RdSized32NC, RdSized64NC.", + "UMask": "0x20" + }, + { + "EventName": "l2_request_g2.ic_rd_sized", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x10" + }, + { + "EventName": "l2_request_g2.ic_rd_sized_nc", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x8" + }, + { + "EventName": "l2_request_g2.smc_inval", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x4" + }, + { + "EventName": "l2_request_g2.bus_locks_originator", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x2" + }, + { + "EventName": "l2_request_g2.bus_locks_responses", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x1" + }, + { + "EventName": "l2_latency.l2_cycles_waiting_on_fills", + "EventCode": "0x62", + "BriefDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", + "PublicDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", + "UMask": "0x1" + }, + { + "EventName": "l2_wbc_req.wcb_write", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x40" + }, + { + "EventName": "l2_wbc_req.wcb_close", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x20" + }, + { + "EventName": "l2_wbc_req.cache_line_flush", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x10" + }, + { + "EventName": "l2_wbc_req.i_line_flush", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x8" + }, + { + "EventName": "l2_wbc_req.zero_byte_store", + "EventCode": "0x63", + "BriefDescription": "This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", + "PublicDescription": "LS to L2 WBC requests. This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", + "UMask": "0x4" + }, + { + "EventName": "l2_wbc_req.local_ic_clr", + "EventCode": "0x63", + "BriefDescription": "Local IC Clear.", + "PublicDescription": "LS to L2 WBC requests. Local IC Clear.", + "UMask": "0x2" + }, + { + "EventName": "l2_wbc_req.cl_zero", + "EventCode": "0x63", + "BriefDescription": "Cache Line Zero.", + "PublicDescription": "LS to L2 WBC requests. Cache Line Zero.", + "UMask": "0x1" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_cs", + "EventCode": "0x64", + "BriefDescription": "LS ReadBlock C/S Hit.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS ReadBlock C/S Hit.", + "UMask": "0x80" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_x", + "EventCode": "0x64", + "BriefDescription": "LS Read Block L Hit X.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block L Hit X.", + "UMask": "0x40" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_s", + "EventCode": "0x64", + "BriefDescription": "LsRdBlkL Hit Shared.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkL Hit Shared.", + "UMask": "0x20" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_x", + "EventCode": "0x64", + "BriefDescription": "LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", + "UMask": "0x10" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_c", + "EventCode": "0x64", + "BriefDescription": "LS Read Block C S L X Change to X Miss.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block C S L X Change to X Miss.", + "UMask": "0x8" + }, + { + "EventName": "l2_cache_req_stat.ic_fill_hit_x", + "EventCode": "0x64", + "BriefDescription": "IC Fill Hit Exclusive Stale.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Exclusive Stale.", + "UMask": "0x4" + }, + { + "EventName": "l2_cache_req_stat.ic_fill_hit_s", + "EventCode": "0x64", + "BriefDescription": "IC Fill Hit Shared.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Shared.", + "UMask": "0x2" + }, + { + "EventName": "l2_cache_req_stat.ic_fill_miss", + "EventCode": "0x64", + "BriefDescription": "IC Fill Miss.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Miss.", + "UMask": "0x1" + }, + { + "EventName": "l2_fill_pending.l2_fill_busy", + "EventCode": "0x6d", + "BriefDescription": "Total cycles spent with one or more fill requests in flight from L2.", + "PublicDescription": "Total cycles spent with one or more fill requests in flight from L2.", + "UMask": "0x1" + } +][ + { + "EventName": "ic_fw32", + "EventCode": "0x80", + "BriefDescription": "The number of 32B fetch windows transferred from IC pipe to DE instruction decoder (includes non-cacheable and cacheable fill responses)." + }, + { + "EventName": "ic_fw32_miss", + "EventCode": "0x81", + "BriefDescription": "The number of 32B fetch windows tried to read the L1 IC and missed in the full tag." + }, + { + "EventName": "ic_cache_fill_l2", + "EventCode": "0x82", + "BriefDescription": "The number of 64 byte instruction cache line was fulfilled from the L2 cache." + }, + { + "EventName": "ic_cache_fill_sys", + "EventCode": "0x83", + "BriefDescription": "The number of 64 byte instruction cache line fulfilled from system memory or another cache." + }, + { + "EventName": "bp_l1_tlb_miss_l2_hit", + "EventCode": "0x84", + "BriefDescription": "The number of instruction fetches that miss in the L1 ITLB but hit in the L2 ITLB." + }, + { + "EventName": "bp_l1_tlb_miss_l2_miss", + "EventCode": "0x85", + "BriefDescription": "The number of instruction fetches that miss in both the L1 and L2 TLBs." + }, + { + "EventName": "bp_snp_re_sync", + "EventCode": "0x86", + "BriefDescription": "The number of pipeline restarts caused by invalidating probes that hit on the instruction stream currently being executed. This would happen if the active instruction stream was being modified by another processor in an MP system - typically a highly unlikely event." + }, + { + "EventName": "ic_fetch_stall.ic_stall_any", + "EventCode": "0x87", + "BriefDescription": "IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", + "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", + "UMask": "0x4" + }, + { + "EventName": "ic_fetch_stall.ic_stall_dq_empty", + "EventCode": "0x87", + "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", + "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", + "UMask": "0x2" + }, + { + "EventName": "ic_fetch_stall.ic_stall_back_pressure", + "EventCode": "0x87", + "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", + "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", + "UMask": "0x1" + }, + { + "EventName": "bp_l1_btb_correct", + "EventCode": "0x8a", + "BriefDescription": "L1 BTB Correction." + }, + { + "EventName": "bp_l2_btb_correct", + "EventCode": "0x8b", + "BriefDescription": "L2 BTB Correction." + }, + { + "EventName": "ic_cache_inval.l2_invalidating_probe", + "EventCode": "0x8c", + "BriefDescription": "IC line invalidated due to L2 invalidating probe (external or LS).", + "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to L2 invalidating probe (external or LS).", + "UMask": "0x2" + }, + { + "EventName": "ic_cache_inval.fill_invalidated", + "EventCode": "0x8c", + "BriefDescription": "IC line invalidated due to overwriting fill response.", + "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to overwriting fill response.", + "UMask": "0x1" + }, + { + "EventName": "bp_tlb_rel", + "EventCode": "0x99", + "BriefDescription": "The number of ITLB reload requests." + }, + { + "EventName": "ic_oc_mode_switch.oc_ic_mode_switch", + "EventCode": "0x28a", + "BriefDescription": "OC to IC mode switch.", + "PublicDescription": "OC Mode Switch. OC to IC mode switch.", + "UMask": "0x2" + }, + { + "EventName": "ic_oc_mode_switch.ic_oc_mode_switch", + "EventCode": "0x28a", + "BriefDescription": "IC to OC mode switch.", + "PublicDescription": "OC Mode Switch. IC to OC mode switch.", + "UMask": "0x1" + }, + { + "EventName": "l2_request_g1.rd_blk_l", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x80" + }, + { + "EventName": "l2_request_g1.rd_blk_x", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x40" + }, + { + "EventName": "l2_request_g1.ls_rd_blk_c_s", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x20" + }, + { + "EventName": "l2_request_g1.cacheable_ic_read", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x10" + }, + { + "EventName": "l2_request_g1.change_to_x", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x8" + }, + { + "EventName": "l2_request_g1.prefetch_l2", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x4" + }, + { + "EventName": "l2_request_g1.l2_hw_pf", + "EventCode": "0x60", + "BriefDescription": "Requests to L2 Group1.", + "PublicDescription": "Requests to L2 Group1.", + "UMask": "0x2" + }, + { + "EventName": "l2_request_g1.other_requests", + "EventCode": "0x60", + "BriefDescription": "Events covered by l2_request_g2.", + "PublicDescription": "Requests to L2 Group1. Events covered by l2_request_g2.", + "UMask": "0x1" + }, + { + "EventName": "l2_request_g2.group1", + "EventCode": "0x61", + "BriefDescription": "All Group 1 commands not in unit0.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. All Group 1 commands not in unit0.", + "UMask": "0x80" + }, + { + "EventName": "l2_request_g2.ls_rd_sized", + "EventCode": "0x61", + "BriefDescription": "RdSized, RdSized32, RdSized64.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSized, RdSized32, RdSized64.", + "UMask": "0x40" + }, + { + "EventName": "l2_request_g2.ls_rd_sized_nc", + "EventCode": "0x61", + "BriefDescription": "RdSizedNC, RdSized32NC, RdSized64NC.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSizedNC, RdSized32NC, RdSized64NC.", + "UMask": "0x20" + }, + { + "EventName": "l2_request_g2.ic_rd_sized", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x10" + }, + { + "EventName": "l2_request_g2.ic_rd_sized_nc", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x8" + }, + { + "EventName": "l2_request_g2.smc_inval", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x4" + }, + { + "EventName": "l2_request_g2.bus_locks_originator", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x2" + }, + { + "EventName": "l2_request_g2.bus_locks_responses", + "EventCode": "0x61", + "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", + "UMask": "0x1" + }, + { + "EventName": "l2_latency.l2_cycles_waiting_on_fills", + "EventCode": "0x62", + "BriefDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", + "PublicDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", + "UMask": "0x1" + }, + { + "EventName": "l2_wbc_req.wcb_write", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x40" + }, + { + "EventName": "l2_wbc_req.wcb_close", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x20" + }, + { + "EventName": "l2_wbc_req.cache_line_flush", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x10" + }, + { + "EventName": "l2_wbc_req.i_line_flush", + "EventCode": "0x63", + "BriefDescription": "LS to L2 WBC requests.", + "PublicDescription": "LS to L2 WBC requests.", + "UMask": "0x8" + }, + { + "EventName": "l2_wbc_req.zero_byte_store", + "EventCode": "0x63", + "BriefDescription": "This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", + "PublicDescription": "LS to L2 WBC requests. This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", + "UMask": "0x4" + }, + { + "EventName": "l2_wbc_req.local_ic_clr", + "EventCode": "0x63", + "BriefDescription": "Local IC Clear.", + "PublicDescription": "LS to L2 WBC requests. Local IC Clear.", + "UMask": "0x2" + }, + { + "EventName": "l2_wbc_req.cl_zero", + "EventCode": "0x63", + "BriefDescription": "Cache Line Zero.", + "PublicDescription": "LS to L2 WBC requests. Cache Line Zero.", + "UMask": "0x1" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_cs", + "EventCode": "0x64", + "BriefDescription": "LS ReadBlock C/S Hit.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS ReadBlock C/S Hit.", + "UMask": "0x80" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_x", + "EventCode": "0x64", + "BriefDescription": "LS Read Block L Hit X.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block L Hit X.", + "UMask": "0x40" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_s", + "EventCode": "0x64", + "BriefDescription": "LsRdBlkL Hit Shared.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkL Hit Shared.", + "UMask": "0x20" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_x", + "EventCode": "0x64", + "BriefDescription": "LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", + "UMask": "0x10" + }, + { + "EventName": "l2_cache_req_stat.ls_rd_blk_c", + "EventCode": "0x64", + "BriefDescription": "LS Read Block C S L X Change to X Miss.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block C S L X Change to X Miss.", + "UMask": "0x8" + }, + { + "EventName": "l2_cache_req_stat.ic_fill_hit_x", + "EventCode": "0x64", + "BriefDescription": "IC Fill Hit Exclusive Stale.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Exclusive Stale.", + "UMask": "0x4" + }, + { + "EventName": "l2_cache_req_stat.ic_fill_hit_s", + "EventCode": "0x64", + "BriefDescription": "IC Fill Hit Shared.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Shared.", + "UMask": "0x2" + }, + { + "EventName": "l2_cache_req_stat.ic_fill_miss", + "EventCode": "0x64", + "BriefDescription": "IC Fill Miss.", + "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Miss.", + "UMask": "0x1" + }, + { + "EventName": "l2_fill_pending.l2_fill_busy", + "EventCode": "0x6d", + "BriefDescription": "Total cycles spent with one or more fill requests in flight from L2.", + "PublicDescription": "Total cycles spent with one or more fill requests in flight from L2.", + "UMask": "0x1" + } +][ + { + "EventName": "ic_fw32", + "EventCode": "0x80", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 13 23:46:45 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 A3B1E105811D; Mon, 13 Aug 2018 23:46:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59581722F5; Mon, 13 Aug 2018 23:46:45 +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 375BA13A1A; Mon, 13 Aug 2018 23:46:45 +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 w7DNkjIj066072; Mon, 13 Aug 2018 23:46:45 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DNkjwY066070; Mon, 13 Aug 2018 23:46:45 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808132346.w7DNkjwY066070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 13 Aug 2018 23:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337730 - in head/lib/libpmc/pmu-events/arch/x86: . amdfam17h X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/lib/libpmc/pmu-events/arch/x86: . amdfam17h X-SVN-Commit-Revision: 337730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 23:46:46 -0000 Author: mmacy Date: Mon Aug 13 23:46:44 2018 New Revision: 337730 URL: https://svnweb.freebsd.org/changeset/base/337730 Log: pmc amd17h: fix inputs to jevents Modified: head/lib/libpmc/pmu-events/arch/x86/amdfam17h/cache.json head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json head/lib/libpmc/pmu-events/arch/x86/amdfam17h/floating-point.json head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json head/lib/libpmc/pmu-events/arch/x86/amdfam17h/other.json head/lib/libpmc/pmu-events/arch/x86/mapfile.csv Modified: head/lib/libpmc/pmu-events/arch/x86/amdfam17h/cache.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/x86/amdfam17h/cache.json Mon Aug 13 22:34:57 2018 (r337729) +++ head/lib/libpmc/pmu-events/arch/x86/amdfam17h/cache.json Mon Aug 13 23:46:44 2018 (r337730) @@ -329,1659 +329,4 @@ "PublicDescription": "Total cycles spent with one or more fill requests in flight from L2.", "UMask": "0x1" } -][ - { - "EventName": "ic_fw32", - "EventCode": "0x80", - "BriefDescription": "The number of 32B fetch windows transferred from IC pipe to DE instruction decoder (includes non-cacheable and cacheable fill responses)." - }, - { - "EventName": "ic_fw32_miss", - "EventCode": "0x81", - "BriefDescription": "The number of 32B fetch windows tried to read the L1 IC and missed in the full tag." - }, - { - "EventName": "ic_cache_fill_l2", - "EventCode": "0x82", - "BriefDescription": "The number of 64 byte instruction cache line was fulfilled from the L2 cache." - }, - { - "EventName": "ic_cache_fill_sys", - "EventCode": "0x83", - "BriefDescription": "The number of 64 byte instruction cache line fulfilled from system memory or another cache." - }, - { - "EventName": "bp_l1_tlb_miss_l2_hit", - "EventCode": "0x84", - "BriefDescription": "The number of instruction fetches that miss in the L1 ITLB but hit in the L2 ITLB." - }, - { - "EventName": "bp_l1_tlb_miss_l2_miss", - "EventCode": "0x85", - "BriefDescription": "The number of instruction fetches that miss in both the L1 and L2 TLBs." - }, - { - "EventName": "bp_snp_re_sync", - "EventCode": "0x86", - "BriefDescription": "The number of pipeline restarts caused by invalidating probes that hit on the instruction stream currently being executed. This would happen if the active instruction stream was being modified by another processor in an MP system - typically a highly unlikely event." - }, - { - "EventName": "ic_fetch_stall.ic_stall_any", - "EventCode": "0x87", - "BriefDescription": "IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", - "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", - "UMask": "0x4" - }, - { - "EventName": "ic_fetch_stall.ic_stall_dq_empty", - "EventCode": "0x87", - "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", - "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", - "UMask": "0x2" - }, - { - "EventName": "ic_fetch_stall.ic_stall_back_pressure", - "EventCode": "0x87", - "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", - "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", - "UMask": "0x1" - }, - { - "EventName": "bp_l1_btb_correct", - "EventCode": "0x8a", - "BriefDescription": "L1 BTB Correction." - }, - { - "EventName": "bp_l2_btb_correct", - "EventCode": "0x8b", - "BriefDescription": "L2 BTB Correction." - }, - { - "EventName": "ic_cache_inval.l2_invalidating_probe", - "EventCode": "0x8c", - "BriefDescription": "IC line invalidated due to L2 invalidating probe (external or LS).", - "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to L2 invalidating probe (external or LS).", - "UMask": "0x2" - }, - { - "EventName": "ic_cache_inval.fill_invalidated", - "EventCode": "0x8c", - "BriefDescription": "IC line invalidated due to overwriting fill response.", - "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to overwriting fill response.", - "UMask": "0x1" - }, - { - "EventName": "bp_tlb_rel", - "EventCode": "0x99", - "BriefDescription": "The number of ITLB reload requests." - }, - { - "EventName": "ic_oc_mode_switch.oc_ic_mode_switch", - "EventCode": "0x28a", - "BriefDescription": "OC to IC mode switch.", - "PublicDescription": "OC Mode Switch. OC to IC mode switch.", - "UMask": "0x2" - }, - { - "EventName": "ic_oc_mode_switch.ic_oc_mode_switch", - "EventCode": "0x28a", - "BriefDescription": "IC to OC mode switch.", - "PublicDescription": "OC Mode Switch. IC to OC mode switch.", - "UMask": "0x1" - }, - { - "EventName": "l2_request_g1.rd_blk_l", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x80" - }, - { - "EventName": "l2_request_g1.rd_blk_x", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x40" - }, - { - "EventName": "l2_request_g1.ls_rd_blk_c_s", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x20" - }, - { - "EventName": "l2_request_g1.cacheable_ic_read", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x10" - }, - { - "EventName": "l2_request_g1.change_to_x", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x8" - }, - { - "EventName": "l2_request_g1.prefetch_l2", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x4" - }, - { - "EventName": "l2_request_g1.l2_hw_pf", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x2" - }, - { - "EventName": "l2_request_g1.other_requests", - "EventCode": "0x60", - "BriefDescription": "Events covered by l2_request_g2.", - "PublicDescription": "Requests to L2 Group1. Events covered by l2_request_g2.", - "UMask": "0x1" - }, - { - "EventName": "l2_request_g2.group1", - "EventCode": "0x61", - "BriefDescription": "All Group 1 commands not in unit0.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. All Group 1 commands not in unit0.", - "UMask": "0x80" - }, - { - "EventName": "l2_request_g2.ls_rd_sized", - "EventCode": "0x61", - "BriefDescription": "RdSized, RdSized32, RdSized64.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSized, RdSized32, RdSized64.", - "UMask": "0x40" - }, - { - "EventName": "l2_request_g2.ls_rd_sized_nc", - "EventCode": "0x61", - "BriefDescription": "RdSizedNC, RdSized32NC, RdSized64NC.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSizedNC, RdSized32NC, RdSized64NC.", - "UMask": "0x20" - }, - { - "EventName": "l2_request_g2.ic_rd_sized", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x10" - }, - { - "EventName": "l2_request_g2.ic_rd_sized_nc", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x8" - }, - { - "EventName": "l2_request_g2.smc_inval", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x4" - }, - { - "EventName": "l2_request_g2.bus_locks_originator", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x2" - }, - { - "EventName": "l2_request_g2.bus_locks_responses", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x1" - }, - { - "EventName": "l2_latency.l2_cycles_waiting_on_fills", - "EventCode": "0x62", - "BriefDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", - "PublicDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", - "UMask": "0x1" - }, - { - "EventName": "l2_wbc_req.wcb_write", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x40" - }, - { - "EventName": "l2_wbc_req.wcb_close", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x20" - }, - { - "EventName": "l2_wbc_req.cache_line_flush", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x10" - }, - { - "EventName": "l2_wbc_req.i_line_flush", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x8" - }, - { - "EventName": "l2_wbc_req.zero_byte_store", - "EventCode": "0x63", - "BriefDescription": "This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", - "PublicDescription": "LS to L2 WBC requests. This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", - "UMask": "0x4" - }, - { - "EventName": "l2_wbc_req.local_ic_clr", - "EventCode": "0x63", - "BriefDescription": "Local IC Clear.", - "PublicDescription": "LS to L2 WBC requests. Local IC Clear.", - "UMask": "0x2" - }, - { - "EventName": "l2_wbc_req.cl_zero", - "EventCode": "0x63", - "BriefDescription": "Cache Line Zero.", - "PublicDescription": "LS to L2 WBC requests. Cache Line Zero.", - "UMask": "0x1" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_cs", - "EventCode": "0x64", - "BriefDescription": "LS ReadBlock C/S Hit.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS ReadBlock C/S Hit.", - "UMask": "0x80" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_x", - "EventCode": "0x64", - "BriefDescription": "LS Read Block L Hit X.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block L Hit X.", - "UMask": "0x40" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_s", - "EventCode": "0x64", - "BriefDescription": "LsRdBlkL Hit Shared.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkL Hit Shared.", - "UMask": "0x20" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_x", - "EventCode": "0x64", - "BriefDescription": "LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", - "UMask": "0x10" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_c", - "EventCode": "0x64", - "BriefDescription": "LS Read Block C S L X Change to X Miss.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block C S L X Change to X Miss.", - "UMask": "0x8" - }, - { - "EventName": "l2_cache_req_stat.ic_fill_hit_x", - "EventCode": "0x64", - "BriefDescription": "IC Fill Hit Exclusive Stale.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Exclusive Stale.", - "UMask": "0x4" - }, - { - "EventName": "l2_cache_req_stat.ic_fill_hit_s", - "EventCode": "0x64", - "BriefDescription": "IC Fill Hit Shared.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Shared.", - "UMask": "0x2" - }, - { - "EventName": "l2_cache_req_stat.ic_fill_miss", - "EventCode": "0x64", - "BriefDescription": "IC Fill Miss.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Miss.", - "UMask": "0x1" - }, - { - "EventName": "l2_fill_pending.l2_fill_busy", - "EventCode": "0x6d", - "BriefDescription": "Total cycles spent with one or more fill requests in flight from L2.", - "PublicDescription": "Total cycles spent with one or more fill requests in flight from L2.", - "UMask": "0x1" - } -][ - { - "EventName": "ic_fw32", - "EventCode": "0x80", - "BriefDescription": "The number of 32B fetch windows transferred from IC pipe to DE instruction decoder (includes non-cacheable and cacheable fill responses)." - }, - { - "EventName": "ic_fw32_miss", - "EventCode": "0x81", - "BriefDescription": "The number of 32B fetch windows tried to read the L1 IC and missed in the full tag." - }, - { - "EventName": "ic_cache_fill_l2", - "EventCode": "0x82", - "BriefDescription": "The number of 64 byte instruction cache line was fulfilled from the L2 cache." - }, - { - "EventName": "ic_cache_fill_sys", - "EventCode": "0x83", - "BriefDescription": "The number of 64 byte instruction cache line fulfilled from system memory or another cache." - }, - { - "EventName": "bp_l1_tlb_miss_l2_hit", - "EventCode": "0x84", - "BriefDescription": "The number of instruction fetches that miss in the L1 ITLB but hit in the L2 ITLB." - }, - { - "EventName": "bp_l1_tlb_miss_l2_miss", - "EventCode": "0x85", - "BriefDescription": "The number of instruction fetches that miss in both the L1 and L2 TLBs." - }, - { - "EventName": "bp_snp_re_sync", - "EventCode": "0x86", - "BriefDescription": "The number of pipeline restarts caused by invalidating probes that hit on the instruction stream currently being executed. This would happen if the active instruction stream was being modified by another processor in an MP system - typically a highly unlikely event." - }, - { - "EventName": "ic_fetch_stall.ic_stall_any", - "EventCode": "0x87", - "BriefDescription": "IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", - "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", - "UMask": "0x4" - }, - { - "EventName": "ic_fetch_stall.ic_stall_dq_empty", - "EventCode": "0x87", - "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", - "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", - "UMask": "0x2" - }, - { - "EventName": "ic_fetch_stall.ic_stall_back_pressure", - "EventCode": "0x87", - "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", - "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", - "UMask": "0x1" - }, - { - "EventName": "bp_l1_btb_correct", - "EventCode": "0x8a", - "BriefDescription": "L1 BTB Correction." - }, - { - "EventName": "bp_l2_btb_correct", - "EventCode": "0x8b", - "BriefDescription": "L2 BTB Correction." - }, - { - "EventName": "ic_cache_inval.l2_invalidating_probe", - "EventCode": "0x8c", - "BriefDescription": "IC line invalidated due to L2 invalidating probe (external or LS).", - "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to L2 invalidating probe (external or LS).", - "UMask": "0x2" - }, - { - "EventName": "ic_cache_inval.fill_invalidated", - "EventCode": "0x8c", - "BriefDescription": "IC line invalidated due to overwriting fill response.", - "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to overwriting fill response.", - "UMask": "0x1" - }, - { - "EventName": "bp_tlb_rel", - "EventCode": "0x99", - "BriefDescription": "The number of ITLB reload requests." - }, - { - "EventName": "ic_oc_mode_switch.oc_ic_mode_switch", - "EventCode": "0x28a", - "BriefDescription": "OC to IC mode switch.", - "PublicDescription": "OC Mode Switch. OC to IC mode switch.", - "UMask": "0x2" - }, - { - "EventName": "ic_oc_mode_switch.ic_oc_mode_switch", - "EventCode": "0x28a", - "BriefDescription": "IC to OC mode switch.", - "PublicDescription": "OC Mode Switch. IC to OC mode switch.", - "UMask": "0x1" - }, - { - "EventName": "l2_request_g1.rd_blk_l", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x80" - }, - { - "EventName": "l2_request_g1.rd_blk_x", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x40" - }, - { - "EventName": "l2_request_g1.ls_rd_blk_c_s", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x20" - }, - { - "EventName": "l2_request_g1.cacheable_ic_read", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x10" - }, - { - "EventName": "l2_request_g1.change_to_x", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x8" - }, - { - "EventName": "l2_request_g1.prefetch_l2", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x4" - }, - { - "EventName": "l2_request_g1.l2_hw_pf", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x2" - }, - { - "EventName": "l2_request_g1.other_requests", - "EventCode": "0x60", - "BriefDescription": "Events covered by l2_request_g2.", - "PublicDescription": "Requests to L2 Group1. Events covered by l2_request_g2.", - "UMask": "0x1" - }, - { - "EventName": "l2_request_g2.group1", - "EventCode": "0x61", - "BriefDescription": "All Group 1 commands not in unit0.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. All Group 1 commands not in unit0.", - "UMask": "0x80" - }, - { - "EventName": "l2_request_g2.ls_rd_sized", - "EventCode": "0x61", - "BriefDescription": "RdSized, RdSized32, RdSized64.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSized, RdSized32, RdSized64.", - "UMask": "0x40" - }, - { - "EventName": "l2_request_g2.ls_rd_sized_nc", - "EventCode": "0x61", - "BriefDescription": "RdSizedNC, RdSized32NC, RdSized64NC.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSizedNC, RdSized32NC, RdSized64NC.", - "UMask": "0x20" - }, - { - "EventName": "l2_request_g2.ic_rd_sized", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x10" - }, - { - "EventName": "l2_request_g2.ic_rd_sized_nc", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x8" - }, - { - "EventName": "l2_request_g2.smc_inval", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x4" - }, - { - "EventName": "l2_request_g2.bus_locks_originator", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x2" - }, - { - "EventName": "l2_request_g2.bus_locks_responses", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x1" - }, - { - "EventName": "l2_latency.l2_cycles_waiting_on_fills", - "EventCode": "0x62", - "BriefDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", - "PublicDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", - "UMask": "0x1" - }, - { - "EventName": "l2_wbc_req.wcb_write", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x40" - }, - { - "EventName": "l2_wbc_req.wcb_close", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x20" - }, - { - "EventName": "l2_wbc_req.cache_line_flush", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x10" - }, - { - "EventName": "l2_wbc_req.i_line_flush", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x8" - }, - { - "EventName": "l2_wbc_req.zero_byte_store", - "EventCode": "0x63", - "BriefDescription": "This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", - "PublicDescription": "LS to L2 WBC requests. This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", - "UMask": "0x4" - }, - { - "EventName": "l2_wbc_req.local_ic_clr", - "EventCode": "0x63", - "BriefDescription": "Local IC Clear.", - "PublicDescription": "LS to L2 WBC requests. Local IC Clear.", - "UMask": "0x2" - }, - { - "EventName": "l2_wbc_req.cl_zero", - "EventCode": "0x63", - "BriefDescription": "Cache Line Zero.", - "PublicDescription": "LS to L2 WBC requests. Cache Line Zero.", - "UMask": "0x1" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_cs", - "EventCode": "0x64", - "BriefDescription": "LS ReadBlock C/S Hit.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS ReadBlock C/S Hit.", - "UMask": "0x80" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_x", - "EventCode": "0x64", - "BriefDescription": "LS Read Block L Hit X.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block L Hit X.", - "UMask": "0x40" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_s", - "EventCode": "0x64", - "BriefDescription": "LsRdBlkL Hit Shared.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkL Hit Shared.", - "UMask": "0x20" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_x", - "EventCode": "0x64", - "BriefDescription": "LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", - "UMask": "0x10" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_c", - "EventCode": "0x64", - "BriefDescription": "LS Read Block C S L X Change to X Miss.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block C S L X Change to X Miss.", - "UMask": "0x8" - }, - { - "EventName": "l2_cache_req_stat.ic_fill_hit_x", - "EventCode": "0x64", - "BriefDescription": "IC Fill Hit Exclusive Stale.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Exclusive Stale.", - "UMask": "0x4" - }, - { - "EventName": "l2_cache_req_stat.ic_fill_hit_s", - "EventCode": "0x64", - "BriefDescription": "IC Fill Hit Shared.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Shared.", - "UMask": "0x2" - }, - { - "EventName": "l2_cache_req_stat.ic_fill_miss", - "EventCode": "0x64", - "BriefDescription": "IC Fill Miss.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Miss.", - "UMask": "0x1" - }, - { - "EventName": "l2_fill_pending.l2_fill_busy", - "EventCode": "0x6d", - "BriefDescription": "Total cycles spent with one or more fill requests in flight from L2.", - "PublicDescription": "Total cycles spent with one or more fill requests in flight from L2.", - "UMask": "0x1" - } -][ - { - "EventName": "ic_fw32", - "EventCode": "0x80", - "BriefDescription": "The number of 32B fetch windows transferred from IC pipe to DE instruction decoder (includes non-cacheable and cacheable fill responses)." - }, - { - "EventName": "ic_fw32_miss", - "EventCode": "0x81", - "BriefDescription": "The number of 32B fetch windows tried to read the L1 IC and missed in the full tag." - }, - { - "EventName": "ic_cache_fill_l2", - "EventCode": "0x82", - "BriefDescription": "The number of 64 byte instruction cache line was fulfilled from the L2 cache." - }, - { - "EventName": "ic_cache_fill_sys", - "EventCode": "0x83", - "BriefDescription": "The number of 64 byte instruction cache line fulfilled from system memory or another cache." - }, - { - "EventName": "bp_l1_tlb_miss_l2_hit", - "EventCode": "0x84", - "BriefDescription": "The number of instruction fetches that miss in the L1 ITLB but hit in the L2 ITLB." - }, - { - "EventName": "bp_l1_tlb_miss_l2_miss", - "EventCode": "0x85", - "BriefDescription": "The number of instruction fetches that miss in both the L1 and L2 TLBs." - }, - { - "EventName": "bp_snp_re_sync", - "EventCode": "0x86", - "BriefDescription": "The number of pipeline restarts caused by invalidating probes that hit on the instruction stream currently being executed. This would happen if the active instruction stream was being modified by another processor in an MP system - typically a highly unlikely event." - }, - { - "EventName": "ic_fetch_stall.ic_stall_any", - "EventCode": "0x87", - "BriefDescription": "IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", - "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle for any reason (nothing valid in pipe ICM1).", - "UMask": "0x4" - }, - { - "EventName": "ic_fetch_stall.ic_stall_dq_empty", - "EventCode": "0x87", - "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", - "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to DQ empty.", - "UMask": "0x2" - }, - { - "EventName": "ic_fetch_stall.ic_stall_back_pressure", - "EventCode": "0x87", - "BriefDescription": "IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", - "PublicDescription": "Instruction Pipe Stall. IC pipe was stalled during this clock cycle (including IC to OC fetches) due to back-pressure.", - "UMask": "0x1" - }, - { - "EventName": "bp_l1_btb_correct", - "EventCode": "0x8a", - "BriefDescription": "L1 BTB Correction." - }, - { - "EventName": "bp_l2_btb_correct", - "EventCode": "0x8b", - "BriefDescription": "L2 BTB Correction." - }, - { - "EventName": "ic_cache_inval.l2_invalidating_probe", - "EventCode": "0x8c", - "BriefDescription": "IC line invalidated due to L2 invalidating probe (external or LS).", - "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to L2 invalidating probe (external or LS).", - "UMask": "0x2" - }, - { - "EventName": "ic_cache_inval.fill_invalidated", - "EventCode": "0x8c", - "BriefDescription": "IC line invalidated due to overwriting fill response.", - "PublicDescription": "The number of instruction cache lines invalidated. A non-SMC event is CMC (cross modifying code), either from the other thread of the core or another core. IC line invalidated due to overwriting fill response.", - "UMask": "0x1" - }, - { - "EventName": "bp_tlb_rel", - "EventCode": "0x99", - "BriefDescription": "The number of ITLB reload requests." - }, - { - "EventName": "ic_oc_mode_switch.oc_ic_mode_switch", - "EventCode": "0x28a", - "BriefDescription": "OC to IC mode switch.", - "PublicDescription": "OC Mode Switch. OC to IC mode switch.", - "UMask": "0x2" - }, - { - "EventName": "ic_oc_mode_switch.ic_oc_mode_switch", - "EventCode": "0x28a", - "BriefDescription": "IC to OC mode switch.", - "PublicDescription": "OC Mode Switch. IC to OC mode switch.", - "UMask": "0x1" - }, - { - "EventName": "l2_request_g1.rd_blk_l", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x80" - }, - { - "EventName": "l2_request_g1.rd_blk_x", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x40" - }, - { - "EventName": "l2_request_g1.ls_rd_blk_c_s", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x20" - }, - { - "EventName": "l2_request_g1.cacheable_ic_read", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x10" - }, - { - "EventName": "l2_request_g1.change_to_x", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x8" - }, - { - "EventName": "l2_request_g1.prefetch_l2", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x4" - }, - { - "EventName": "l2_request_g1.l2_hw_pf", - "EventCode": "0x60", - "BriefDescription": "Requests to L2 Group1.", - "PublicDescription": "Requests to L2 Group1.", - "UMask": "0x2" - }, - { - "EventName": "l2_request_g1.other_requests", - "EventCode": "0x60", - "BriefDescription": "Events covered by l2_request_g2.", - "PublicDescription": "Requests to L2 Group1. Events covered by l2_request_g2.", - "UMask": "0x1" - }, - { - "EventName": "l2_request_g2.group1", - "EventCode": "0x61", - "BriefDescription": "All Group 1 commands not in unit0.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. All Group 1 commands not in unit0.", - "UMask": "0x80" - }, - { - "EventName": "l2_request_g2.ls_rd_sized", - "EventCode": "0x61", - "BriefDescription": "RdSized, RdSized32, RdSized64.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSized, RdSized32, RdSized64.", - "UMask": "0x40" - }, - { - "EventName": "l2_request_g2.ls_rd_sized_nc", - "EventCode": "0x61", - "BriefDescription": "RdSizedNC, RdSized32NC, RdSized64NC.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous. RdSizedNC, RdSized32NC, RdSized64NC.", - "UMask": "0x20" - }, - { - "EventName": "l2_request_g2.ic_rd_sized", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x10" - }, - { - "EventName": "l2_request_g2.ic_rd_sized_nc", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x8" - }, - { - "EventName": "l2_request_g2.smc_inval", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x4" - }, - { - "EventName": "l2_request_g2.bus_locks_originator", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x2" - }, - { - "EventName": "l2_request_g2.bus_locks_responses", - "EventCode": "0x61", - "BriefDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "PublicDescription": "Multi-events in that LS and IF requests can be received simultaneous.", - "UMask": "0x1" - }, - { - "EventName": "l2_latency.l2_cycles_waiting_on_fills", - "EventCode": "0x62", - "BriefDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", - "PublicDescription": "Total cycles spent waiting for L2 fills to complete from L3 or memory, divided by four. This may be used to calculate average latency by multiplying this count by four and then dividing by the total number of L2 fills (unit mask l2_request_g1 == FEh). Event counts are for both threads. To calculate average latency, the number of fills from both threads must be used.", - "UMask": "0x1" - }, - { - "EventName": "l2_wbc_req.wcb_write", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x40" - }, - { - "EventName": "l2_wbc_req.wcb_close", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x20" - }, - { - "EventName": "l2_wbc_req.cache_line_flush", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x10" - }, - { - "EventName": "l2_wbc_req.i_line_flush", - "EventCode": "0x63", - "BriefDescription": "LS to L2 WBC requests.", - "PublicDescription": "LS to L2 WBC requests.", - "UMask": "0x8" - }, - { - "EventName": "l2_wbc_req.zero_byte_store", - "EventCode": "0x63", - "BriefDescription": "This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", - "PublicDescription": "LS to L2 WBC requests. This becomes WriteNoData at SDP; this count does not include DVM Sync Ops and bus locks which are counted in l2_request_g2.", - "UMask": "0x4" - }, - { - "EventName": "l2_wbc_req.local_ic_clr", - "EventCode": "0x63", - "BriefDescription": "Local IC Clear.", - "PublicDescription": "LS to L2 WBC requests. Local IC Clear.", - "UMask": "0x2" - }, - { - "EventName": "l2_wbc_req.cl_zero", - "EventCode": "0x63", - "BriefDescription": "Cache Line Zero.", - "PublicDescription": "LS to L2 WBC requests. Cache Line Zero.", - "UMask": "0x1" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_cs", - "EventCode": "0x64", - "BriefDescription": "LS ReadBlock C/S Hit.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS ReadBlock C/S Hit.", - "UMask": "0x80" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_x", - "EventCode": "0x64", - "BriefDescription": "LS Read Block L Hit X.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block L Hit X.", - "UMask": "0x40" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_l_hit_s", - "EventCode": "0x64", - "BriefDescription": "LsRdBlkL Hit Shared.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkL Hit Shared.", - "UMask": "0x20" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_x", - "EventCode": "0x64", - "BriefDescription": "LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LsRdBlkX/ChgToX Hit X. Count RdBlkX finding Shared as a Miss.", - "UMask": "0x10" - }, - { - "EventName": "l2_cache_req_stat.ls_rd_blk_c", - "EventCode": "0x64", - "BriefDescription": "LS Read Block C S L X Change to X Miss.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. LS Read Block C S L X Change to X Miss.", - "UMask": "0x8" - }, - { - "EventName": "l2_cache_req_stat.ic_fill_hit_x", - "EventCode": "0x64", - "BriefDescription": "IC Fill Hit Exclusive Stale.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Exclusive Stale.", - "UMask": "0x4" - }, - { - "EventName": "l2_cache_req_stat.ic_fill_hit_s", - "EventCode": "0x64", - "BriefDescription": "IC Fill Hit Shared.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Hit Shared.", - "UMask": "0x2" - }, - { - "EventName": "l2_cache_req_stat.ic_fill_miss", - "EventCode": "0x64", - "BriefDescription": "IC Fill Miss.", - "PublicDescription": "This event does not count accesses to the L2 cache by the L2 prefetcher, but it does count accesses by the L1 prefetcher. IC Fill Miss.", - "UMask": "0x1" - }, - { - "EventName": "l2_fill_pending.l2_fill_busy", - "EventCode": "0x6d", - "BriefDescription": "Total cycles spent with one or more fill requests in flight from L2.", - "PublicDescription": "Total cycles spent with one or more fill requests in flight from L2.", - "UMask": "0x1" - } -][ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 13 23:53: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 C136010584FA; Mon, 13 Aug 2018 23:53:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 648587273B; Mon, 13 Aug 2018 23:53:12 +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 400B913BA7; Mon, 13 Aug 2018 23:53:12 +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 w7DNrCjs070972; Mon, 13 Aug 2018 23:53:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DNrCs7070971; Mon, 13 Aug 2018 23:53:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201808132353.w7DNrCs7070971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 13 Aug 2018 23:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337731 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 337731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 23:53:12 -0000 Author: ian Date: Mon Aug 13 23:53:11 2018 New Revision: 337731 URL: https://svnweb.freebsd.org/changeset/base/337731 Log: Export the eeprom device size via readonly sysctl. Also export the write page size and address size, although they are likely to be inherently less-interesting values outside of the driver. Modified: head/sys/dev/iicbus/icee.c Modified: head/sys/dev/iicbus/icee.c ============================================================================== --- head/sys/dev/iicbus/icee.c Mon Aug 13 23:46:44 2018 (r337730) +++ head/sys/dev/iicbus/icee.c Mon Aug 13 23:53:11 2018 (r337731) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -186,6 +187,8 @@ static int icee_attach(device_t dev) { struct icee_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *tree; sc->dev = dev; sc->addr = iicbus_get_addr(dev); @@ -205,6 +208,16 @@ icee_attach(device_t dev) return (ENOMEM); } sc->cdev->si_drv1 = sc; + + ctx = device_get_sysctl_ctx(dev); + tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "address_size", CTLFLAG_RD, + &sc->type, 0, "Memory array address size in bits"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "device_size", CTLFLAG_RD, + &sc->size, 0, "Memory array capacity in bytes"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "write_size", CTLFLAG_RD, + &sc->wr_sz, 0, "Memory array page write size in bytes"); + return (0); } From owner-svn-src-all@freebsd.org Mon Aug 13 23:56:41 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 1F7D810585B2; Mon, 13 Aug 2018 23:56:41 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBA81728BE; Mon, 13 Aug 2018 23:56:40 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.133.74] (unknown [12.202.168.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 212392647E; Mon, 13 Aug 2018 23:56:40 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.f.0.180709 Date: Mon, 13 Aug 2018 16:56:31 -0700 Subject: Re: svn commit: r337730 - in head/lib/libpmc/pmu-events/arch/x86: . amdfam17h From: Ravi Pokala To: Matt Macy , , , Message-ID: <0E7037D3-7E59-44C5-98E5-FC183E3D181E@panasas.com> Thread-Topic: svn commit: r337730 - in head/lib/libpmc/pmu-events/arch/x86: . amdfam17h References: <201808132346.w7DNkjwY066070@repo.freebsd.org> In-Reply-To: <201808132346.w7DNkjwY066070@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 13 Aug 2018 23:56:41 -0000 Hi Matt, =EF=BB=BF-----Original Message----- From: on behalf of Matt Macy Date: 2018-08-13, Monday at 16:46 To: , , Subject: svn commit: r337730 - in head/lib/libpmc/pmu-events/arch/x86: . am= dfam17h > Author: mmacy > Date: Mon Aug 13 23:46:44 2018 > New Revision: 337730 > URL: https://svnweb.freebsd.org/changeset/base/337730 >=20 > Log: > pmc amd17h: fix inputs to jevents >=20 > Modified: > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/cache.json > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/floating-point.json > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/other.json > head/lib/libpmc/pmu-events/arch/x86/mapfile.csv What was the nature of the problem, and how was it fixed? Thanks, Ravi (rpokala@) From owner-svn-src-all@freebsd.org Tue Aug 14 00:14: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 C1F441058F7F; Tue, 14 Aug 2018 00:14:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6864A73759; Tue, 14 Aug 2018 00:14:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4520F13F32; Tue, 14 Aug 2018 00:14:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7E0EI7p081087; Tue, 14 Aug 2018 00:14:18 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7E0EHkH081085; Tue, 14 Aug 2018 00:14:17 GMT (envelope-from des@FreeBSD.org) Message-Id: <201808140014.w7E0EHkH081085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 14 Aug 2018 00:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337732 - head/lib/libpam/modules/pam_exec X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/lib/libpam/modules/pam_exec X-SVN-Commit-Revision: 337732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 00:14:19 -0000 Author: des Date: Tue Aug 14 00:14:17 2018 New Revision: 337732 URL: https://svnweb.freebsd.org/changeset/base/337732 Log: Add support for Linux-PAM's badly named expose_authtok option. Submitted by: Thomas Munro MFC after: 1 week Differential Revision: D16171 Modified: head/lib/libpam/modules/pam_exec/pam_exec.8 head/lib/libpam/modules/pam_exec/pam_exec.c Modified: head/lib/libpam/modules/pam_exec/pam_exec.8 ============================================================================== --- head/lib/libpam/modules/pam_exec/pam_exec.8 Mon Aug 13 23:53:11 2018 (r337731) +++ head/lib/libpam/modules/pam_exec/pam_exec.8 Tue Aug 14 00:14:17 2018 (r337732) @@ -1,5 +1,6 @@ .\" Copyright (c) 2001,2003 Networks Associates Technology, Inc. .\" Copyright (c) 2017 Dag-Erling Smørgrav +.\" Copyright (c) 2018 Thomas Munro .\" All rights reserved. .\" .\" Portions of this software were developed for the FreeBSD Project by @@ -33,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2017 +.Dd August 14, 2018 .Dt PAM_EXEC 8 .Os .Sh NAME @@ -72,6 +73,8 @@ Ignored for compatibility reasons. .It Cm return_prog_exit_status Use the program exit status as the return code of the pam_sm_* function. It must be a valid return value for this function. +.It Cm expose_authtok +Write the authentication token to the program's standard input stream. .It Cm -- Stop options parsing; program and its arguments follow. Modified: head/lib/libpam/modules/pam_exec/pam_exec.c ============================================================================== --- head/lib/libpam/modules/pam_exec/pam_exec.c Mon Aug 13 23:53:11 2018 (r337731) +++ head/lib/libpam/modules/pam_exec/pam_exec.c Tue Aug 14 00:14:17 2018 (r337732) @@ -3,6 +3,7 @@ * * Copyright (c) 2001,2003 Networks Associates Technology, Inc. * Copyright (c) 2017 Dag-Erling Smørgrav + * Copyright (c) 2018 Thomas Munro * All rights reserved. * * This software was developed for the FreeBSD Project by ThinkSec AS and @@ -108,6 +109,7 @@ struct pe_opts { int return_prog_exit_status; int capture_stdout; int capture_stderr; + int expose_authtok; }; static int @@ -135,6 +137,8 @@ parse_options(const char *func, int *argc, const char options->capture_stderr = 1; } else if (strcmp((*argv)[i], "return_prog_exit_status") == 0) { options->return_prog_exit_status = 1; + } else if (strcmp((*argv)[i], "expose_authtok") == 0) { + options->expose_authtok = 1; } else { if (strcmp((*argv)[i], "--") == 0) { (*argc)--; @@ -158,19 +162,22 @@ _pam_exec(pam_handle_t *pamh, struct pe_opts *options) { char buf[PAM_MAX_MSG_SIZE]; - struct pollfd pfd[3]; + struct pollfd pfd[4]; const void *item; char **envlist, *envstr, *resp, **tmp; - ssize_t rlen; + ssize_t rlen, wlen; int envlen, extralen, i; int pam_err, serrno, status; - int chout[2], cherr[2], pd; - nfds_t nfds; + int chin[2], chout[2], cherr[2], pd; + nfds_t nfds, nreadfds; pid_t pid; + const char *authtok; + size_t authtok_size; + int rc; pd = -1; pid = 0; - chout[0] = chout[1] = cherr[0] = cherr[1] = -1; + chin[0] = chin[1] = chout[0] = chout[1] = cherr[0] = cherr[1] = -1; envlist = NULL; #define OUT(ret) do { pam_err = (ret); goto out; } while (0) @@ -235,6 +242,25 @@ _pam_exec(pam_handle_t *pamh, openpam_log(PAM_LOG_DEBUG, "envlen = %d extralen = %d envlist = %p", envlen, extralen, envlist); + /* set up pipe and get authtok if requested */ + if (options->expose_authtok) { + if (pipe(chin) != 0) { + openpam_log(PAM_LOG_ERROR, "%s: pipe(): %m", func); + OUT(PAM_SYSTEM_ERR); + } + if (fcntl(chin[1], F_SETFL, O_NONBLOCK)) { + openpam_log(PAM_LOG_ERROR, "%s: fcntl(): %m", func); + OUT(PAM_SYSTEM_ERR); + } + rc = pam_get_authtok(pamh, PAM_AUTHTOK, &authtok, NULL); + if (rc == PAM_SUCCESS) { + authtok_size = strlen(authtok); + } else { + openpam_log(PAM_LOG_ERROR, "%s: pam_get_authtok(): %s", func, + pam_strerror(pamh, rc)); + OUT(PAM_SYSTEM_ERR); + } + } /* set up pipes if capture was requested */ if (options->capture_stdout) { if (pipe(chout) != 0) { @@ -269,9 +295,13 @@ _pam_exec(pam_handle_t *pamh, if ((pid = pdfork(&pd, 0)) == 0) { /* child */ - if ((chout[0] >= 0 && close(chout[0]) != 0) || + if ((chin[1] >= 0 && close(chin[1]) != 0) || + (chout[0] >= 0 && close(chout[0]) != 0) || (cherr[0] >= 0 && close(cherr[0]) != 0)) { openpam_log(PAM_LOG_ERROR, "%s: close(): %m", func); + } else if (chin[0] >= 0 && + dup2(chin[0], STDIN_FILENO) != STDIN_FILENO) { + openpam_log(PAM_LOG_ERROR, "%s: dup2(): %m", func); } else if (dup2(chout[1], STDOUT_FILENO) != STDOUT_FILENO || dup2(cherr[1], STDERR_FILENO) != STDERR_FILENO) { openpam_log(PAM_LOG_ERROR, "%s: dup2(): %m", func); @@ -288,7 +318,9 @@ _pam_exec(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s: pdfork(): %m", func); OUT(PAM_SYSTEM_ERR); } - /* use poll() to watch the process and stdout / stderr */ + /* use poll() to watch the process and stdin / stdout / stderr */ + if (chin[0] >= 0) + close(chin[0]); if (chout[1] >= 0) close(chout[1]); if (cherr[1] >= 0) @@ -297,16 +329,24 @@ _pam_exec(pam_handle_t *pamh, pfd[0].fd = pd; pfd[0].events = POLLHUP; nfds = 1; + nreadfds = 0; if (options->capture_stdout) { pfd[nfds].fd = chout[0]; pfd[nfds].events = POLLIN|POLLERR|POLLHUP; nfds++; + nreadfds++; } if (options->capture_stderr) { pfd[nfds].fd = cherr[0]; pfd[nfds].events = POLLIN|POLLERR|POLLHUP; nfds++; + nreadfds++; } + if (options->expose_authtok) { + pfd[nfds].fd = chin[1]; + pfd[nfds].events = POLLOUT|POLLERR|POLLHUP; + nfds++; + } /* loop until the process exits */ do { @@ -314,7 +354,8 @@ _pam_exec(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s: poll(): %m", func); OUT(PAM_SYSTEM_ERR); } - for (i = 1; i < nfds; ++i) { + /* are the stderr / stdout pipes ready for reading? */ + for (i = 1; i < 1 + nreadfds; ++i) { if ((pfd[i].revents & POLLIN) == 0) continue; if ((rlen = read(pfd[i].fd, buf, sizeof(buf) - 1)) < 0) { @@ -328,6 +369,26 @@ _pam_exec(pam_handle_t *pamh, (void)pam_prompt(pamh, pfd[i].fd == chout[0] ? PAM_TEXT_INFO : PAM_ERROR_MSG, &resp, "%s", buf); } + /* is the stdin pipe ready for writing? */ + if (options->expose_authtok && authtok_size > 0 && + (pfd[nfds - 1].revents & POLLOUT) != 0) { + if ((wlen = write(chin[1], authtok, authtok_size)) < 0) { + if (errno == EAGAIN) + continue; + openpam_log(PAM_LOG_ERROR, "%s: write(): %m", + func); + OUT(PAM_SYSTEM_ERR); + } else { + authtok += wlen; + authtok_size -= wlen; + if (authtok_size == 0) { + /* finished writing; close and forget the pipe */ + close(chin[1]); + chin[1] = -1; + nfds--; + } + } + } } while (pfd[0].revents == 0); /* the child process has exited */ @@ -364,6 +425,10 @@ out: serrno = errno; if (pd >= 0) close(pd); + if (chin[0] >= 0) + close(chin[0]); + if (chin[1] >= 0) + close(chin[1]); if (chout[0] >= 0) close(chout[0]); if (chout[1] >= 0) From owner-svn-src-all@freebsd.org Tue Aug 14 01:45: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 725291060BD4; Tue, 14 Aug 2018 01:45:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28501774AC; Tue, 14 Aug 2018 01:45:23 +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 0ACD214EC6; Tue, 14 Aug 2018 01:45:23 +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 w7E1jMmH028270; Tue, 14 Aug 2018 01:45:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7E1jMDB028269; Tue, 14 Aug 2018 01:45:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808140145.w7E1jMDB028269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 14 Aug 2018 01:45:22 +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: r337733 - stable/11/bin/cat X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/bin/cat X-SVN-Commit-Revision: 337733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 01:45:23 -0000 Author: kevans Date: Tue Aug 14 01:45:22 2018 New Revision: 337733 URL: https://svnweb.freebsd.org/changeset/base/337733 Log: MFC r322325: cat: fix build with -DNO_UDOM_SUPPORT PR: 230489 Modified: stable/11/bin/cat/cat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/cat/cat.c ============================================================================== --- stable/11/bin/cat/cat.c Tue Aug 14 00:14:17 2018 (r337732) +++ stable/11/bin/cat/cat.c Tue Aug 14 01:45:22 2018 (r337733) @@ -51,12 +51,12 @@ __FBSDID("$FreeBSD$"); #ifndef NO_UDOM_SUPPORT #include #include -#include #include #endif #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Tue Aug 14 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 11EF510617C0; Tue, 14 Aug 2018 01:57:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B97FF77D27; Tue, 14 Aug 2018 01:57:11 +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 9AB90150A1; Tue, 14 Aug 2018 01:57:11 +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 w7E1vB72033476; Tue, 14 Aug 2018 01:57:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7E1vBMp033475; Tue, 14 Aug 2018 01:57:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808140157.w7E1vBMp033475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 14 Aug 2018 01:57: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: r337734 - stable/10/bin/cat X-SVN-Group: stable-10 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/10/bin/cat X-SVN-Commit-Revision: 337734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 01:57:12 -0000 Author: kevans Date: Tue Aug 14 01:57:11 2018 New Revision: 337734 URL: https://svnweb.freebsd.org/changeset/base/337734 Log: MFC r322325: cat: fix build with -DNO_UDOM_SUPPORT PR: 230489 Modified: stable/10/bin/cat/cat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/cat/cat.c ============================================================================== --- stable/10/bin/cat/cat.c Tue Aug 14 01:45:22 2018 (r337733) +++ stable/10/bin/cat/cat.c Tue Aug 14 01:57:11 2018 (r337734) @@ -51,11 +51,11 @@ __FBSDID("$FreeBSD$"); #ifndef NO_UDOM_SUPPORT #include #include -#include #endif #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Tue Aug 14 01:58: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 0BC741061BB0; Tue, 14 Aug 2018 01:58:34 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (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 8126C77FC1; Tue, 14 Aug 2018 01:58:33 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pg1-x52c.google.com with SMTP id r1-v6so8364706pgp.11; Mon, 13 Aug 2018 18:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:openpgp:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=O+vWZwfbftMCMFkN7HQ0etTg1x3CaIG9PNe1bP1eU90=; b=R3M/0fNURg+wCga5OcQgWoWng8260d+onbAJJ8ekmYegjJFUTnR+1CImhUs+DnyL/N jmIzIlVDCT6oxy/RrFlValvN5s/HENZ66AYSjRvChRtjWXm3ICKKl7NZz3goshSgfF0g 7sygSdPAdsqSLDYsbKUwkI3twTEYjdxnl4yctRjG/UWdGsgQIOUnHm3JaDuC+0fn+WMX Xu6PJxKaIfzHNmxrcE1MY3wZ/6mvj5VzSGZHWov8L3NaRsxLDawmtu03w8Fo47m6fP6P ZezgaAfyI1LSbxFjyECO0Lu5jD0ll59qZkd/0ErZ4a06MMLtWO7Tp68T9MUt+hRoL0l1 /vyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :openpgp:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=O+vWZwfbftMCMFkN7HQ0etTg1x3CaIG9PNe1bP1eU90=; b=bLtUPem9siRP+irr/UW4WNZOGE05QVZyriUumnq36mY7N08Lxg/KQUPUvcLQ17NmjC kCvvGg1B3LUrAKNFYVTKwapKxKP+1R5hetj8rEbOTLEV6CU0XUVilbAAsjgzTr/yO0R4 aD9ZJPvdseeMWp0fCpyQHgubLhGPpI4r5mfreG+hyX8lZqC57ltrz2s7dG7tt0q3enxo nMXwh/iB081BKlkVeRblKnWWJ9qSW7vdwzPjS7KL6r/AfQePJ0LWUFkTU01K9v4puh3H yi8UB+xvKnAZ2vOtDMxT/QLus4wargr2D1noc3EdC28iYt9r4jqYbqYc3FZGpRSRjXPm PMmg== X-Gm-Message-State: AOUpUlERBmwXpz+5jpNra6ka6ZqlY7wJZ5Qe3EE+ZJR0HBmdlF9ddn9i J9OgEmon7DOWuUe6tcRT3OegujL5 X-Google-Smtp-Source: AA+uWPx8CIx/Usqxqu4pwrR0kmEnaDKhGerByDw2mCZiD4udec1FZu1vap2qArMgW9AyPRJ6smcPEg== X-Received: by 2002:a63:291:: with SMTP id 139-v6mr19021756pgc.365.1534211912468; Mon, 13 Aug 2018 18:58:32 -0700 (PDT) Received: from [192.168.1.107] ([103.107.240.136]) by smtp.gmail.com with ESMTPSA id s14-v6sm49795884pfj.105.2018.08.13.18.58.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 18:58:32 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r337709 - head/sys/net To: Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808131413.w7DEDQFr049135@repo.freebsd.org> From: Kubilay Kocak Openpgp: preference=signencrypt Message-ID: Date: Tue, 14 Aug 2018 11:58:28 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201808131413.w7DEDQFr049135@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 01:58:34 -0000 On 14/08/2018 12:13 am, Andrew Gallatin wrote: > Author: gallatin > Date: Mon Aug 13 14:13:25 2018 > New Revision: 337709 > URL: https://svnweb.freebsd.org/changeset/base/337709 > > Log: > lagg: allow lacp to manage the link state > > Lacp needs to manage the link state itself. Unlike other > lagg protocols, the ability of lacp to pass traffic > depends not only on the lagg members having link, but also > on the lacp protocol converging to a distributing state with the > link partner. > > If we prematurely mark the link as up, then we will send a > gratuitous arp (via arp_handle_ifllchange()) before the lacp > interface is capable of passing traffic. When this happens, > the gratuitous arp is lost, and our link partner may cache > a stale mac address (eg, when the base mac address for the > lagg bundle changes, due to a BIOS change re-ordering NIC > unit numbers) Hi Andrew Can this be MFC'd? > Reviewed by: jtl, hselasky > Sponsored by: Netflix > > Modified: > head/sys/net/ieee8023ad_lacp.c > head/sys/net/if_lagg.c > > Modified: head/sys/net/ieee8023ad_lacp.c > ============================================================================== > --- head/sys/net/ieee8023ad_lacp.c Mon Aug 13 13:58:45 2018 (r337708) > +++ head/sys/net/ieee8023ad_lacp.c Mon Aug 13 14:13:25 2018 (r337709) > @@ -711,6 +711,8 @@ lacp_disable_distributing(struct lacp_port *lp) > } > > lp->lp_state &= ~LACP_STATE_DISTRIBUTING; > + if_link_state_change(sc->sc_ifp, > + sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN); > } > > static void > @@ -745,6 +747,9 @@ lacp_enable_distributing(struct lacp_port *lp) > } else > /* try to become the active aggregator */ > lacp_select_active_aggregator(lsc); > + > + if_link_state_change(sc->sc_ifp, > + sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN); > } > > static void > > Modified: head/sys/net/if_lagg.c > ============================================================================== > --- head/sys/net/if_lagg.c Mon Aug 13 13:58:45 2018 (r337708) > +++ head/sys/net/if_lagg.c Mon Aug 13 14:13:25 2018 (r337709) > @@ -1737,6 +1737,10 @@ lagg_linkstate(struct lagg_softc *sc) > > LAGG_XLOCK_ASSERT(sc); > > + /* LACP handles link state itself */ > + if (sc->sc_proto == LAGG_PROTO_LACP) > + return; > + > /* Our link is considered up if at least one of our ports is active */ > LAGG_RLOCK(); > CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Tue Aug 14 02:30:16 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 691891065C91; Tue, 14 Aug 2018 02:30:16 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1932B798AC; Tue, 14 Aug 2018 02:30:16 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id D3C37273AE; Tue, 14 Aug 2018 02:30:15 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f180.google.com with SMTP id x5-v6so201358iop.13; Mon, 13 Aug 2018 19:30:15 -0700 (PDT) X-Gm-Message-State: AOUpUlFQqoRTwKKhZeV2IVNhkkNHnVzj/MFkAe3NSVVaELgXnGeSvFVV Z5KVnQTMZBzQcrAKXiZjLCUBCbn0cMPFszBFhlo= X-Google-Smtp-Source: AA+uWPxxdeCUc5HexDF2niFwMsS7Ww6Lgq+YMRLP47rl2MmYBzEDaZVNkAS5ioQjknjDAGBkL4ySrgABkfwDWaHNS0M= X-Received: by 2002:a6b:5a08:: with SMTP id o8-v6mr16966191iob.5.1534213815228; Mon, 13 Aug 2018 19:30:15 -0700 (PDT) MIME-Version: 1.0 References: <201808132346.w7DNkjwY066070@repo.freebsd.org> <0E7037D3-7E59-44C5-98E5-FC183E3D181E@panasas.com> In-Reply-To: <0E7037D3-7E59-44C5-98E5-FC183E3D181E@panasas.com> From: Matthew Macy Date: Mon, 13 Aug 2018 19:30:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337730 - in head/lib/libpmc/pmu-events/arch/x86: . amdfam17h To: Ravi Pokala Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 02:30:16 -0000 The entries in the .json files were replicated and mapfile.csv lacked a newline at the end of the file causing parse failures. -M On Mon, Aug 13, 2018 at 4:56 PM Ravi Pokala wrote: > Hi Matt, > > =EF=BB=BF-----Original Message----- > From: on behalf of Matt Macy > > Date: 2018-08-13, Monday at 16:46 > To: , , < > svn-src-head@freebsd.org> > Subject: svn commit: r337730 - in head/lib/libpmc/pmu-events/arch/x86: . > amdfam17h > > > Author: mmacy > > Date: Mon Aug 13 23:46:44 2018 > > New Revision: 337730 > > URL: https://svnweb.freebsd.org/changeset/base/337730 > > > > Log: > > pmc amd17h: fix inputs to jevents > > > > Modified: > > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/cache.json > > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json > > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/floating-point.json > > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json > > head/lib/libpmc/pmu-events/arch/x86/amdfam17h/other.json > > head/lib/libpmc/pmu-events/arch/x86/mapfile.csv > > What was the nature of the problem, and how was it fixed? > > Thanks, > > Ravi (rpokala@) > > > From owner-svn-src-all@freebsd.org Tue Aug 14 05:18:45 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 3AAF9106C4FE; Tue, 14 Aug 2018 05:18:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0F347F35C; Tue, 14 Aug 2018 05:18:44 +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 AD2CF17320; Tue, 14 Aug 2018 05:18:44 +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 w7E5Iisx035999; Tue, 14 Aug 2018 05:18:44 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7E5Ihp2035995; Tue, 14 Aug 2018 05:18:43 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808140518.w7E5Ihp2035995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 14 Aug 2018 05:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337735 - in head: lib/libpmc lib/libpmc/pmu-events/arch/x86 lib/libpmc/pmu-events/arch/x86/amdfam17h sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: lib/libpmc lib/libpmc/pmu-events/arch/x86 lib/libpmc/pmu-events/arch/x86/amdfam17h sys/dev/hwpmc X-SVN-Commit-Revision: 337735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 05:18:45 -0000 Author: mmacy Date: Tue Aug 14 05:18:43 2018 New Revision: 337735 URL: https://svnweb.freebsd.org/changeset/base/337735 Log: Add library and kernel support for AMD Family 17h counters NB: lacks default sample rate for most counters Modified: head/lib/libpmc/libpmc_pmu_util.c head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json head/lib/libpmc/pmu-events/arch/x86/mapfile.csv head/sys/dev/hwpmc/hwpmc_amd.c Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Tue Aug 14 01:57:11 2018 (r337734) +++ head/lib/libpmc/libpmc_pmu_util.c Tue Aug 14 05:18:43 2018 (r337735) @@ -46,7 +46,14 @@ struct pmu_alias { const char *pa_alias; const char *pa_name; }; -static struct pmu_alias pmu_alias_table[] = { + +typedef enum { + PMU_INVALID, + PMU_INTEL, + PMU_AMD, +} pmu_mfr_t; + +static struct pmu_alias pmu_intel_alias_table[] = { {"UNHALTED_CORE_CYCLES", "CPU_CLK_UNHALTED.THREAD_P_ANY"}, {"UNHALTED-CORE-CYCLES", "CPU_CLK_UNHALTED.THREAD_P_ANY"}, {"LLC_MISSES", "LONGEST_LAT_CACHE.MISS"}, @@ -70,6 +77,40 @@ static struct pmu_alias pmu_alias_table[] = { {NULL, NULL}, }; +static struct pmu_alias pmu_amd_alias_table[] = { + {"UNHALTED_CORE_CYCLES", "ls_not_halted_cyc"}, + {"UNHALTED-CORE-CYCLES", "ls_not_halted_cyc"}, + {NULL, NULL}, +}; + + +static pmu_mfr_t +pmu_events_mfr(void) +{ + char *buf; + size_t s; + pmu_mfr_t mfr; + + if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, &s, + (void *)NULL, 0) == -1) + return (PMU_INVALID); + if ((buf = malloc(s + 1)) == NULL) + return (PMU_INVALID); + if (sysctlbyname("kern.hwpmc.cpuid", buf, &s, + (void *)NULL, 0) == -1) { + free(buf); + return (PMU_INVALID); + } + if (strcasestr(buf, "AuthenticAMD") != NULL) + mfr = PMU_AMD; + else if (strcasestr(buf, "GenuineIntel") != NULL) + mfr = PMU_INTEL; + else + mfr = PMU_INVALID; + free(buf); + return (mfr); +} + /* * The Intel fixed mode counters are: * "inst_retired.any", @@ -82,11 +123,23 @@ static struct pmu_alias pmu_alias_table[] = { static const char * pmu_alias_get(const char *name) { + pmu_mfr_t mfr; struct pmu_alias *pa; + struct pmu_alias *pmu_alias_table; + if ((mfr = pmu_events_mfr()) == PMU_INVALID) + return (name); + if (mfr == PMU_AMD) + pmu_alias_table = pmu_amd_alias_table; + else if (mfr == PMU_INTEL) + pmu_alias_table = pmu_intel_alias_table; + else + return (name); + for (pa = pmu_alias_table; pa->pa_alias != NULL; pa++) if (strcasecmp(name, pa->pa_alias) == 0) return (pa->pa_name); + return (name); } @@ -352,57 +405,112 @@ pmc_pmu_print_counter_full(const char *ev) } } -int -pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm) +static int +pmc_pmu_amd_pmcallocate(const char *event_name __unused, struct pmc_op_pmcallocate *pm, + struct pmu_event_desc *ped) { - const struct pmu_event *pe; - struct pmu_event_desc ped; - struct pmc_md_iap_op_pmcallocate *iap; - int idx, isfixed; + struct pmc_md_amd_op_pmcallocate *amd; - iap = &pm->pm_md.pm_iap; - isfixed = 0; - bzero(iap, sizeof(*iap)); - event_name = pmu_alias_get(event_name); - pm->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); - if ((pe = pmu_event_get(NULL, event_name, &idx)) == NULL) - return (ENOENT); - if (pe->alias && (pe = pmu_event_get(NULL, pe->alias, &idx)) == NULL) - return (ENOENT); - if (pe->event == NULL) - return (ENOENT); - if (pmu_parse_event(&ped, pe->event)) - return (ENOENT); + amd = &pm->pm_md.pm_amd; + amd->pm_amd_config = AMD_PMC_TO_EVENTMASK(ped->ped_event); + if (ped->ped_umask > 0) { + pm->pm_caps |= PMC_CAP_QUALIFIER; + amd->pm_amd_config |= AMD_PMC_TO_UNITMASK(ped->ped_umask); + } + pm->pm_class = PMC_CLASS_K8; + if ((pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == 0 || + (pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == + (PMC_CAP_USER|PMC_CAP_SYSTEM)) + amd->pm_amd_config |= (AMD_PMC_USR | AMD_PMC_OS); + else if (pm->pm_caps & PMC_CAP_USER) + amd->pm_amd_config |= AMD_PMC_USR; + else if (pm->pm_caps & PMC_CAP_SYSTEM) + amd->pm_amd_config |= AMD_PMC_OS; + if (ped->ped_edge) + amd->pm_amd_config |= AMD_PMC_EDGE; + if (ped->ped_inv) + amd->pm_amd_config |= AMD_PMC_EDGE; + if (pm->pm_caps & PMC_CAP_INTERRUPT) + amd->pm_amd_config |= AMD_PMC_INT; + return (0); +} +static int +pmc_pmu_intel_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm, + struct pmu_event_desc *ped) +{ + struct pmc_md_iap_op_pmcallocate *iap; + int isfixed; + + isfixed = 0; + iap = &pm->pm_md.pm_iap; if (strcasestr(event_name, "UNC_") == event_name || strcasestr(event_name, "uncore") != NULL) { pm->pm_class = PMC_CLASS_UCP; pm->pm_caps |= PMC_CAP_QUALIFIER; - } else if ((ped.ped_umask == -1) || - (ped.ped_event == 0x0 && ped.ped_umask == 0x3)) { + } else if ((ped->ped_umask == -1) || + (ped->ped_event == 0x0 && ped->ped_umask == 0x3)) { pm->pm_class = PMC_CLASS_IAF; } else { pm->pm_class = PMC_CLASS_IAP; pm->pm_caps |= PMC_CAP_QUALIFIER; } - pm->pm_ev = idx; - iap->pm_iap_config |= IAP_EVSEL(ped.ped_event); - if (ped.ped_umask > 0) - iap->pm_iap_config |= IAP_UMASK(ped.ped_umask); - iap->pm_iap_config |= IAP_CMASK(ped.ped_cmask); - iap->pm_iap_rsp = ped.ped_offcore_rsp; + iap->pm_iap_config |= IAP_EVSEL(ped->ped_event); + if (ped->ped_umask > 0) + iap->pm_iap_config |= IAP_UMASK(ped->ped_umask); + iap->pm_iap_config |= IAP_CMASK(ped->ped_cmask); + iap->pm_iap_rsp = ped->ped_offcore_rsp; - iap->pm_iap_config |= (IAP_USR | IAP_OS); - if (ped.ped_edge) + if ((pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == 0 || + (pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == + (PMC_CAP_USER|PMC_CAP_SYSTEM)) + iap->pm_iap_config |= (IAP_USR | IAP_OS); + else if (pm->pm_caps & PMC_CAP_USER) + iap->pm_iap_config |= IAP_USR; + else if (pm->pm_caps & PMC_CAP_SYSTEM) + iap->pm_iap_config |= IAP_OS; + if (ped->ped_edge) iap->pm_iap_config |= IAP_EDGE; - if (ped.ped_any) + if (ped->ped_any) iap->pm_iap_config |= IAP_ANY; - if (ped.ped_inv) + if (ped->ped_inv) iap->pm_iap_config |= IAP_EDGE; if (pm->pm_caps & PMC_CAP_INTERRUPT) iap->pm_iap_config |= IAP_INT; return (0); +} + +int +pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm) +{ + const struct pmu_event *pe; + struct pmu_event_desc ped; + pmu_mfr_t mfr; + int idx = -1; + + if ((mfr = pmu_events_mfr()) == PMU_INVALID) + return (ENOENT); + + bzero(&pm->pm_md, sizeof(pm->pm_md)); + pm->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); + event_name = pmu_alias_get(event_name); + if ((pe = pmu_event_get(NULL, event_name, &idx)) == NULL) + return (ENOENT); + if (pe->alias && (pe = pmu_event_get(NULL, pe->alias, &idx)) == NULL) + return (ENOENT); + assert(idx >= 0); + pm->pm_ev = idx; + + if (pe->event == NULL) + return (ENOENT); + if (pmu_parse_event(&ped, pe->event)) + return (ENOENT); + + if (mfr == PMU_INTEL) + return (pmc_pmu_intel_pmcallocate(event_name, pm, &ped)); + else + return (pmc_pmu_amd_pmcallocate(event_name, pm, &ped)); } /* Modified: head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json Tue Aug 14 01:57:11 2018 (r337734) +++ head/lib/libpmc/pmu-events/arch/x86/amdfam17h/core.json Tue Aug 14 05:18:43 2018 (r337735) @@ -3,16 +3,19 @@ "EventName": "ex_ret_instr", "EventCode": "0xc0", "BriefDescription": "Retired Instructions." + "SampleAfterValue": "2000003", }, { "EventName": "ex_ret_cops", "EventCode": "0xc1", "BriefDescription": "The number of uOps retired. This includes all processor activity (instructions, exceptions, interrupts, microcode assists, etc.). The number of events logged per cycle can vary from 0 to 4." + "SampleAfterValue": "2000003", }, { "EventName": "ex_ret_brn", "EventCode": "0xc2", "BriefDescription": "The number of branch instructions retired. This includes all types of architectural control flow changes, including exceptions and interrupts." + "SampleAfterValue": "2000003", }, { "EventName": "ex_ret_brn_misp", Modified: head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json ============================================================================== --- head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json Tue Aug 14 01:57:11 2018 (r337734) +++ head/lib/libpmc/pmu-events/arch/x86/amdfam17h/memory.json Tue Aug 14 05:18:43 2018 (r337735) @@ -221,5 +221,6 @@ "EventName": "ls_not_halted_cyc", "EventCode": "0x76", "BriefDescription": "Cycles not in Halt." + "SampleAfterValue": "2000003", } ] Modified: head/lib/libpmc/pmu-events/arch/x86/mapfile.csv ============================================================================== --- head/lib/libpmc/pmu-events/arch/x86/mapfile.csv Tue Aug 14 01:57:11 2018 (r337734) +++ head/lib/libpmc/pmu-events/arch/x86/mapfile.csv Tue Aug 14 05:18:43 2018 (r337735) @@ -36,4 +36,8 @@ GenuineIntel-6-2C,v2,westmereep-dp,core GenuineIntel-6-25,v2,westmereep-sp,core GenuineIntel-6-2F,v2,westmereex,core GenuineIntel-6-55,v1,skylakex,core -AuthenticAMD-23-1,v1,amdfam17h,core +AuthenticAMD-23-01,v1,amdfam17h,core +AuthenticAMD-23-02,v1,amdfam17h,core +AuthenticAMD-23-03,v1,amdfam17h,core +AuthenticAMD-23-04,v1,amdfam17h,core +AuthenticAMD-23-05,v1,amdfam17h,core Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Tue Aug 14 01:57:11 2018 (r337734) +++ head/sys/dev/hwpmc/hwpmc_amd.c Tue Aug 14 05:18:43 2018 (r337735) @@ -458,6 +458,12 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm, if ((pd->pd_caps & caps) != caps) return EPERM; + if (strlen(pmc_cpuid) != 0) { + pm->pm_md.pm_amd.pm_amd_evsel = + a->pm_md.pm_amd.pm_amd_config; + PMCDBG2(MDP,ALL,2,"amd-allocate ri=%d -> config=0x%x", ri, a->pm_md.pm_amd.pm_amd_config); + return (0); + } pe = a->pm_ev; @@ -884,6 +890,7 @@ pmc_amd_initialize(void) enum pmc_cputype cputype; struct pmc_mdep *pmc_mdep; enum pmc_class class; + int model; char *name; /* @@ -895,6 +902,11 @@ pmc_amd_initialize(void) */ name = NULL; + model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); + if (CPUID_TO_FAMILY(cpu_id) == 0x17) + snprintf(pmc_cpuid, sizeof(pmc_cpuid), "AuthenticAMD-%d-%02X", + CPUID_TO_FAMILY(cpu_id), model); + switch (cpu_id & 0xF00) { #if defined(__i386__) case 0x600: /* Athlon(tm) processor */ @@ -912,7 +924,7 @@ pmc_amd_initialize(void) break; default: - (void) printf("pmc: Unknown AMD CPU.\n"); + (void) printf("pmc: Unknown AMD CPU %x %d-%d.\n", cpu_id, (cpu_id & 0xF00) >> 8, model); return NULL; } From owner-svn-src-all@freebsd.org Tue Aug 14 07:54: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 656E8106F485; Tue, 14 Aug 2018 07:54:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 145AB83200; Tue, 14 Aug 2018 07:54:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E90A318CE7; Tue, 14 Aug 2018 07:54:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7E7sEVp018315; Tue, 14 Aug 2018 07:54:14 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7E7sEFs018313; Tue, 14 Aug 2018 07:54:14 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808140754.w7E7sEFs018313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 14 Aug 2018 07:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337736 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 337736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 07:54:15 -0000 Author: ae Date: Tue Aug 14 07:54:14 2018 New Revision: 337736 URL: https://svnweb.freebsd.org/changeset/base/337736 Log: Restore ability to send ICMP and ICMPv6 redirects. It was lost when tryforward appeared. Now ip[6]_tryforward will be enabled only when sending redirects for corresponding IP version is disabled via sysctl. Otherwise will be used default forwarding function. PR: 221137 Submitted by: mckay@ MFC after: 2 weeks Modified: head/sys/netinet/ip_input.c head/sys/netinet6/ip6_input.c Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Tue Aug 14 05:18:43 2018 (r337735) +++ head/sys/netinet/ip_input.c Tue Aug 14 07:54:14 2018 (r337736) @@ -557,13 +557,15 @@ tooshort: /* * Try to forward the packet, but if we fail continue. + * ip_tryforward() does not generate redirects, so fall + * through to normal processing if redirects are required. * ip_tryforward() does inbound and outbound packet firewall * processing. If firewall has decided that destination becomes * our local address, it sets M_FASTFWD_OURS flag. In this * case skip another inbound firewall processing and update * ip pointer. */ - if (V_ipforwarding != 0 + if (V_ipforwarding != 0 && V_ipsendredirects == 0 #if defined(IPSEC) || defined(IPSEC_SUPPORT) && (!IPSEC_ENABLED(ipv4) || IPSEC_CAPS(ipv4, m, IPSEC_CAP_OPERABLE) == 0) Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Tue Aug 14 05:18:43 2018 (r337735) +++ head/sys/netinet6/ip6_input.c Tue Aug 14 07:54:14 2018 (r337736) @@ -720,13 +720,15 @@ ip6_input(struct mbuf *m) #endif /* * Try to forward the packet, but if we fail continue. + * ip6_tryforward() does not generate redirects, so fall + * through to normal processing if redirects are required. * ip6_tryforward() does inbound and outbound packet firewall * processing. If firewall has decided that destination becomes * our local address, it sets M_FASTFWD_OURS flag. In this * case skip another inbound firewall processing and update * ip6 pointer. */ - if (V_ip6_forwarding != 0 + if (V_ip6_forwarding != 0 && V_ip6_sendredirects == 0 #if defined(IPSEC) || defined(IPSEC_SUPPORT) && (!IPSEC_ENABLED(ipv6) || IPSEC_CAPS(ipv6, m, IPSEC_CAP_OPERABLE) == 0) From owner-svn-src-all@freebsd.org Tue Aug 14 08:32: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 9AA4910709C4; Tue, 14 Aug 2018 08:32:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C4838466B; Tue, 14 Aug 2018 08:32:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D74A19382; Tue, 14 Aug 2018 08:32:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7E8WYVH038398; Tue, 14 Aug 2018 08:32:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7E8WYwK038397; Tue, 14 Aug 2018 08:32:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201808140832.w7E8WYwK038397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 14 Aug 2018 08:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337737 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 08:32:34 -0000 Author: tuexen Date: Tue Aug 14 08:32:33 2018 New Revision: 337737 URL: https://svnweb.freebsd.org/changeset/base/337737 Log: Remove a set but not used warning showing up in usrsctp. Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Aug 14 07:54:14 2018 (r337736) +++ head/sys/netinet/sctp_input.c Tue Aug 14 08:32:33 2018 (r337737) @@ -3231,7 +3231,6 @@ static void sctp_handle_shutdown_complete(struct sctp_shutdown_complete_chunk *cp SCTP_UNUSED, struct sctp_tcb *stcb, struct sctp_nets *net) { - struct sctp_association *asoc; #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3241,7 +3240,6 @@ sctp_handle_shutdown_complete(struct sctp_shutdown_com if (stcb == NULL) return; - asoc = &stcb->asoc; /* process according to association state */ if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) { /* unexpected SHUTDOWN-COMPLETE... so ignore... */ @@ -3255,8 +3253,8 @@ sctp_handle_shutdown_complete(struct sctp_shutdown_com sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } #ifdef INVARIANTS - if (!TAILQ_EMPTY(&asoc->send_queue) || - !TAILQ_EMPTY(&asoc->sent_queue) || + if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || + !TAILQ_EMPTY(&stcb->asoc.sent_queue) || sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED)) { panic("Queues are not empty when handling SHUTDOWN-COMPLETE"); } From owner-svn-src-all@freebsd.org Tue Aug 14 08:33:48 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 7E6711070A67; Tue, 14 Aug 2018 08:33:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3093E847EF; Tue, 14 Aug 2018 08:33:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11BF319385; Tue, 14 Aug 2018 08:33:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7E8XlSa038515; Tue, 14 Aug 2018 08:33:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7E8Xl0Y038514; Tue, 14 Aug 2018 08:33:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201808140833.w7E8Xl0Y038514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 14 Aug 2018 08:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337738 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 337738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 08:33:48 -0000 Author: tuexen Date: Tue Aug 14 08:33:47 2018 New Revision: 337738 URL: https://svnweb.freebsd.org/changeset/base/337738 Log: Use a macro to set the assoc state. I missed this in r337706. Modified: head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Tue Aug 14 08:32:33 2018 (r337737) +++ head/sys/netinet6/sctp6_usrreq.c Tue Aug 14 08:33:47 2018 (r337738) @@ -919,7 +919,7 @@ sctp6_connect(struct socket *so, struct sockaddr *addr /* Set the connected flag so we can queue data */ soisconnecting(so); } - stcb->asoc.state = SCTP_STATE_COOKIE_WAIT; + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); /* initialize authentication parameters for the assoc */ From owner-svn-src-all@freebsd.org Tue Aug 14 11:00:55 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 B20D01074509; Tue, 14 Aug 2018 11:00:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66D7F89D08; Tue, 14 Aug 2018 11:00:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 480D21AA18; Tue, 14 Aug 2018 11:00:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EB0tRA010492; Tue, 14 Aug 2018 11:00:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EB0taI010491; Tue, 14 Aug 2018 11:00:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808141100.w7EB0taI010491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Aug 2018 11:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337739 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 337739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:00:55 -0000 Author: andrew Date: Tue Aug 14 11:00:54 2018 New Revision: 337739 URL: https://svnweb.freebsd.org/changeset/base/337739 Log: Support reading from the arm64 ID registers from userspace. Trap reads to the arm64 ID registers and write a safe value into them. This will allow us to put more useful values in these later and have userland check them to find what features the hardware supports. These are currently safe defaults, but will later be populated with better values from the hardware. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16533 Modified: head/sys/arm64/arm64/undefined.c Modified: head/sys/arm64/arm64/undefined.c ============================================================================== --- head/sys/arm64/arm64/undefined.c Tue Aug 14 08:33:47 2018 (r337738) +++ head/sys/arm64/arm64/undefined.c Tue Aug 14 11:00:54 2018 (r337739) @@ -53,6 +53,135 @@ struct undef_handler { */ LIST_HEAD(, undef_handler) undef_handlers[2]; +#define MRS_MASK 0xfff00000 +#define MRS_VALUE 0xd5300000 +#define MRS_SPECIAL(insn) ((insn) & 0x000fffe0) +#define MRS_REGISTER(insn) ((insn) & 0x0000001f) +#define MRS_Op0_SHIFT 19 +#define MRS_Op0_MASK 0x00080000 +#define MRS_Op1_SHIFT 16 +#define MRS_Op1_MASK 0x00070000 +#define MRS_CRn_SHIFT 12 +#define MRS_CRn_MASK 0x0000f000 +#define MRS_CRm_SHIFT 8 +#define MRS_CRm_MASK 0x00000f00 +#define MRS_Op2_SHIFT 5 +#define MRS_Op2_MASK 0x000000e0 +#define MRS_Rt_SHIFT 0 +#define MRS_Rt_MASK 0x0000001f + +static inline int +mrs_Op0(uint32_t insn) +{ + + /* op0 is encoded without the top bit in a mrs instruction */ + return (2 | ((insn & MRS_Op0_MASK) >> MRS_Op0_SHIFT)); +} + +#define MRS_GET(op) \ +static inline int \ +mrs_##op(uint32_t insn) \ +{ \ + \ + return ((insn & MRS_##op##_MASK) >> MRS_##op##_SHIFT); \ +} +MRS_GET(Op1) +MRS_GET(CRn) +MRS_GET(CRm) +MRS_GET(Op2) + +struct mrs_safe_value { + u_int CRm; + u_int Op2; + uint64_t value; +}; + +static struct mrs_safe_value safe_values[] = { + { /* id_aa64pfr0_el1 */ + .CRm = 4, + .Op2 = 0, + .value = ID_AA64PFR0_ADV_SIMD_NONE | ID_AA64PFR0_FP_NONE | + ID_AA64PFR0_EL1_64 | ID_AA64PFR0_EL0_64, + }, + { /* id_aa64dfr0_el1 */ + .CRm = 5, + .Op2 = 0, + .value = ID_AA64DFR0_DEBUG_VER_8, + }, +}; + +static int +user_mrs_handler(vm_offset_t va, uint32_t insn, struct trapframe *frame, + uint32_t esr) +{ + uint64_t value; + int CRm, Op2, i, reg; + + if ((insn & MRS_MASK) != MRS_VALUE) + return (0); + + /* + * We only emulate Op0 == 3, Op1 == 0, CRn == 0, CRm == {0, 4-7}. + * These are in the EL1 CPU identification space. + * CRm == 0 holds MIDR_EL1, MPIDR_EL1, and REVID_EL1. + * CRm == {4-7} holds the ID_AA64 registers. + * + * For full details see the ARMv8 ARM (ARM DDI 0487C.a) + * Table D9-2 System instruction encodings for non-Debug System + * register accesses. + */ + if (mrs_Op0(insn) != 3 || mrs_Op1(insn) != 0 || mrs_CRn(insn) != 0) + return (0); + + CRm = mrs_CRm(insn); + if (CRm > 7 || (CRm < 4 && CRm != 0)) + return (0); + + Op2 = mrs_Op2(insn); + value = 0; + + for (i = 0; i < nitems(safe_values); i++) { + if (safe_values[i].CRm == CRm && safe_values[i].Op2 == Op2) { + value = safe_values[i].value; + break; + } + } + + if (CRm == 0) { + switch (Op2) { + case 0: + value = READ_SPECIALREG(midr_el1); + break; + case 5: + value = READ_SPECIALREG(mpidr_el1); + break; + case 6: + value = READ_SPECIALREG(revidr_el1); + break; + default: + return (0); + } + } + + /* + * We will handle this instruction, move to the next so we + * don't trap here again. + */ + frame->tf_elr += INSN_SIZE; + + reg = MRS_REGISTER(insn); + /* If reg is 31 then write to xzr, i.e. do nothing */ + if (reg == 31) + return (1); + + if (reg < nitems(frame->tf_x)) + frame->tf_x[reg] = value; + else if (reg == 30) + frame->tf_lr = value; + + return (1); +} + /* * Work around a bug in QEMU prior to 2.5.1 where reading unknown ID * registers would raise an exception when they should return 0. @@ -63,9 +192,6 @@ id_aa64mmfr2_handler(vm_offset_t va, uint32_t insn, st { int reg; -#define MRS_MASK 0xfff00000 -#define MRS_VALUE 0xd5300000 -#define MRS_REGISTER(insn) ((insn) & 0x1f) #define MRS_ID_AA64MMFR2_EL0_MASK (MRS_MASK | 0x000fffe0) #define MRS_ID_AA64MMFR2_EL0_VALUE (MRS_VALUE | 0x00080740) @@ -93,6 +219,7 @@ undef_init(void) LIST_INIT(&undef_handlers[0]); LIST_INIT(&undef_handlers[1]); + install_undef_handler(true, user_mrs_handler); install_undef_handler(false, id_aa64mmfr2_handler); } From owner-svn-src-all@freebsd.org Tue Aug 14 11:01: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 327CD10746AA; Tue, 14 Aug 2018 11:01:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE09989F19; Tue, 14 Aug 2018 11:01:53 +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 C02561AB76; Tue, 14 Aug 2018 11:01:53 +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 w7EB1rli014418; Tue, 14 Aug 2018 11:01:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EB1rnj014416; Tue, 14 Aug 2018 11:01:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808141101.w7EB1rnj014416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 14 Aug 2018 11:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337740 - in head: sbin/init stand/man X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: sbin/init stand/man X-SVN-Commit-Revision: 337740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:01:54 -0000 Author: trasz Date: Tue Aug 14 11:01:52 2018 New Revision: 337740 URL: https://svnweb.freebsd.org/changeset/base/337740 Log: Add init_exec kenv(1) variable, to make init(8) execute a file after opening the console, replacing init as PID 1. From the user point of view, it makes it possible to run eg the shell as PID 1, using 'set init_exec=/bin/sh' at the loader(8) prompt. Reviewed by: kib MFC after: 2 weeks Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16625 Modified: head/sbin/init/init.8 head/sbin/init/init.c head/stand/man/loader.8 Modified: head/sbin/init/init.8 ============================================================================== --- head/sbin/init/init.8 Tue Aug 14 11:00:54 2018 (r337739) +++ head/sbin/init/init.8 Tue Aug 14 11:01:52 2018 (r337740) @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd August 7, 2018 +.Dd August 14, 2018 .Dt INIT 8 .Os .Sh NAME @@ -316,6 +316,14 @@ See .Xr reboot 8 .Fl r for details. +.It Va init_exec +If set to a valid file name in the root file system, +instructs +.Nm +to directly execute that file as the very first action, +replacing +.Nm +as PID 1. .It Va init_script If set to a valid file name in the root file system, instructs @@ -341,6 +349,8 @@ Defines the shell binary to be used for executing the The default is .Dq Li /bin/sh . It is used for running the +.Va init_exec +or .Va init_script if set, as well as for the .Pa /etc/rc Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Tue Aug 14 11:00:54 2018 (r337739) +++ head/sbin/init/init.c Tue Aug 14 11:01:52 2018 (r337740) @@ -149,6 +149,7 @@ static state_t current_state = death_single; static void execute_script(char *argv[]); static void open_console(void); static const char *get_shell(void); +static void replace_init(char *path); static void write_stderr(const char *message); typedef struct init_session { @@ -330,6 +331,11 @@ invalid: close(1); close(2); + if (kenv(KENV_GET, "init_exec", kenv_value, sizeof(kenv_value)) > 0) { + replace_init(kenv_value); + _exit(0); /* reboot */ + } + if (kenv(KENV_GET, "init_script", kenv_value, sizeof(kenv_value)) > 0) { state_func_t next_transition; @@ -1085,6 +1091,22 @@ execute_script(char *argv[]) shell = get_shell(); execv(shell, argv); stall("can't exec %s for %s: %m", shell, script); +} + +/* + * Execute binary, replacing init(8) as PID 1. + */ +static void +replace_init(char *path) +{ + char *argv[3]; + char sh[] = "sh"; + + argv[0] = sh; + argv[1] = path; + argv[2] = NULL; + + execute_script(argv); } /* Modified: head/stand/man/loader.8 ============================================================================== --- head/stand/man/loader.8 Tue Aug 14 11:00:54 2018 (r337739) +++ head/stand/man/loader.8 Tue Aug 14 11:01:52 2018 (r337740) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2018 +.Dd August 14, 2018 .Dt LOADER 8 .Os .Sh NAME @@ -490,6 +490,9 @@ directive from has been processed, allowing kernel panics that happen during the early stages of boot to be captured. .It Va init_chroot +See +.Xr init 8 . +.It Va init_exec See .Xr init 8 . .It Va init_path From owner-svn-src-all@freebsd.org Tue Aug 14 11: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 547B91074BCD; Tue, 14 Aug 2018 11:15:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0857A8A616; Tue, 14 Aug 2018 11:15:06 +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 DE9B31AD41; Tue, 14 Aug 2018 11:15:05 +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 w7EBF5Ri020227; Tue, 14 Aug 2018 11:15:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EBF5rA020224; Tue, 14 Aug 2018 11:15:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808141115.w7EBF5rA020224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 14 Aug 2018 11:15:05 +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: r337741 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 337741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:15:06 -0000 Author: hselasky Date: Tue Aug 14 11:15:05 2018 New Revision: 337741 URL: https://svnweb.freebsd.org/changeset/base/337741 Log: MFC r336407: Handle jumbo frames without requiring big clusters in mlx5en(4). The scatter list is formed by the chunks of MCLBYTES each, and larger than default packets are returned to the stack as the mbuf chain. Submitted by: kib@ Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Tue Aug 14 11:01:52 2018 (r337740) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Tue Aug 14 11:15:05 2018 (r337741) @@ -83,8 +83,19 @@ #define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa #define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xe -/* freeBSD HW LRO is limited by 16KB - the size of max mbuf */ +#define MLX5E_MAX_RX_SEGS 7 + +#ifndef MLX5E_MAX_RX_BYTES +#define MLX5E_MAX_RX_BYTES MCLBYTES +#endif + +#if (MLX5E_MAX_RX_SEGS == 1) +/* FreeBSD HW LRO is limited by 16KB - the size of max mbuf */ #define MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ MJUM16BYTES +#else +#define MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ \ + MIN(65535, MLX5E_MAX_RX_SEGS * MLX5E_MAX_RX_BYTES) +#endif #define MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_USEC 0x10 #define MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_USEC_FROM_CQE 0x3 #define MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_PKTS 0x20 @@ -476,6 +487,7 @@ struct mlx5e_rq { struct mtx mtx; bus_dma_tag_t dma_tag; u32 wqe_sz; + u32 nsegs; struct mlx5e_rq_mbuf *mbuf; struct ifnet *ifp; struct mlx5e_rq_stats stats; @@ -709,8 +721,11 @@ struct mlx5e_tx_wqe { struct mlx5e_rx_wqe { struct mlx5_wqe_srq_next_seg next; - struct mlx5_wqe_data_seg data; + struct mlx5_wqe_data_seg data[]; }; + +/* the size of the structure above must be power of two */ +CTASSERT(powerof2(sizeof(struct mlx5e_rx_wqe))); struct mlx5e_eeprom { int lock_bit; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:01:52 2018 (r337740) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:15:05 2018 (r337741) @@ -34,6 +34,8 @@ char mlx5e_version[] = "Mellanox Ethernet driver" " (" ETH_DRIVER_VERSION ")"; +static int mlx5e_get_wqe_sz(struct mlx5e_priv *priv, u32 *wqe_sz, u32 *nsegs); + struct mlx5e_channel_param { struct mlx5e_rq_param rq; struct mlx5e_sq_param sq; @@ -654,7 +656,12 @@ mlx5e_create_rq(struct mlx5e_channel *c, int wq_sz; int err; int i; + u32 nsegs, wqe_sz; + err = mlx5e_get_wqe_sz(priv, &wqe_sz, &nsegs); + if (err != 0) + goto done; + /* Create DMA descriptor TAG */ if ((err = -bus_dma_tag_create( bus_get_dma_tag(mdev->pdev->dev.bsddev), @@ -663,9 +670,9 @@ mlx5e_create_rq(struct mlx5e_channel *c, BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MJUM16BYTES, /* maxsize */ - 1, /* nsegments */ - MJUM16BYTES, /* maxsegsize */ + nsegs * MLX5E_MAX_RX_BYTES, /* maxsize */ + nsegs, /* nsegments */ + nsegs * MLX5E_MAX_RX_BYTES, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockfuncarg */ &rq->dma_tag))) @@ -678,29 +685,19 @@ mlx5e_create_rq(struct mlx5e_channel *c, rq->wq.db = &rq->wq.db[MLX5_RCV_DBR]; - if (priv->params.hw_lro_en) { - rq->wqe_sz = priv->params.lro_wqe_sz; - } else { - rq->wqe_sz = MLX5E_SW2MB_MTU(priv->ifp->if_mtu); - } - if (rq->wqe_sz > MJUM16BYTES) { - err = -ENOMEM; + err = mlx5e_get_wqe_sz(priv, &rq->wqe_sz, &rq->nsegs); + if (err != 0) goto err_rq_wq_destroy; - } else if (rq->wqe_sz > MJUM9BYTES) { - rq->wqe_sz = MJUM16BYTES; - } else if (rq->wqe_sz > MJUMPAGESIZE) { - rq->wqe_sz = MJUM9BYTES; - } else if (rq->wqe_sz > MCLBYTES) { - rq->wqe_sz = MJUMPAGESIZE; - } else { - rq->wqe_sz = MCLBYTES; - } wq_sz = mlx5_wq_ll_get_size(&rq->wq); rq->mbuf = malloc(wq_sz * sizeof(rq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); for (i = 0; i != wq_sz; i++) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, i); +#if (MLX5E_MAX_RX_SEGS == 1) uint32_t byte_count = rq->wqe_sz - MLX5E_NET_IP_ALIGN; +#else + int j; +#endif err = -bus_dmamap_create(rq->dma_tag, 0, &rq->mbuf[i].dma_map); if (err != 0) { @@ -708,8 +705,15 @@ mlx5e_create_rq(struct mlx5e_channel *c, bus_dmamap_destroy(rq->dma_tag, rq->mbuf[i].dma_map); goto err_rq_mbuf_free; } - wqe->data.lkey = c->mkey_be; - wqe->data.byte_count = cpu_to_be32(byte_count | MLX5_HW_START_PADDING); + + /* set value for constant fields */ +#if (MLX5E_MAX_RX_SEGS == 1) + wqe->data[0].lkey = c->mkey_be; + wqe->data[0].byte_count = cpu_to_be32(byte_count | MLX5_HW_START_PADDING); +#else + for (j = 0; j < rq->nsegs; j++) + wqe->data[j].lkey = c->mkey_be; +#endif } rq->ifp = c->ifp; @@ -1655,16 +1659,51 @@ mlx5e_close_channel_wait(struct mlx5e_channel *volatil free(c, M_MLX5EN); } +static int +mlx5e_get_wqe_sz(struct mlx5e_priv *priv, u32 *wqe_sz, u32 *nsegs) +{ + u32 r, n; + + r = priv->params.hw_lro_en ? priv->params.lro_wqe_sz : + MLX5E_SW2MB_MTU(priv->ifp->if_mtu); + if (r > MJUM16BYTES) + return (-ENOMEM); + + if (r > MJUM9BYTES) + r = MJUM16BYTES; + else if (r > MJUMPAGESIZE) + r = MJUM9BYTES; + else if (r > MCLBYTES) + r = MJUMPAGESIZE; + else + r = MCLBYTES; + + /* + * n + 1 must be a power of two, because stride size must be. + * Stride size is 16 * (n + 1), as the first segment is + * control. + */ + for (n = howmany(r, MLX5E_MAX_RX_BYTES); !powerof2(n + 1); n++) + ; + + *wqe_sz = r; + *nsegs = n; + return (0); +} + static void mlx5e_build_rq_param(struct mlx5e_priv *priv, struct mlx5e_rq_param *param) { void *rqc = param->rqc; void *wq = MLX5_ADDR_OF(rqc, rqc, wq); + u32 wqe_sz, nsegs; + mlx5e_get_wqe_sz(priv, &wqe_sz, &nsegs); MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_LINKED_LIST); MLX5_SET(wq, wq, end_padding_mode, MLX5_WQ_END_PAD_MODE_ALIGN); - MLX5_SET(wq, wq, log_wq_stride, ilog2(sizeof(struct mlx5e_rx_wqe))); + MLX5_SET(wq, wq, log_wq_stride, ilog2(sizeof(struct mlx5e_rx_wqe) + + nsegs * sizeof(struct mlx5_wqe_data_seg))); MLX5_SET(wq, wq, log_wq_sz, priv->params.log_rq_size); MLX5_SET(wq, wq, pd, priv->pdn); Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Aug 14 11:01:52 2018 (r337740) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Aug 14 11:15:05 2018 (r337741) @@ -32,21 +32,47 @@ static inline int mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq, struct mlx5e_rx_wqe *wqe, u16 ix) { - bus_dma_segment_t segs[1]; + bus_dma_segment_t segs[rq->nsegs]; struct mbuf *mb; int nsegs; int err; - +#if (MLX5E_MAX_RX_SEGS != 1) + struct mbuf *mb_head; + int i; +#endif if (rq->mbuf[ix].mbuf != NULL) return (0); +#if (MLX5E_MAX_RX_SEGS == 1) mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, rq->wqe_sz); if (unlikely(!mb)) return (-ENOMEM); - /* set initial mbuf length */ mb->m_pkthdr.len = mb->m_len = rq->wqe_sz; +#else + mb_head = mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, + MLX5E_MAX_RX_BYTES); + if (unlikely(mb == NULL)) + return (-ENOMEM); + mb->m_len = MLX5E_MAX_RX_BYTES; + mb->m_pkthdr.len = MLX5E_MAX_RX_BYTES; + + for (i = 1; i < rq->nsegs; i++) { + if (mb_head->m_pkthdr.len >= rq->wqe_sz) + break; + mb = mb->m_next = m_getjcl(M_NOWAIT, MT_DATA, 0, + MLX5E_MAX_RX_BYTES); + if (unlikely(mb == NULL)) { + m_freem(mb_head); + return (-ENOMEM); + } + mb->m_len = MLX5E_MAX_RX_BYTES; + mb_head->m_pkthdr.len += MLX5E_MAX_RX_BYTES; + } + /* rewind to first mbuf in chain */ + mb = mb_head; +#endif /* get IP header aligned */ m_adj(mb, MLX5E_NET_IP_ALIGN); @@ -54,12 +80,26 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq, mb, segs, &nsegs, BUS_DMA_NOWAIT); if (err != 0) goto err_free_mbuf; - if (unlikely(nsegs != 1)) { + if (unlikely(nsegs == 0)) { bus_dmamap_unload(rq->dma_tag, rq->mbuf[ix].dma_map); err = -ENOMEM; goto err_free_mbuf; } - wqe->data.addr = cpu_to_be64(segs[0].ds_addr); +#if (MLX5E_MAX_RX_SEGS == 1) + wqe->data[0].addr = cpu_to_be64(segs[0].ds_addr); +#else + wqe->data[0].addr = cpu_to_be64(segs[0].ds_addr); + wqe->data[0].byte_count = cpu_to_be32(segs[0].ds_len | + MLX5_HW_START_PADDING); + for (i = 1; i != nsegs; i++) { + wqe->data[i].addr = cpu_to_be64(segs[i].ds_addr); + wqe->data[i].byte_count = cpu_to_be32(segs[i].ds_len); + } + for (; i < rq->nsegs; i++) { + wqe->data[i].addr = 0; + wqe->data[i].byte_count = 0; + } +#endif rq->mbuf[ix].mbuf = mb; rq->mbuf[ix].data = mb->m_data; @@ -185,6 +225,9 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, u32 cqe_bcnt) { struct ifnet *ifp = rq->ifp; +#if (MLX5E_MAX_RX_SEGS != 1) + struct mbuf *mb_head; +#endif int lro_num_seg; /* HW LRO session aggregated packets counter */ lro_num_seg = be32_to_cpu(cqe->srqn) >> 24; @@ -194,7 +237,26 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, rq->stats.lro_bytes += cqe_bcnt; } +#if (MLX5E_MAX_RX_SEGS == 1) mb->m_pkthdr.len = mb->m_len = cqe_bcnt; +#else + mb->m_pkthdr.len = cqe_bcnt; + for (mb_head = mb; mb != NULL; mb = mb->m_next) { + if (mb->m_len > cqe_bcnt) + mb->m_len = cqe_bcnt; + cqe_bcnt -= mb->m_len; + if (likely(cqe_bcnt == 0)) { + if (likely(mb->m_next != NULL)) { + /* trim off empty mbufs */ + m_freem(mb->m_next); + mb->m_next = NULL; + } + break; + } + } + /* rewind to first mbuf in chain */ + mb = mb_head; +#endif /* check if a Toeplitz hash was computed */ if (cqe->rss_hash_type != 0) { mb->m_pkthdr.flowid = be32_to_cpu(cqe->rss_hash_result); @@ -360,6 +422,10 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) } if ((MHLEN - MLX5E_NET_IP_ALIGN) >= byte_cnt && (mb = m_gethdr(M_NOWAIT, MT_DATA)) != NULL) { +#if (MLX5E_MAX_RX_SEGS != 1) + /* set maximum mbuf length */ + mb->m_len = MHLEN - MLX5E_NET_IP_ALIGN; +#endif /* get IP header aligned */ mb->m_data += MLX5E_NET_IP_ALIGN; From owner-svn-src-all@freebsd.org Tue Aug 14 11:19: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 75B2A1074D88; Tue, 14 Aug 2018 11:19:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28D968A836; Tue, 14 Aug 2018 11:19:06 +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 03F651AD44; Tue, 14 Aug 2018 11:19:06 +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 w7EBJ5ut020436; Tue, 14 Aug 2018 11:19:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EBJ47s020429; Tue, 14 Aug 2018 11:19:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808141119.w7EBJ47s020429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 14 Aug 2018 11:19:04 +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: r337742 - in stable/10/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 337742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:19:06 -0000 Author: hselasky Date: Tue Aug 14 11:19:04 2018 New Revision: 337742 URL: https://svnweb.freebsd.org/changeset/base/337742 Log: MFC r336450: Do not inline transmit headers and use HW VLAN tagging if supported by mlx5en(4). Query the minimal inline mode supported by the card. When creating a send queue, cache the queried mode and optimize the transmit if no inlining is required. In this case, we can avoid touching the headers cache line and avoid dirtying several more lines by copying headers into the send WQEs. Also, if no inline headers are used, hardware assists in the VLAN tag framing. Submitted by: kib@, slavash@ Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/device.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c stable/10/sys/dev/mlx5/qp.h stable/10/sys/dev/mlx5/vport.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/device.h ============================================================================== --- stable/10/sys/dev/mlx5/device.h Tue Aug 14 11:15:05 2018 (r337741) +++ stable/10/sys/dev/mlx5/device.h Tue Aug 14 11:19:04 2018 (r337742) @@ -1311,6 +1311,13 @@ enum { MLX5_CMD_HCA_CAP_MIN_WQE_INLINE_MODE_NOT_REQUIRED = 0x2 }; +enum mlx5_inline_modes { + MLX5_INLINE_MODE_NONE, + MLX5_INLINE_MODE_L2, + MLX5_INLINE_MODE_IP, + MLX5_INLINE_MODE_TCP_UDP, +}; + enum { MLX5_QUERY_VPORT_STATE_OUT_STATE_FOLLOW = 0x2, }; Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Aug 14 11:15:05 2018 (r337741) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c Tue Aug 14 11:19:04 2018 (r337742) @@ -228,6 +228,58 @@ int mlx5_vport_query_out_of_rx_buffer(struct mlx5_core return err; } +int mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev, + u16 vport, u8 *min_inline) +{ + u32 out[MLX5_ST_SZ_DW(query_nic_vport_context_out)] = {0}; + int err; + + err = mlx5_query_nic_vport_context(mdev, vport, out, sizeof(out)); + if (!err) + *min_inline = MLX5_GET(query_nic_vport_context_out, out, + nic_vport_context.min_wqe_inline_mode); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_min_inline); + +void mlx5_query_min_inline(struct mlx5_core_dev *mdev, + u8 *min_inline_mode) +{ + switch (MLX5_CAP_ETH(mdev, wqe_inline_mode)) { + case MLX5_CAP_INLINE_MODE_L2: + *min_inline_mode = MLX5_INLINE_MODE_L2; + break; + case MLX5_CAP_INLINE_MODE_VPORT_CONTEXT: + mlx5_query_nic_vport_min_inline(mdev, 0, min_inline_mode); + break; + case MLX5_CAP_INLINE_MODE_NOT_REQUIRED: + *min_inline_mode = MLX5_INLINE_MODE_NONE; + break; + } +} +EXPORT_SYMBOL_GPL(mlx5_query_min_inline); + +int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev, + u16 vport, u8 min_inline) +{ + u32 in[MLX5_ST_SZ_DW(modify_nic_vport_context_in)] = {0}; + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in); + void *nic_vport_ctx; + + MLX5_SET(modify_nic_vport_context_in, in, + field_select.min_wqe_inline_mode, 1); + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); + MLX5_SET(modify_nic_vport_context_in, in, other_vport, 1); + + nic_vport_ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, + in, nic_vport_context); + MLX5_SET(nic_vport_context, nic_vport_ctx, + min_wqe_inline_mode, min_inline); + + return mlx5_modify_nic_vport_context(mdev, in, inlen); +} +EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_min_inline); + int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev, u16 vport, u8 *addr) { Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Tue Aug 14 11:15:05 2018 (r337741) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Tue Aug 14 11:19:04 2018 (r337742) @@ -404,6 +404,8 @@ struct mlx5e_params { u16 rx_hash_log_tbl_sz; u32 tx_pauseframe_control; u32 rx_pauseframe_control; + u16 tx_max_inline; + u8 tx_min_inline_mode; }; #define MLX5E_PARAMS(m) \ @@ -560,6 +562,9 @@ struct mlx5e_sq { u32 sqn; u32 bf_buf_size; u32 mkey_be; + u16 max_inline; + u8 min_inline_mode; + u8 vlan_inline_cap; /* control path */ struct mlx5_wq_ctrl wq_ctrl; @@ -851,5 +856,6 @@ int mlx5e_enable_sq(struct mlx5e_sq *, struct mlx5e_sq int mlx5e_modify_sq(struct mlx5e_sq *, int curr_state, int next_state); void mlx5e_disable_sq(struct mlx5e_sq *); void mlx5e_drain_sq(struct mlx5e_sq *); +u8 mlx5e_params_calculate_tx_min_inline(struct mlx5_core_dev *mdev); #endif /* _MLX5_EN_H_ */ Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:15:05 2018 (r337741) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:19:04 2018 (r337742) @@ -1022,6 +1022,9 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->ifp = priv->ifp; sq->priv = priv; sq->tc = tc; + sq->max_inline = priv->params.tx_max_inline; + sq->min_inline_mode = priv->params.tx_min_inline_mode; + sq->vlan_inline_cap = MLX5_CAP_ETH(mdev, wqe_vlan_insert); /* check if we should allocate a second packet buffer */ if (priv->params_ethtool.tx_bufring_disable == 0) { @@ -2840,6 +2843,16 @@ mlx5e_check_required_hca_cap(struct mlx5_core_dev *mde return (0); } +static u16 +mlx5e_get_max_inline_cap(struct mlx5_core_dev *mdev) +{ + int bf_buf_size = (1 << MLX5_CAP_GEN(mdev, log_bf_reg_size)) / 2; + + return bf_buf_size - + sizeof(struct mlx5e_tx_wqe) + + 2 /*sizeof(mlx5e_tx_wqe.inline_hdr_start)*/; +} + static void mlx5e_build_ifp_priv(struct mlx5_core_dev *mdev, struct mlx5e_priv *priv, @@ -2875,6 +2888,8 @@ mlx5e_build_ifp_priv(struct mlx5_core_dev *mdev, priv->params.num_tc = 1; priv->params.default_vlan_prio = 0; priv->counter_set_id = -1; + priv->params.tx_max_inline = mlx5e_get_max_inline_cap(mdev); + mlx5_query_min_inline(mdev, &priv->params.tx_min_inline_mode); /* * hw lro is currently defaulted to off. when it won't anymore we @@ -2971,6 +2986,20 @@ sysctl_firmware(SYSCTL_HANDLER_ARGS) fw_rev_sub(priv->mdev)); error = sysctl_handle_string(oidp, fw, sizeof(fw), req); return (error); +} + +u8 +mlx5e_params_calculate_tx_min_inline(struct mlx5_core_dev *mdev) +{ + u8 min_inline_mode; + + min_inline_mode = MLX5_INLINE_MODE_L2; + mlx5_query_min_inline(mdev, &min_inline_mode); + if (min_inline_mode == MLX5_INLINE_MODE_NONE && + !MLX5_CAP_ETH(mdev, wqe_vlan_insert)) + min_inline_mode = MLX5_INLINE_MODE_L2; + + return (min_inline_mode); } static void Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Tue Aug 14 11:15:05 2018 (r337741) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Tue Aug 14 11:19:04 2018 (r337742) @@ -137,7 +137,43 @@ mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) static inline u16 mlx5e_get_inline_hdr_size(struct mlx5e_sq *sq, struct mbuf *mb) { - return (MIN(MLX5E_MAX_TX_INLINE, mb->m_len)); + + switch(sq->min_inline_mode) { + case MLX5_INLINE_MODE_NONE: + /* + * When inline mode is NONE, we do not need to copy + * headers into WQEs, except when vlan tag framing is + * requested. Hardware might offload vlan tagging on + * transmit. This is a separate capability, which is + * known to be disabled on ConnectX-5 due to a hardware + * bug RM 931383. If vlan_inline_cap is not present and + * the packet has vlan tag, fall back to inlining. + */ + if ((mb->m_flags & M_VLANTAG) != 0 && + sq->vlan_inline_cap == 0) + break; + return (0); + case MLX5_INLINE_MODE_L2: + /* + * Due to hardware limitations, when trust mode is + * DSCP, the hardware may request MLX5_INLINE_MODE_L2 + * while it really needs all L2 headers and the 4 first + * bytes of the IP header (which include the + * TOS/traffic-class). + * + * To avoid doing a firmware command for querying the + * trust state and parsing the mbuf for doing + * unnecessary checks (VLAN/eth_type) in the fast path, + * we are going for the worth case (22 Bytes) if + * the mb->m_pkthdr.len allows it. + */ + if (mb->m_pkthdr.len > ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + 4) + return (MIN(sq->max_inline, ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + 4)); + break; + } + return (MIN(sq->max_inline, mb->m_pkthdr.len)); } static int @@ -275,37 +311,47 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struct mbuf **mbp) sq->mbuf[pi].num_bytes = max_t (unsigned int, mb->m_pkthdr.len, ETHER_MIN_LEN - ETHER_CRC_LEN); } - if (mb->m_flags & M_VLANTAG) { - struct ether_vlan_header *eh = - (struct ether_vlan_header *)wqe->eth.inline_hdr_start; - - /* Range checks */ - if (ihs > (MLX5E_MAX_TX_INLINE - ETHER_VLAN_ENCAP_LEN)) - ihs = (MLX5E_MAX_TX_INLINE - ETHER_VLAN_ENCAP_LEN); - else if (ihs < ETHER_HDR_LEN) { - err = EINVAL; - goto tx_drop; + if (ihs == 0) { + if ((mb->m_flags & M_VLANTAG) != 0) { + wqe->eth.vlan_cmd = htons(0x8000); /* bit 0 CVLAN */ + wqe->eth.vlan_hdr = htons(mb->m_pkthdr.ether_vtag); + } else { + wqe->eth.inline_hdr_sz = 0; } - m_copydata(mb, 0, ETHER_HDR_LEN, (caddr_t)eh); - m_adj(mb, ETHER_HDR_LEN); - /* Insert 4 bytes VLAN tag into data stream */ - eh->evl_proto = eh->evl_encap_proto; - eh->evl_encap_proto = htons(ETHERTYPE_VLAN); - eh->evl_tag = htons(mb->m_pkthdr.ether_vtag); - /* Copy rest of header data, if any */ - m_copydata(mb, 0, ihs - ETHER_HDR_LEN, (caddr_t)(eh + 1)); - m_adj(mb, ihs - ETHER_HDR_LEN); - /* Extend header by 4 bytes */ - ihs += ETHER_VLAN_ENCAP_LEN; } else { - m_copydata(mb, 0, ihs, wqe->eth.inline_hdr_start); - m_adj(mb, ihs); + if ((mb->m_flags & M_VLANTAG) != 0) { + struct ether_vlan_header *eh = (struct ether_vlan_header + *)wqe->eth.inline_hdr_start; + + /* Range checks */ + if (ihs > (MLX5E_MAX_TX_INLINE - ETHER_VLAN_ENCAP_LEN)) + ihs = (MLX5E_MAX_TX_INLINE - + ETHER_VLAN_ENCAP_LEN); + else if (ihs < ETHER_HDR_LEN) { + err = EINVAL; + goto tx_drop; + } + m_copydata(mb, 0, ETHER_HDR_LEN, (caddr_t)eh); + m_adj(mb, ETHER_HDR_LEN); + /* Insert 4 bytes VLAN tag into data stream */ + eh->evl_proto = eh->evl_encap_proto; + eh->evl_encap_proto = htons(ETHERTYPE_VLAN); + eh->evl_tag = htons(mb->m_pkthdr.ether_vtag); + /* Copy rest of header data, if any */ + m_copydata(mb, 0, ihs - ETHER_HDR_LEN, (caddr_t)(eh + + 1)); + m_adj(mb, ihs - ETHER_HDR_LEN); + /* Extend header by 4 bytes */ + ihs += ETHER_VLAN_ENCAP_LEN; + } else { + m_copydata(mb, 0, ihs, wqe->eth.inline_hdr_start); + m_adj(mb, ihs); + } + wqe->eth.inline_hdr_sz = cpu_to_be16(ihs); } - wqe->eth.inline_hdr_sz = cpu_to_be16(ihs); - ds_cnt = sizeof(*wqe) / MLX5_SEND_WQE_DS; - if (likely(ihs > sizeof(wqe->eth.inline_hdr_start))) { + if (ihs > sizeof(wqe->eth.inline_hdr_start)) { ds_cnt += DIV_ROUND_UP(ihs - sizeof(wqe->eth.inline_hdr_start), MLX5_SEND_WQE_DS); } Modified: stable/10/sys/dev/mlx5/qp.h ============================================================================== --- stable/10/sys/dev/mlx5/qp.h Tue Aug 14 11:15:05 2018 (r337741) +++ stable/10/sys/dev/mlx5/qp.h Tue Aug 14 11:19:04 2018 (r337742) @@ -236,8 +236,16 @@ struct mlx5_wqe_eth_seg { u8 swp_flags; __be16 mss; __be32 rsvd2; - __be16 inline_hdr_sz; - u8 inline_hdr_start[2]; + union { + struct { + __be16 inline_hdr_sz; + u8 inline_hdr_start[2]; + }; + struct { + __be16 vlan_cmd; + __be16 vlan_hdr; + }; + }; }; struct mlx5_wqe_xrc_seg { Modified: stable/10/sys/dev/mlx5/vport.h ============================================================================== --- stable/10/sys/dev/mlx5/vport.h Tue Aug 14 11:15:05 2018 (r337741) +++ stable/10/sys/dev/mlx5/vport.h Tue Aug 14 11:19:04 2018 (r337742) @@ -29,6 +29,13 @@ #define __MLX5_VPORT_H__ #include + +enum { + MLX5_CAP_INLINE_MODE_L2, + MLX5_CAP_INLINE_MODE_VPORT_CONTEXT, + MLX5_CAP_INLINE_MODE_NOT_REQUIRED, +}; + int mlx5_vport_alloc_q_counter(struct mlx5_core_dev *mdev, int client_id, u16 *counter_set_id); int mlx5_vport_dealloc_q_counter(struct mlx5_core_dev *mdev, int client_id, @@ -69,6 +76,11 @@ int mlx5_modify_nic_vport_mac_address(struct mlx5_core u16 vport, u8 mac[ETH_ALEN]); int mlx5_set_nic_vport_current_mac(struct mlx5_core_dev *mdev, int vport, bool other_vport, u8 *addr); +int mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev, + u16 vport, u8 *min_inline); +void mlx5_query_min_inline(struct mlx5_core_dev *mdev, u8 *min_inline); +int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev, + u16 vport, u8 min_inline); int mlx5_modify_nic_vport_port_guid(struct mlx5_core_dev *mdev, u32 vport, u64 port_guid); int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev, From owner-svn-src-all@freebsd.org Tue Aug 14 11:24: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 6E2291075080; Tue, 14 Aug 2018 11:24:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14FE98AD36; Tue, 14 Aug 2018 11:24:15 +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 E4A4B1AED5; Tue, 14 Aug 2018 11:24:14 +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 w7EBOE0Q025722; Tue, 14 Aug 2018 11:24:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EBOExD025720; Tue, 14 Aug 2018 11:24:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808141124.w7EBOExD025720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 14 Aug 2018 11:24:14 +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: r337743 - in stable/10/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Commit-Revision: 337743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:24:15 -0000 Author: hselasky Date: Tue Aug 14 11:24:14 2018 New Revision: 337743 URL: https://svnweb.freebsd.org/changeset/base/337743 Log: Enter error state when handling bad device in mlx5core and add checks for error state to mlx5en(4) to make live migration work. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_health.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Aug 14 11:19:04 2018 (r337742) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Aug 14 11:24:14 2018 (r337743) @@ -56,10 +56,13 @@ static void health_care(struct work_struct *work) priv = container_of(health, struct mlx5_priv, health); dev = container_of(priv, struct mlx5_core_dev, priv); mlx5_core_warn(dev, "handling bad device here\n"); - /* nothing yet */ + spin_lock_irq(&health_lock); list_del_init(&health->list); spin_unlock_irq(&health_lock); + + /* enter error state */ + mlx5_enter_error_state(dev); } } Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:19:04 2018 (r337742) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:24:14 2018 (r337743) @@ -921,8 +921,11 @@ mlx5e_close_rq(struct mlx5e_rq *rq) static void mlx5e_close_rq_wait(struct mlx5e_rq *rq) { + struct mlx5_core_dev *mdev = rq->channel->priv->mdev; + /* wait till RQ is empty */ - while (!mlx5_wq_ll_is_empty(&rq->wq)) { + while (!mlx5_wq_ll_is_empty(&rq->wq) && + (mdev->state != MLX5_DEVICE_STATE_INTERNAL_ERROR)) { msleep(4); rq->cq.mcq.comp(&rq->cq.mcq); } @@ -1264,6 +1267,7 @@ void mlx5e_drain_sq(struct mlx5e_sq *sq) { int error; + struct mlx5_core_dev *mdev = sq->priv->mdev; /* * Check if already stopped. @@ -1296,7 +1300,8 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) /* wait till SQ is empty or link is down */ mtx_lock(&sq->lock); while (sq->cc != sq->pc && - (sq->priv->media_status_last & IFM_ACTIVE) != 0) { + (sq->priv->media_status_last & IFM_ACTIVE) != 0 && + mdev->state != MLX5_DEVICE_STATE_INTERNAL_ERROR) { mtx_unlock(&sq->lock); msleep(1); sq->cq.mcq.comp(&sq->cq.mcq); @@ -1313,7 +1318,8 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) /* wait till SQ is empty */ mtx_lock(&sq->lock); - while (sq->cc != sq->pc) { + while (sq->cc != sq->pc && + mdev->state != MLX5_DEVICE_STATE_INTERNAL_ERROR) { mtx_unlock(&sq->lock); msleep(1); sq->cq.mcq.comp(&sq->cq.mcq); From owner-svn-src-all@freebsd.org Tue Aug 14 11:37: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 8C07310755DB; Tue, 14 Aug 2018 11:37:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DD308B2CE; Tue, 14 Aug 2018 11:37:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 199921B066; Tue, 14 Aug 2018 11:37:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EBb3Eb031065; Tue, 14 Aug 2018 11:37:03 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EBb3RU031064; Tue, 14 Aug 2018 11:37:03 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201808141137.w7EBb3RU031064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 14 Aug 2018 11:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337744 - vendor/libarchive/dist/libarchive X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: vendor/libarchive/dist/libarchive X-SVN-Commit-Revision: 337744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:37:04 -0000 Author: mm Date: Tue Aug 14 11:37:03 2018 New Revision: 337744 URL: https://svnweb.freebsd.org/changeset/base/337744 Log: Update vendor/libarchive/dist to git e6da40adb8ce566d906791b2a4083348bdd1e532 Important vendor changes: PR #1042: validate iso9660 directory record length Security: CVE-2017-14501 Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Tue Aug 14 11:24:14 2018 (r337743) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Tue Aug 14 11:37:03 2018 (r337744) @@ -409,7 +409,8 @@ static int next_entry_seek(struct archive_read *, stru struct file_info **); static struct file_info * parse_file_info(struct archive_read *a, - struct file_info *parent, const unsigned char *isodirrec); + struct file_info *parent, const unsigned char *isodirrec, + size_t reclen); static int parse_rockridge(struct archive_read *a, struct file_info *file, const unsigned char *start, const unsigned char *end); @@ -1022,7 +1023,7 @@ read_children(struct archive_read *a, struct file_info if (*(p + DR_name_len_offset) == 1 && *(p + DR_name_offset) == '\001') continue; - child = parse_file_info(a, parent, p); + child = parse_file_info(a, parent, p, b - p); if (child == NULL) { __archive_read_consume(a, skip_size); return (ARCHIVE_FATAL); @@ -1112,7 +1113,7 @@ choose_volume(struct archive_read *a, struct iso9660 * */ seenJoliet = iso9660->seenJoliet;/* Save flag. */ iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); + file = parse_file_info(a, NULL, block, vd->size); if (file == NULL) return (ARCHIVE_FATAL); iso9660->seenJoliet = seenJoliet; @@ -1144,7 +1145,7 @@ choose_volume(struct archive_read *a, struct iso9660 * return (ARCHIVE_FATAL); } iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); + file = parse_file_info(a, NULL, block, vd->size); if (file == NULL) return (ARCHIVE_FATAL); iso9660->seenJoliet = seenJoliet; @@ -1749,7 +1750,7 @@ archive_read_format_iso9660_cleanup(struct archive_rea */ static struct file_info * parse_file_info(struct archive_read *a, struct file_info *parent, - const unsigned char *isodirrec) + const unsigned char *isodirrec, size_t reclen) { struct iso9660 *iso9660; struct file_info *file, *filep; @@ -1763,16 +1764,20 @@ parse_file_info(struct archive_read *a, struct file_in iso9660 = (struct iso9660 *)(a->format->data); - dr_len = (size_t)isodirrec[DR_length_offset]; - name_len = (size_t)isodirrec[DR_name_len_offset]; - location = archive_le32dec(isodirrec + DR_extent_offset); - fsize = toi(isodirrec + DR_size_offset, DR_size_size); - /* Sanity check that dr_len needs at least 34. */ - if (dr_len < 34) { + if (reclen != 0) + dr_len = (size_t)isodirrec[DR_length_offset]; + /* + * Sanity check that reclen is not zero and dr_len is greater than + * reclen but at least 34 + */ + if (reclen == 0 || reclen < dr_len || dr_len < 34) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Invalid length of directory record"); + "Invalid length of directory record"); return (NULL); } + name_len = (size_t)isodirrec[DR_name_len_offset]; + location = archive_le32dec(isodirrec + DR_extent_offset); + fsize = toi(isodirrec + DR_size_offset, DR_size_size); /* Sanity check that name_len doesn't exceed dr_len. */ if (dr_len - 33 < name_len || name_len == 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, From owner-svn-src-all@freebsd.org Tue Aug 14 11:42: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 BB9561075907; Tue, 14 Aug 2018 11:42:33 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 706FB8B735; Tue, 14 Aug 2018 11:42:33 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52F481B20B; Tue, 14 Aug 2018 11:42:33 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EBgXi7035782; Tue, 14 Aug 2018 11:42:33 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EBgXfU035781; Tue, 14 Aug 2018 11:42:33 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201808141142.w7EBgXfU035781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 14 Aug 2018 11:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337745 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 337745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:42:34 -0000 Author: mm Date: Tue Aug 14 11:42:32 2018 New Revision: 337745 URL: https://svnweb.freebsd.org/changeset/base/337745 Log: MFV r337744: Sync libarchive with vendor.. Vendor changes: PR #1042: validate iso9660 directory record length MFC after: 3 days Security: CVE-2017-14501 Modified: head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Tue Aug 14 11:37:03 2018 (r337744) +++ head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Tue Aug 14 11:42:32 2018 (r337745) @@ -409,7 +409,8 @@ static int next_entry_seek(struct archive_read *, stru struct file_info **); static struct file_info * parse_file_info(struct archive_read *a, - struct file_info *parent, const unsigned char *isodirrec); + struct file_info *parent, const unsigned char *isodirrec, + size_t reclen); static int parse_rockridge(struct archive_read *a, struct file_info *file, const unsigned char *start, const unsigned char *end); @@ -1022,7 +1023,7 @@ read_children(struct archive_read *a, struct file_info if (*(p + DR_name_len_offset) == 1 && *(p + DR_name_offset) == '\001') continue; - child = parse_file_info(a, parent, p); + child = parse_file_info(a, parent, p, b - p); if (child == NULL) { __archive_read_consume(a, skip_size); return (ARCHIVE_FATAL); @@ -1112,7 +1113,7 @@ choose_volume(struct archive_read *a, struct iso9660 * */ seenJoliet = iso9660->seenJoliet;/* Save flag. */ iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); + file = parse_file_info(a, NULL, block, vd->size); if (file == NULL) return (ARCHIVE_FATAL); iso9660->seenJoliet = seenJoliet; @@ -1144,7 +1145,7 @@ choose_volume(struct archive_read *a, struct iso9660 * return (ARCHIVE_FATAL); } iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); + file = parse_file_info(a, NULL, block, vd->size); if (file == NULL) return (ARCHIVE_FATAL); iso9660->seenJoliet = seenJoliet; @@ -1749,7 +1750,7 @@ archive_read_format_iso9660_cleanup(struct archive_rea */ static struct file_info * parse_file_info(struct archive_read *a, struct file_info *parent, - const unsigned char *isodirrec) + const unsigned char *isodirrec, size_t reclen) { struct iso9660 *iso9660; struct file_info *file, *filep; @@ -1763,16 +1764,20 @@ parse_file_info(struct archive_read *a, struct file_in iso9660 = (struct iso9660 *)(a->format->data); - dr_len = (size_t)isodirrec[DR_length_offset]; - name_len = (size_t)isodirrec[DR_name_len_offset]; - location = archive_le32dec(isodirrec + DR_extent_offset); - fsize = toi(isodirrec + DR_size_offset, DR_size_size); - /* Sanity check that dr_len needs at least 34. */ - if (dr_len < 34) { + if (reclen != 0) + dr_len = (size_t)isodirrec[DR_length_offset]; + /* + * Sanity check that reclen is not zero and dr_len is greater than + * reclen but at least 34 + */ + if (reclen == 0 || reclen < dr_len || dr_len < 34) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Invalid length of directory record"); + "Invalid length of directory record"); return (NULL); } + name_len = (size_t)isodirrec[DR_name_len_offset]; + location = archive_le32dec(isodirrec + DR_extent_offset); + fsize = toi(isodirrec + DR_size_offset, DR_size_size); /* Sanity check that name_len doesn't exceed dr_len. */ if (dr_len - 33 < name_len || name_len == 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, From owner-svn-src-all@freebsd.org Tue Aug 14 11:43: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 7D54F107593C; Tue, 14 Aug 2018 11:43:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33E2E8B84B; Tue, 14 Aug 2018 11:43:03 +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 14E631B20D; Tue, 14 Aug 2018 11:43:03 +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 w7EBh2Zx035850; Tue, 14 Aug 2018 11:43:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EBh2Ml035847; Tue, 14 Aug 2018 11:43:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808141143.w7EBh2Ml035847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 14 Aug 2018 11:43: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: r337746 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 337746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:43:03 -0000 Author: hselasky Date: Tue Aug 14 11:43:02 2018 New Revision: 337746 URL: https://svnweb.freebsd.org/changeset/base/337746 Log: MFC r325661: Expose the current hardware MTU in mlx5en(4) as a separate entry in the sysctl tree. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Tue Aug 14 11:42:32 2018 (r337745) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Tue Aug 14 11:43:02 2018 (r337746) @@ -428,7 +428,8 @@ struct mlx5e_params { m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") \ m(+1, u64 diag_pci_enable, "diag_pci_enable", "0: Disabled 1: Enabled") \ - m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") + m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") \ + m(+1, u64 hw_mtu, "hw_mtu", "Current hardware MTU value") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Tue Aug 14 11:42:32 2018 (r337745) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Tue Aug 14 11:43:02 2018 (r337746) @@ -714,7 +714,8 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) return; for (x = 0; x != MLX5E_PARAMS_NUM; x++) { /* check for read-only parameter */ - if (strstr(mlx5e_params_desc[2 * x], "_max") != NULL) { + if (strstr(mlx5e_params_desc[2 * x], "_max") != NULL || + strstr(mlx5e_params_desc[2 * x], "_mtu") != NULL) { SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, mlx5e_params_desc[2 * x], CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, priv, x, &mlx5e_ethtool_handler, "QU", Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:42:32 2018 (r337745) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:43:02 2018 (r337746) @@ -2353,10 +2353,13 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) __func__, sw_mtu, err); return (err); } + + ifp->if_mtu = sw_mtu; err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); if (err) { if_printf(ifp, "Query port MTU, after setting new " "MTU value, failed\n"); + return (err); } else if (MLX5E_HW2SW_MTU(hw_mtu) < sw_mtu) { err = -E2BIG, if_printf(ifp, "Port MTU %d is smaller than " @@ -2366,7 +2369,8 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) if_printf(ifp, "Port MTU %d is bigger than " "ifp mtu %d\n", hw_mtu, sw_mtu); } - ifp->if_mtu = sw_mtu; + priv->params_ethtool.hw_mtu = hw_mtu; + return (err); } From owner-svn-src-all@freebsd.org Tue Aug 14 11:44: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 6115110759CE; Tue, 14 Aug 2018 11:44:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 175738B9B2; Tue, 14 Aug 2018 11:44:12 +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 ED6861B20E; Tue, 14 Aug 2018 11:44:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EBiBwZ035978; Tue, 14 Aug 2018 11:44:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EBiBqG035977; Tue, 14 Aug 2018 11:44:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808141144.w7EBiBqG035977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 14 Aug 2018 11:44: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: r337747 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 337747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:44:12 -0000 Author: hselasky Date: Tue Aug 14 11:44:11 2018 New Revision: 337747 URL: https://svnweb.freebsd.org/changeset/base/337747 Log: MFC r330657: Use vport rather than physical-port MTU in mlx5en(4). Set and report vport MTU rather than physical MTU, The driver will set both vport and physical port mtu and will rely on the query of vport mtu. SRIOV VFs have to report their MTU to their vport manager (PF), and this will allow them to work with any MTU they need without failing the request. Also for some cases where the PF is not a port owner, PF can work with MTU less than the physical port mtu if set physical port mtu didn't take effect. Based on Linux upstream commit: cd255efff9baadd654d6160e52d17ae7c568c9d3 Submitted by: Meny Yossefi Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:43:02 2018 (r337746) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:44:11 2018 (r337747) @@ -2347,15 +2347,29 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) int hw_mtu; int err; - err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); + hw_mtu = MLX5E_SW2HW_MTU(sw_mtu); + + err = mlx5_set_port_mtu(mdev, hw_mtu); if (err) { if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", __func__, sw_mtu, err); return (err); } + /* Update vport context MTU */ + err = mlx5_set_vport_mtu(mdev, hw_mtu); + if (err) { + if_printf(ifp, "%s: Failed updating vport context with MTU size, err=%d\n", + __func__, err); + } + ifp->if_mtu = sw_mtu; - err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); + + err = mlx5_query_vport_mtu(mdev, &hw_mtu); + if (err || !hw_mtu) { + /* fallback to port oper mtu */ + err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); + } if (err) { if_printf(ifp, "Query port MTU, after setting new " "MTU value, failed\n"); From owner-svn-src-all@freebsd.org Tue Aug 14 11:52: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 116331075BF3; Tue, 14 Aug 2018 11:52:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2C858BD90; Tue, 14 Aug 2018 11:52:06 +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 951951B36C; Tue, 14 Aug 2018 11:52:06 +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 w7EBq67d037736; Tue, 14 Aug 2018 11:52:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EBq66J037734; Tue, 14 Aug 2018 11:52:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808141152.w7EBq66J037734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 14 Aug 2018 11:52:06 +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: r337748 - in stable/10/sys/dev/mlx5: mlx5_core mlx5_en mlx5_ib X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: mlx5_core mlx5_en mlx5_ib X-SVN-Commit-Revision: 337748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 11:52:07 -0000 Author: hselasky Date: Tue Aug 14 11:52:05 2018 New Revision: 337748 URL: https://svnweb.freebsd.org/changeset/base/337748 Log: Bump the mlx5core, mlx5en(4) and mlx5ib driver version. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_core.h Tue Aug 14 11:44:11 2018 (r337747) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_core.h Tue Aug 14 11:52:05 2018 (r337748) @@ -33,8 +33,8 @@ #include #define DRIVER_NAME "mlx5_core" -#define DRIVER_VERSION "1.23.0 (03 Mar 2015)" -#define DRIVER_RELDATE "03 Mar 2015" +#define DRIVER_VERSION "3.2.1" +#define DRIVER_RELDATE "August 2018" extern int mlx5_core_debug_mask; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:44:11 2018 (r337747) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Aug 14 11:52:05 2018 (r337748) @@ -30,7 +30,7 @@ #include #include -#define ETH_DRIVER_VERSION "3.1.0-dev" +#define ETH_DRIVER_VERSION "3.2.1" char mlx5e_version[] = "Mellanox Ethernet driver" " (" ETH_DRIVER_VERSION ")"; Modified: stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Tue Aug 14 11:44:11 2018 (r337747) +++ stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Tue Aug 14 11:52:05 2018 (r337748) @@ -50,8 +50,8 @@ #include #define DRIVER_NAME "mlx5_ib" -#define DRIVER_VERSION "3.2-rc1" -#define DRIVER_RELDATE "May 2016" +#define DRIVER_VERSION "3.2.1" +#define DRIVER_RELDATE "August 2018" #undef MODULE_VERSION #include From owner-svn-src-all@freebsd.org Tue Aug 14 12:57:17 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 5857A1077A00; Tue, 14 Aug 2018 12:57:17 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC22F8DCF9; Tue, 14 Aug 2018 12:57:16 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 6C9D0270040A; Tue, 14 Aug 2018 08:57:09 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 6C9D0270040A Authentication-Results: duke.cs.duke.edu; dmarc=none header.from=cs.duke.edu DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1534251429; bh=mRmD7TFDxqN7WaritmBTsip3hcbQUQKxAchDxHISB3E=; h=Subject:To:From:Date:From; b=OsGhULrZzy9nWzfdE2O9G/myJ0T+lEN4ikNcWaRplGJlCUfydGHyp+khWFEZ5cxte c0T6hBe/AleXtppVDkKKun8tsrXXrsMEj3INnOQ/Ux4lloZXanpyaZx6s+RZ2EWbKm OkFVWsDqpR2YetszKtnVry7uJ2CeETwRvDkFcTRMUqrRKLjVp+4dFUhJnq16sU3RhA +y9UC2U9hCNkrBEGTBSK1k0eLTlyjAxi0u6upNnFgMAtoQkkIo8FVIwXgdSKO0rGrT XtAdGcQKcECFWMhScpsNJ4LFOyxSEMtwHHP0+GLO9qdzoXL6NSP/o9u98SgtQUllQt 1N/thuUhQxbcQ== Subject: Re: svn commit: r337709 - head/sys/net To: koobs@FreeBSD.org, Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808131413.w7DEDQFr049135@repo.freebsd.org> From: Andrew Gallatin Message-ID: <1aa4cbd4-e241-1ad3-7a12-f29d536bc83a@cs.duke.edu> Date: Tue, 14 Aug 2018 08:57:08 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 12:57:17 -0000 It could probably be MFCed if somebody could verify that it causes no harm in 11. I have no way to test lagg/lacp on 11, so I did not mark it for MFC. Drew On 8/13/18 9:58 PM, Kubilay Kocak wrote: > On 14/08/2018 12:13 am, Andrew Gallatin wrote: >> Author: gallatin >> Date: Mon Aug 13 14:13:25 2018 >> New Revision: 337709 >> URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_337709&d=DwICaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=1cWDZxkgrPXh1V368in81GXeCx7nVoSbXY9khM0W2r0&s=psymcTlMReu-E0h72SEySpgbsxzW7KxTwtQDKS8ocBY&e= >> >> Log: >> lagg: allow lacp to manage the link state >> >> Lacp needs to manage the link state itself. Unlike other >> lagg protocols, the ability of lacp to pass traffic >> depends not only on the lagg members having link, but also >> on the lacp protocol converging to a distributing state with the >> link partner. >> >> If we prematurely mark the link as up, then we will send a >> gratuitous arp (via arp_handle_ifllchange()) before the lacp >> interface is capable of passing traffic. When this happens, >> the gratuitous arp is lost, and our link partner may cache >> a stale mac address (eg, when the base mac address for the >> lagg bundle changes, due to a BIOS change re-ordering NIC >> unit numbers) > > Hi Andrew > > Can this be MFC'd? > >> Reviewed by: jtl, hselasky >> Sponsored by: Netflix >> >> Modified: >> head/sys/net/ieee8023ad_lacp.c >> head/sys/net/if_lagg.c >> >> Modified: head/sys/net/ieee8023ad_lacp.c >> ============================================================================== >> --- head/sys/net/ieee8023ad_lacp.c Mon Aug 13 13:58:45 2018 (r337708) >> +++ head/sys/net/ieee8023ad_lacp.c Mon Aug 13 14:13:25 2018 (r337709) >> @@ -711,6 +711,8 @@ lacp_disable_distributing(struct lacp_port *lp) >> } >> >> lp->lp_state &= ~LACP_STATE_DISTRIBUTING; >> + if_link_state_change(sc->sc_ifp, >> + sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN); >> } >> >> static void >> @@ -745,6 +747,9 @@ lacp_enable_distributing(struct lacp_port *lp) >> } else >> /* try to become the active aggregator */ >> lacp_select_active_aggregator(lsc); >> + >> + if_link_state_change(sc->sc_ifp, >> + sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN); >> } >> >> static void >> >> Modified: head/sys/net/if_lagg.c >> ============================================================================== >> --- head/sys/net/if_lagg.c Mon Aug 13 13:58:45 2018 (r337708) >> +++ head/sys/net/if_lagg.c Mon Aug 13 14:13:25 2018 (r337709) >> @@ -1737,6 +1737,10 @@ lagg_linkstate(struct lagg_softc *sc) >> >> LAGG_XLOCK_ASSERT(sc); >> >> + /* LACP handles link state itself */ >> + if (sc->sc_proto == LAGG_PROTO_LACP) >> + return; >> + >> /* Our link is considered up if at least one of our ports is active */ >> LAGG_RLOCK(); >> CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freebsd.org_mailman_listinfo_svn-2Dsrc-2Dhead&d=DwICaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=1cWDZxkgrPXh1V368in81GXeCx7nVoSbXY9khM0W2r0&s=SLnmQNpAX0j6HgJ5_yIcrQJAf9xCWtNqoEJ2qbOy7_E&e= >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >> From owner-svn-src-all@freebsd.org Tue Aug 14 13:52:09 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 79C6A1078875; Tue, 14 Aug 2018 13:52:09 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 221508F621; Tue, 14 Aug 2018 13:52:09 +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 04D3A1C6F7; Tue, 14 Aug 2018 13:52:09 +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 w7EDq8CY001910; Tue, 14 Aug 2018 13:52:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EDq8nP001909; Tue, 14 Aug 2018 13:52:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808141352.w7EDq8nP001909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 14 Aug 2018 13:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337749 - head/usr.sbin/autofs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/autofs X-SVN-Commit-Revision: 337749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 13:52:09 -0000 Author: trasz Date: Tue Aug 14 13:52:08 2018 New Revision: 337749 URL: https://svnweb.freebsd.org/changeset/base/337749 Log: Add the "autoro" flag to /media. This makes it attempt to mount it read-only instead of just failing if the media is write-protected. The /net doesn't seem to require the flag. MFC after: 2 weeks Relnotes: yes Sponsored by: DARPA, AFRL Modified: head/usr.sbin/autofs/auto_master Modified: head/usr.sbin/autofs/auto_master ============================================================================== --- head/usr.sbin/autofs/auto_master Tue Aug 14 11:52:05 2018 (r337748) +++ head/usr.sbin/autofs/auto_master Tue Aug 14 13:52:08 2018 (r337749) @@ -5,5 +5,5 @@ /net -hosts -nobrowse,nosuid,intr # When using the -media special map, make sure to edit devd.conf(5) # to move the call to "automount -c" out of the comments section. -#/media -media -nosuid,noatime +#/media -media -nosuid,noatime,autoro #/- -noauto From owner-svn-src-all@freebsd.org Tue Aug 14 13:52: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 96310107898A; Tue, 14 Aug 2018 13:52:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9E08F62A; Tue, 14 Aug 2018 13:52:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 162791C6FB; Tue, 14 Aug 2018 13:52:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EDqAoP001955; Tue, 14 Aug 2018 13:52:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EDqA6F001954; Tue, 14 Aug 2018 13:52:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808141352.w7EDqA6F001954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 14 Aug 2018 13:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337750 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 337750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 13:52:11 -0000 Author: imp Date: Tue Aug 14 13:52:10 2018 New Revision: 337750 URL: https://svnweb.freebsd.org/changeset/base/337750 Log: Add good description of init and lock devices from sio to uart. Modified: head/share/man/man4/uart.4 Modified: head/share/man/man4/uart.4 ============================================================================== --- head/share/man/man4/uart.4 Tue Aug 14 13:52:08 2018 (r337749) +++ head/share/man/man4/uart.4 Tue Aug 14 13:52:10 2018 (r337750) @@ -225,6 +225,52 @@ Generally speaking, a connection to a DB-9 style conne level signal at up to 12 volts. A connection to header pins or an edge-connector on an embedded board is typically a TTL signal at 3.3 or 5 volts. +.Sh Special Devices +The +.Nm +driver also supports an initial-state and a lock-state control +device for each of the callin and the callout "data" devices. +The termios settings of a data device are copied +from those of the corresponding initial-state device +on first opens and are not inherited from previous opens. +Use +.Xr stty 1 +in the normal way on the initial-state devices to program +initial termios states suitable for your setup. +.Pp +The lock termios state acts as flags to disable changing +the termios state. +E.g., to lock a flag variable such as CRTSCTS, use +.Em stty crtscts +on the lock-state device. +Speeds and special characters +may be locked by setting the corresponding value in the lock-state +device to any nonzero value. +E.g., to lock a speed to 115200, use +.Dq Li stty 115200 +on the initial-state device and +.Dq Li stty 1 +on the lock-state device. +.Pp +Correct programs talking to correctly wired external devices +work with almost arbitrary initial states and almost no locking, +but other setups may benefit from changing some of the default +initial state and locking the state. +In particular, the initial states for non (POSIX) standard flags +should be set to suit the devices attached and may need to be +locked to prevent buggy programs from changing them. +E.g., CRTSCTS should be locked on for devices that support +RTS/CTS handshaking at all times and off for devices that do not +support it at all. +CLOCAL should be locked on for devices that do not support carrier. +HUPCL may be locked off if you do not +want to hang up for some reason. +In general, very bad things happen +if something is locked to the wrong state, and things should not +be locked for devices that support more than one setting. +The CLOCAL flag on callin ports should be locked off for logins +to avoid certain security holes, but this needs to be done by +getty if the callin port is used for anything else. .Sh FILES .Bl -tag -width "/dev/ttyu?.init" -compact .It Pa /dev/ttyu? From owner-svn-src-all@freebsd.org Tue Aug 14 13:56: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 63A8E1078C19; Tue, 14 Aug 2018 13:56:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13EAD8FC44; Tue, 14 Aug 2018 13:56:43 +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 E4D891C710; Tue, 14 Aug 2018 13:56:42 +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 w7EDugDC002203; Tue, 14 Aug 2018 13:56:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EDugtV002202; Tue, 14 Aug 2018 13:56:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808141356.w7EDugtV002202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Aug 2018 13:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337751 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 337751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 13:56:43 -0000 Author: markj Date: Tue Aug 14 13:56:42 2018 New Revision: 337751 URL: https://svnweb.freebsd.org/changeset/base/337751 Log: Fix the !SMP x86 build. Reported by: Michael Butler X-MFC with: r337715 Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/ucode.c Modified: head/sys/x86/x86/ucode.c ============================================================================== --- head/sys/x86/x86/ucode.c Tue Aug 14 13:52:10 2018 (r337750) +++ head/sys/x86/x86/ucode.c Tue Aug 14 13:56:42 2018 (r337751) @@ -255,11 +255,15 @@ SYSINIT(ucode_release, SI_SUB_KMEM + 1, SI_ORDER_ANY, void ucode_load_ap(int cpu) { - +#ifdef SMP KASSERT(cpu_info[cpu_apic_ids[cpu]].cpu_present, ("cpu %d not present", cpu)); - if (ucode_data != NULL && !cpu_info[cpu_apic_ids[cpu]].cpu_hyperthread) + if (!cpu_info[cpu_apic_ids[cpu]].cpu_hyperthread) + return; +#endif + + if (ucode_data != NULL) (void)ucode_intel_load(ucode_data, false); } From owner-svn-src-all@freebsd.org Tue Aug 14 13:56: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 CD09D1078C5F; Tue, 14 Aug 2018 13:56:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5205F8FD41; Tue, 14 Aug 2018 13:56:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 315F21C711; Tue, 14 Aug 2018 13:56:50 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EDunD0002263; Tue, 14 Aug 2018 13:56:49 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EDunUn002260; Tue, 14 Aug 2018 13:56:49 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808141356.w7EDunUn002260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 14 Aug 2018 13:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337752 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 337752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 13:56:52 -0000 Author: loos Date: Tue Aug 14 13:56:49 2018 New Revision: 337752 URL: https://svnweb.freebsd.org/changeset/base/337752 Log: Fix a typo on the PSCI smc call wrapper. Looks good from: andrew Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/psci/psci_arm.S head/sys/dev/psci/psci_arm64.S Modified: head/sys/dev/psci/psci_arm.S ============================================================================== --- head/sys/dev/psci/psci_arm.S Tue Aug 14 13:56:42 2018 (r337751) +++ head/sys/dev/psci/psci_arm.S Tue Aug 14 13:56:49 2018 (r337752) @@ -45,4 +45,4 @@ END(psci_hvc_despatch) ENTRY(psci_smc_despatch) smc #0 RET -END(psci_hvc_despatch) +END(psci_smc_despatch) Modified: head/sys/dev/psci/psci_arm64.S ============================================================================== --- head/sys/dev/psci/psci_arm64.S Tue Aug 14 13:56:42 2018 (r337751) +++ head/sys/dev/psci/psci_arm64.S Tue Aug 14 13:56:49 2018 (r337752) @@ -46,4 +46,4 @@ END(psci_hvc_despatch) ENTRY(psci_smc_despatch) smc #0 ret -END(psci_hvc_despatch) +END(psci_smc_despatch) From owner-svn-src-all@freebsd.org Tue Aug 14 13:59: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 467761078E25 for ; Tue, 14 Aug 2018 13:59:07 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BEAC70037 for ; Tue, 14 Aug 2018 13:59:06 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 309d5c47-9fca-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 309d5c47-9fca-11e8-93fa-f3ebd9db2b94; Tue, 14 Aug 2018 13:58:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7EDwvBs071755; Tue, 14 Aug 2018 07:58:57 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534255137.31375.121.camel@freebsd.org> Subject: Re: svn commit: r337750 - head/share/man/man4 From: Ian Lepore To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 14 Aug 2018 07:58:57 -0600 In-Reply-To: <201808141352.w7EDqA6F001954@repo.freebsd.org> References: <201808141352.w7EDqA6F001954@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 13:59:08 -0000 On Tue, 2018-08-14 at 13:52 +0000, Warner Losh wrote: > Author: imp > Date: Tue Aug 14 13:52:10 2018 > New Revision: 337750 > URL: https://svnweb.freebsd.org/changeset/base/337750 > > Log: >   Add good description of init and lock devices from sio to uart. > > Modified: >   head/share/man/man4/uart.4 > > Modified: head/share/man/man4/uart.4 > ===================================================================== > ========= > --- head/share/man/man4/uart.4 Tue Aug 14 13:52:08 2018 > (r337749) > +++ head/share/man/man4/uart.4 Tue Aug 14 13:52:10 2018 > (r337750) > @@ -225,6 +225,52 @@ Generally speaking, a connection to a DB-9 style > conne >  level signal at up to 12 volts. >  A connection to header pins or an edge-connector on an embedded > board >  is typically a TTL signal at 3.3 or 5 volts. > +.Sh Special Devices > +The > +.Nm > +driver also supports an initial-state and a lock-state control > +device for each of the callin and the callout "data" devices. > +The termios settings of a data device are copied > +from those of the corresponding initial-state device > +on first opens and are not inherited from previous opens. > +Use > +.Xr stty 1 > +in the normal way on the initial-state devices to program > +initial termios states suitable for your setup. > +.Pp > +The lock termios state acts as flags to disable changing > +the termios state. > +E.g., to lock a flag variable such as CRTSCTS, use > +.Em stty crtscts > +on the lock-state device. > +Speeds and special characters > +may be locked by setting the corresponding value in the lock-state > +device to any nonzero value. > +E.g., to lock a speed to 115200, use > +.Dq Li stty 115200 > +on the initial-state device and > +.Dq Li stty 1 > +on the lock-state device. > +.Pp > +Correct programs talking to correctly wired external devices > +work with almost arbitrary initial states and almost no locking, > +but other setups may benefit from changing some of the default > +initial state and locking the state. > +In particular, the initial states for non (POSIX) standard flags > +should be set to suit the devices attached and may need to be > +locked to prevent buggy programs from changing them. > +E.g., CRTSCTS should be locked on for devices that support > +RTS/CTS handshaking at all times and off for devices that do not > +support it at all. > +CLOCAL should be locked on for devices that do not support carrier. > +HUPCL may be locked off if you do not > +want to hang up for some reason. > +In general, very bad things happen > +if something is locked to the wrong state, and things should not > +be locked for devices that support more than one setting. > +The CLOCAL flag on callin ports should be locked off for logins > +to avoid certain security holes, but this needs to be done by > +getty if the callin port is used for anything else. >  .Sh FILES >  .Bl -tag -width "/dev/ttyu?.init" -compact >  .It Pa /dev/ttyu? > Now they're documented together with a different single driver of many that supports the feature. This is implemented in the tty layer and applies to all serial drivers, shouldn't it be documented in tty(4)? -- Ian From owner-svn-src-all@freebsd.org Tue Aug 14 14:01: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 C65E2107907D; Tue, 14 Aug 2018 14:01:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79EE7704E4; Tue, 14 Aug 2018 14:01:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C88C1C752; Tue, 14 Aug 2018 14:01:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EE1DW8004305; Tue, 14 Aug 2018 14:01:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EE1D1P004300; Tue, 14 Aug 2018 14:01:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808141401.w7EE1D1P004300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Aug 2018 14:01:13 +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: r337753 - 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: 337753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 14:01:14 -0000 Author: kib Date: Tue Aug 14 14:01:12 2018 New Revision: 337753 URL: https://svnweb.freebsd.org/changeset/base/337753 Log: MFC r337430, r337436: Add missed handling of local relocs against ifunc target in the obj modules. Modified: stable/11/sys/kern/link_elf_obj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/link_elf_obj.c ============================================================================== --- stable/11/sys/kern/link_elf_obj.c Tue Aug 14 13:56:49 2018 (r337752) +++ stable/11/sys/kern/link_elf_obj.c Tue Aug 14 14:01:12 2018 (r337753) @@ -140,7 +140,7 @@ static int link_elf_each_function_name(linker_file_t, static int link_elf_each_function_nameval(linker_file_t, linker_function_nameval_callback_t, void *); -static int link_elf_reloc_local(linker_file_t); +static int link_elf_reloc_local(linker_file_t, bool); static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); @@ -439,10 +439,9 @@ link_elf_link_preload(linker_class_t cls, const char * } /* Local intra-module relocations */ - error = link_elf_reloc_local(lf); + error = link_elf_reloc_local(lf, false); if (error != 0) goto out; - *result = lf; return (0); @@ -477,13 +476,20 @@ link_elf_link_preload_finish(linker_file_t lf) ef = (elf_file_t)lf; error = relocate_file(ef); if (error) - return error; + return (error); /* Notify MD code that a module is being loaded. */ error = elf_cpu_load_file(lf); if (error) return (error); +#if defined(__i386__) || defined(__amd64__) + /* Now ifuncs. */ + error = link_elf_reloc_local(lf, true); + if (error != 0) + return (error); +#endif + /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); return (0); @@ -962,7 +968,7 @@ link_elf_load_file(linker_class_t cls, const char *fil } /* Local intra-module relocations */ - error = link_elf_reloc_local(lf); + error = link_elf_reloc_local(lf, false); if (error != 0) goto out; @@ -983,6 +989,13 @@ link_elf_load_file(linker_class_t cls, const char *fil if (error) goto out; +#if defined(__i386__) || defined(__amd64__) + /* Now ifuncs. */ + error = link_elf_reloc_local(lf, true); + if (error != 0) + goto out; +#endif + /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); @@ -1366,7 +1379,10 @@ elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int /* Quick answer if there is a definition included. */ if (sym->st_shndx != SHN_UNDEF) { - *res = sym->st_value; + res1 = (Elf_Addr)sym->st_value; + if (ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) + res1 = ((Elf_Addr (*)(void))res1)(); + *res = res1; return (0); } @@ -1462,7 +1478,7 @@ link_elf_fix_link_set(elf_file_t ef) } static int -link_elf_reloc_local(linker_file_t lf) +link_elf_reloc_local(linker_file_t lf, bool ifuncs) { elf_file_t ef = (elf_file_t)lf; const Elf_Rel *rellim; @@ -1497,8 +1513,15 @@ link_elf_reloc_local(linker_file_t lf) /* Only do local relocs */ if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; - elf_reloc_local(lf, base, rel, ELF_RELOC_REL, - elf_obj_lookup); + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) == + ifuncs) + elf_reloc_local(lf, base, rel, ELF_RELOC_REL, + elf_obj_lookup); +#if defined(__i386__) || defined(__amd64__) + else if (ifuncs) + elf_reloc_ifunc(lf, base, rel, ELF_RELOC_REL, + elf_obj_lookup); +#endif } } @@ -1523,8 +1546,15 @@ link_elf_reloc_local(linker_file_t lf) /* Only do local relocs */ if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; - elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, - elf_obj_lookup); + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) == + ifuncs) + elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, + elf_obj_lookup); +#if defined(__i386__) || defined(__amd64__) + else if (ifuncs) + elf_reloc_ifunc(lf, base, rela, ELF_RELOC_RELA, + elf_obj_lookup); +#endif } } return (0); From owner-svn-src-all@freebsd.org Tue Aug 14 14:02:55 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 EC6B010792EF; Tue, 14 Aug 2018 14:02: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 908437085F; Tue, 14 Aug 2018 14:02: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 71C3C1C8B1; Tue, 14 Aug 2018 14:02: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 w7EE2sGG007726; Tue, 14 Aug 2018 14:02:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EE2seW007725; Tue, 14 Aug 2018 14:02:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808141402.w7EE2seW007725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Aug 2018 14:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337754 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 337754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 14:02:55 -0000 Author: markj Date: Tue Aug 14 14:02:53 2018 New Revision: 337754 URL: https://svnweb.freebsd.org/changeset/base/337754 Log: Don't use memcpy() in the early microcode loading code. At some point memcpy() may be an ifunc, ifunc resolution cannot be done until CPU identification has been performed, and CPU identification must be done after loading any microcode updates. X-MFC with: r337715 Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/ucode.c Modified: head/sys/x86/x86/ucode.c ============================================================================== --- head/sys/x86/x86/ucode.c Tue Aug 14 14:01:12 2018 (r337753) +++ head/sys/x86/x86/ucode.c Tue Aug 14 14:02:53 2018 (r337754) @@ -312,8 +312,7 @@ ucode_load_bsp(uintptr_t free) uint8_t *addr, *fileaddr, *match; char *type; caddr_t file; - size_t len, ucode_len; - int i; + size_t i, len, ucode_len; KASSERT(free % PAGE_SIZE == 0, ("unaligned boundary %p", (void *)free)); @@ -345,7 +344,8 @@ ucode_load_bsp(uintptr_t free) match = loader->match(fileaddr, &len); if (match != NULL) { addr = map_ucode(free, len); - memcpy(addr, match, len); + for (i = 0; i < len; i++) + addr[i] = match[i]; match = addr; if (loader->load(match, false) == 0) { From owner-svn-src-all@freebsd.org Tue Aug 14 14:17:22 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 05CE910797B3; Tue, 14 Aug 2018 14:17: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE7D271189; Tue, 14 Aug 2018 14:17: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 8B3C71CA6B; Tue, 14 Aug 2018 14:17: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 w7EEHL9x013431; Tue, 14 Aug 2018 14:17:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EEHLCF013430; Tue, 14 Aug 2018 14:17:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808141417.w7EEHLCF013430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Aug 2018 14:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337755 - stable/11/sys/dev/mii X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/dev/mii X-SVN-Commit-Revision: 337755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 14:17:22 -0000 Author: markj Date: Tue Aug 14 14:17:20 2018 New Revision: 337755 URL: https://svnweb.freebsd.org/changeset/base/337755 Log: MFC r337425: Recognize ICS1893C PHYs. Modified: stable/11/sys/dev/mii/icsphy.c stable/11/sys/dev/mii/miidevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mii/icsphy.c ============================================================================== --- stable/11/sys/dev/mii/icsphy.c Tue Aug 14 14:02:53 2018 (r337754) +++ stable/11/sys/dev/mii/icsphy.c Tue Aug 14 14:17:20 2018 (r337755) @@ -111,6 +111,7 @@ static const struct mii_phydesc icsphys[] = { MII_PHY_DESC(ICS, 1890), MII_PHY_DESC(ICS, 1892), MII_PHY_DESC(ICS, 1893), + MII_PHY_DESC(ICS, 1893C), MII_PHY_END }; Modified: stable/11/sys/dev/mii/miidevs ============================================================================== --- stable/11/sys/dev/mii/miidevs Tue Aug 14 14:02:53 2018 (r337754) +++ stable/11/sys/dev/mii/miidevs Tue Aug 14 14:17:20 2018 (r337755) @@ -224,6 +224,7 @@ model ICS 1889 0x0001 ICS1889 10/100 media interface model ICS 1890 0x0002 ICS1890 10/100 media interface model ICS 1892 0x0003 ICS1892 10/100 media interface model ICS 1893 0x0004 ICS1893 10/100 media interface +model ICS 1893C 0x0005 ICS1893C 10/100 media interface /* Intel Corporation PHYs */ model xxINTEL I82553 0x0000 i82553 10/100 media interface From owner-svn-src-all@freebsd.org Tue Aug 14 14:17:56 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 C36611079807; Tue, 14 Aug 2018 14:17: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7718F712B3; Tue, 14 Aug 2018 14:17:56 +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 5847F1CA6D; Tue, 14 Aug 2018 14:17:56 +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 w7EEHu5o013508; Tue, 14 Aug 2018 14:17:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EEHuWR013507; Tue, 14 Aug 2018 14:17:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808141417.w7EEHuWR013507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Aug 2018 14:17: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: r337756 - stable/11/sbin/ifconfig X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sbin/ifconfig X-SVN-Commit-Revision: 337756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 14:17:56 -0000 Author: markj Date: Tue Aug 14 14:17:55 2018 New Revision: 337756 URL: https://svnweb.freebsd.org/changeset/base/337756 Log: MFC r337426: ifconfig: Fix use of _Noreturn Modified: stable/11/sbin/ifconfig/ifconfig.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/11/sbin/ifconfig/ifconfig.c Tue Aug 14 14:17:20 2018 (r337755) +++ stable/11/sbin/ifconfig/ifconfig.c Tue Aug 14 14:17:55 2018 (r337756) @@ -106,7 +106,7 @@ static int ifconfig(int argc, char *const *argv, int i static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, struct ifaddrs *ifa); static void tunnel_status(int s); -static void usage(void) _Noreturn; +static _Noreturn void usage(void); static struct afswtch *af_getbyname(const char *name); static struct afswtch *af_getbyfamily(int af); From owner-svn-src-all@freebsd.org Tue Aug 14 14:19: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 E1ABD1079920; Tue, 14 Aug 2018 14:19: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96CEC71539; Tue, 14 Aug 2018 14:19: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 77E5D1CA6F; Tue, 14 Aug 2018 14:19: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 w7EEJvgO013650; Tue, 14 Aug 2018 14:19:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EEJvEI013649; Tue, 14 Aug 2018 14:19:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808141419.w7EEJvEI013649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Aug 2018 14:19:57 +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: r337757 - stable/10/sbin/ifconfig X-SVN-Group: stable-10 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/10/sbin/ifconfig X-SVN-Commit-Revision: 337757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 14:19:58 -0000 Author: markj Date: Tue Aug 14 14:19:57 2018 New Revision: 337757 URL: https://svnweb.freebsd.org/changeset/base/337757 Log: MFC r337426: ifconfig: Fix use of _Noreturn. Modified: stable/10/sbin/ifconfig/ifconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/10/sbin/ifconfig/ifconfig.c Tue Aug 14 14:17:55 2018 (r337756) +++ stable/10/sbin/ifconfig/ifconfig.c Tue Aug 14 14:19:57 2018 (r337757) @@ -103,7 +103,7 @@ static int ifconfig(int argc, char *const *argv, int i static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, struct ifaddrs *ifa); static void tunnel_status(int s); -static void usage(void) _Noreturn; +static _Noreturn void usage(void); static struct afswtch *af_getbyname(const char *name); static struct afswtch *af_getbyfamily(int af); From owner-svn-src-all@freebsd.org Tue Aug 14 14:50: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 91209107A4DE; Tue, 14 Aug 2018 14:50:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4605672C30; Tue, 14 Aug 2018 14:50: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 2720F1CF45; Tue, 14 Aug 2018 14:50: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 w7EEo7Gx029740; Tue, 14 Aug 2018 14:50:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EEo78r029739; Tue, 14 Aug 2018 14:50:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808141450.w7EEo78r029739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Aug 2018 14:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337758 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 337758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 14:50:07 -0000 Author: markj Date: Tue Aug 14 14:50:06 2018 New Revision: 337758 URL: https://svnweb.freebsd.org/changeset/base/337758 Log: Explain why we aren't using memcpy(). Reported by: jmg X-MFC with: r337715 Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/ucode.c Modified: head/sys/x86/x86/ucode.c ============================================================================== --- head/sys/x86/x86/ucode.c Tue Aug 14 14:19:57 2018 (r337757) +++ head/sys/x86/x86/ucode.c Tue Aug 14 14:50:06 2018 (r337758) @@ -344,6 +344,7 @@ ucode_load_bsp(uintptr_t free) match = loader->match(fileaddr, &len); if (match != NULL) { addr = map_ucode(free, len); + /* We can't use memcpy() before ifunc resolution. */ for (i = 0; i < len; i++) addr[i] = match[i]; match = addr; From owner-svn-src-all@freebsd.org Tue Aug 14 15:27:17 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 214D5107B72F; Tue, 14 Aug 2018 15:27:17 +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 9774F746EC; Tue, 14 Aug 2018 15:27:16 +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 w7EFRD9c042902; Tue, 14 Aug 2018 08:27:13 -0700 (PDT) (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 w7EFRDOZ042901; Tue, 14 Aug 2018 08:27:13 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808141527.w7EFRDOZ042901@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337754 - head/sys/x86/x86 In-Reply-To: <201808141402.w7EE2seW007725@repo.freebsd.org> To: Mark Johnston Date: Tue, 14 Aug 2018 08:27:13 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 15:27:17 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: markj > Date: Tue Aug 14 14:02:53 2018 > New Revision: 337754 > URL: https://svnweb.freebsd.org/changeset/base/337754 > > Log: > Don't use memcpy() in the early microcode loading code. > > At some point memcpy() may be an ifunc, ifunc resolution cannot be done > until CPU identification has been performed, and CPU identification must > be done after loading any microcode updates. Could you please add a comment so that someone does not undo this? > > X-MFC with: r337715 > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/x86/x86/ucode.c > > Modified: head/sys/x86/x86/ucode.c > ============================================================================== > --- head/sys/x86/x86/ucode.c Tue Aug 14 14:01:12 2018 (r337753) > +++ head/sys/x86/x86/ucode.c Tue Aug 14 14:02:53 2018 (r337754) > @@ -312,8 +312,7 @@ ucode_load_bsp(uintptr_t free) > uint8_t *addr, *fileaddr, *match; > char *type; > caddr_t file; > - size_t len, ucode_len; > - int i; > + size_t i, len, ucode_len; > > KASSERT(free % PAGE_SIZE == 0, ("unaligned boundary %p", (void *)free)); > > @@ -345,7 +344,8 @@ ucode_load_bsp(uintptr_t free) > match = loader->match(fileaddr, &len); > if (match != NULL) { > addr = map_ucode(free, len); > - memcpy(addr, match, len); /* * NB: memcpy may be an uninitialized ifunc, * so can not be used here. */ > + for (i = 0; i < len; i++) > + addr[i] = match[i]; > match = addr; > > if (loader->load(match, false) == 0) { > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Aug 14 15:27: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 1C089107B77E; Tue, 14 Aug 2018 15:27:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C37CB7485F; Tue, 14 Aug 2018 15:27:50 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4B121D5E0; Tue, 14 Aug 2018 15:27:50 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EFRomA051162; Tue, 14 Aug 2018 15:27:50 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EFRo5V051161; Tue, 14 Aug 2018 15:27:50 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808141527.w7EFRo5V051161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 14 Aug 2018 15:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337759 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 337759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 15:27:51 -0000 Author: loos Date: Tue Aug 14 15:27:50 2018 New Revision: 337759 URL: https://svnweb.freebsd.org/changeset/base/337759 Log: Use the correct PTE when changing the attribute of multiple pages. Submitted by: andrew (long time ago) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 14 14:50:06 2018 (r337758) +++ head/sys/arm64/arm64/pmap.c Tue Aug 14 15:27:50 2018 (r337759) @@ -4813,7 +4813,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size return (EINVAL); for (tmpva = base; tmpva < base + size; ) { - pte = pmap_pte(kernel_pmap, va, &lvl); + pte = pmap_pte(kernel_pmap, tmpva, &lvl); if (pte == NULL) return (EINVAL); From owner-svn-src-all@freebsd.org Tue Aug 14 15:28: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 BA4E1107B7D8; Tue, 14 Aug 2018 15:28:10 +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 37F6574A62; Tue, 14 Aug 2018 15:28:09 +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 w7EFS88D042921; Tue, 14 Aug 2018 08:28:08 -0700 (PDT) (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 w7EFS8db042920; Tue, 14 Aug 2018 08:28:08 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808141528.w7EFS8db042920@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337758 - head/sys/x86/x86 In-Reply-To: <201808141450.w7EEo78r029739@repo.freebsd.org> To: Mark Johnston Date: Tue, 14 Aug 2018 08:28:08 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 15:28:10 -0000 > Author: markj > Date: Tue Aug 14 14:50:06 2018 > New Revision: 337758 > URL: https://svnweb.freebsd.org/changeset/base/337758 > > Log: > Explain why we aren't using memcpy(). > > Reported by: jmg > X-MFC with: r337715 > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/x86/x86/ucode.c > > Modified: head/sys/x86/x86/ucode.c > ============================================================================== > --- head/sys/x86/x86/ucode.c Tue Aug 14 14:19:57 2018 (r337757) > +++ head/sys/x86/x86/ucode.c Tue Aug 14 14:50:06 2018 (r337758) > @@ -344,6 +344,7 @@ ucode_load_bsp(uintptr_t free) > match = loader->match(fileaddr, &len); > if (match != NULL) { > addr = map_ucode(free, len); > + /* We can't use memcpy() before ifunc resolution. */ NVM my previous email, and thank you. > for (i = 0; i < len; i++) > addr[i] = match[i]; > match = addr; -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Aug 14 15:34:45 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 9BF1D107BAFC; Tue, 14 Aug 2018 15:34:45 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 2EE7875293; Tue, 14 Aug 2018 15:34:45 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pf1-f179.google.com with SMTP id i26-v6so9395066pfo.12; Tue, 14 Aug 2018 08:34:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TYwK0lXAWjEcOEpxWT0csZ6dwuBzMdWa0wgswKxZa78=; b=NtuLWBlKTL6RHtFuc/SLw1AlYP9dqWU85edRjFQjZD6sAnlMulPbbXEXTgL/GuIb8p 4NQFVhyKA/lijGIcUZlwlcKhIpR1WQ+ZCL3GjE5+9VuHpfT4TIlP3Wp7MpipG1/3juB/ wuEU8+EydMk56r99EtRddUMAwB5O6nITrShzaS8rYQ9a84fud+GNQmsv9gcQ8hEUNPry qNfPzwaK75o0s1vOd8j+knjBmlwJyyPFhy6OW7a7uhabXtprKmSjzWq5iegOfkUx+CG/ Fm41h10idFznbdPS96d5ZlykgyQ47vjFl+/gqSqNemhtKMc3zaTfv4M/SuCihvdv9V6+ 1stw== X-Gm-Message-State: AOUpUlHkzPi1YlWZnN48R2AP69bMMNyV1Nznjc+pNlwzHnepZ8JJ6aFC 7/qtYhLMdAuuuCn/1S3MlVHXaKcF X-Google-Smtp-Source: AA+uWPxVOR1YbU9QAAKdwlurBCrZt2d5afB+MMQ8QjWiFZaHRTrvtWvT3GgMtPxw5KN2B9sOTI9OaQ== X-Received: by 2002:a63:d401:: with SMTP id a1-v6mr21348295pgh.414.1534260878270; Tue, 14 Aug 2018 08:34:38 -0700 (PDT) Received: from [192.168.1.36] (broadband-82-140-243-117.atc.tvcom.ru. [82.140.243.117]) by smtp.googlemail.com with ESMTPSA id e7-v6sm42623916pgc.55.2018.08.14.08.34.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Aug 2018 08:34:37 -0700 (PDT) Subject: Re: svn commit: r337754 - head/sys/x86/x86 To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808141402.w7EE2seW007725@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Message-ID: Date: Tue, 14 Aug 2018 18:34:34 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808141402.w7EE2seW007725@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 15:34:45 -0000 On 14/08/2018 17:02, Mark Johnston wrote: > At some point memcpy() may be an ifunc, ifunc resolution cannot be done > until CPU identification has been performed, and CPU identification must > be done after loading any microcode updates. Wouldn't it be cool if before an ifunc is resolved (to a proper optimized version) it pointed to a default implementation that is sufficiently naive and robust that it can work on all CPUs? But I don't know much about ifunc implementation, so no idea if it can work like that. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Aug 14 15:38: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 CE2B5107BC59; Tue, 14 Aug 2018 15:38:53 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 848A275638; Tue, 14 Aug 2018 15:38:53 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.5] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id C1B86C44A; Tue, 14 Aug 2018 15:38:52 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.f.0.180709 Date: Tue, 14 Aug 2018 08:38:49 -0700 Subject: Re: svn commit: r337754 - head/sys/x86/x86 From: Ravi Pokala To: Andriy Gapon , Mark Johnston , , , Message-ID: <4C558668-E3D9-4EEF-BE93-7D2147E7B17E@panasas.com> Thread-Topic: svn commit: r337754 - head/sys/x86/x86 References: <201808141402.w7EE2seW007725@repo.freebsd.org> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 15:38:54 -0000 -----Original Message----- From: on behalf of Andriy Gapon Date: 2018-08-14, Tuesday at 08:34 To: Mark Johnston , , , Subject: Re: svn commit: r337754 - head/sys/x86/x86 > On 14/08/2018 17:02, Mark Johnston wrote: >> At some point memcpy() may be an ifunc, ifunc resolution cannot be done >> until CPU identification has been performed, and CPU identification must >> be done after loading any microcode updates. > > Wouldn't it be cool if before an ifunc is resolved (to a proper > optimized version) it pointed to a default implementation that is > sufficiently naive and robust that it can work on all CPUs? > But I don't know much about ifunc implementation, so no idea if it can > work like that. Or, if that can't be done, have a pre_ifunc_memcpy() with the default implementation, which is explicitly for use before ifuncs are set up. -Ravi > -- > Andriy Gapon From owner-svn-src-all@freebsd.org Tue Aug 14 15:42: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 74D50107BDCF for ; Tue, 14 Aug 2018 15:42:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (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 F12FB75B48 for ; Tue, 14 Aug 2018 15:42:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id d9-v6so18793318itf.2 for ; Tue, 14 Aug 2018 08:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=p79t4qo/oCSpBeL4yB5lGhpe2BrdjAPNgqeJb3pAoOw=; b=TKTuq4TQJyF/Q7L6hUggbb4Y29WMxYquwvxIQL80I4wbHYz2OKWGn0GvfDYBOf5gbq T3iHyDZbRKoa9upeJt4kfTxVw/Md57MP3ru/dCOHawfiXjzOULQHISlbMvm/Psdm5Dt2 f5OZMjE7FAO49LIrjMkw299px+h2a2VSBX0Z+TKiQL2bABOSe9QsXIR5NMT0RJQKcxE6 xIhj9Xlbwo0D+xxK8o0Rt1rC1pnHPkk1rvB18KItr1ufdJ4h6ZJ94jIfiE+YTO8hCHUc W5UeuW8fv9fHR07qrdXZWaFIBRjxBRgAGhq8MdVMCUnA5nA4bViVbW3kpVvvkW/2HnyK 40AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=p79t4qo/oCSpBeL4yB5lGhpe2BrdjAPNgqeJb3pAoOw=; b=NJ9RMLMS9IinTeXupdc5YKcmg5EycvupLy0l8Domtw6OMAeXKjI+8Vx5tQcb8BNQ9F xnc5Xr7kCmMtqmxva9YSdTOteDZlhVTBKjxK5/8FKtGfs1940s/DGxaQrMUaIVCnpwgs vEZ+V+xzJbXxcUSBYR6jTwxi4UFcr1GM+oikb+DMJpe5RfjndhbDdbiqoMOGdPaOV/lg +S2TzME7XmcHodzoFKIOUqWYcq9ZWIo/Wpn5YAPVCtl8Hjcr2XwrrCxBdgubyzMQTl2d PXszhMAT2R2jDTo/9hGvfuoAaQfp7Ih5PUuQBX4qEXrNtIfv4OLWsnOFR4xgmAOHn7MW 9vlQ== X-Gm-Message-State: AOUpUlHzjrC6J21wwzg81FwCESJZTDHfb3m7VVqEk0KjSvrYcFN5w1JZ /QhNdbnZy6hIA60HCmQzcFOE3Fwa2cjqz7o5DOrxZg== X-Google-Smtp-Source: AA+uWPyGaAnLJbdTopXhCpYD1yK4yJYdY7lEhyUbh61O+y0D5OSi5bh7ZJpIFHGqEKorfxF4LTOl8mCE5N5LgpHlgF0= X-Received: by 2002:a24:b211:: with SMTP id u17-v6mr14500736ite.1.1534261329260; Tue, 14 Aug 2018 08:42:09 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Tue, 14 Aug 2018 08:42:08 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <1534255137.31375.121.camel@freebsd.org> References: <201808141352.w7EDqA6F001954@repo.freebsd.org> <1534255137.31375.121.camel@freebsd.org> From: Warner Losh Date: Tue, 14 Aug 2018 09:42:08 -0600 X-Google-Sender-Auth: KmkX1MLypoG2bZhz3HnPmU7Rm24 Message-ID: Subject: Re: svn commit: r337750 - head/share/man/man4 To: Ian Lepore Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 15:42:10 -0000 On Tue, Aug 14, 2018 at 7:58 AM, Ian Lepore wrote: > On Tue, 2018-08-14 at 13:52 +0000, Warner Losh wrote: > > Author: imp > > Date: Tue Aug 14 13:52:10 2018 > > New Revision: 337750 > > URL: https://svnweb.freebsd.org/changeset/base/337750 > > > > Log: > > Add good description of init and lock devices from sio to uart. > > > > Modified: > > head/share/man/man4/uart.4 > > > > Modified: head/share/man/man4/uart.4 > > ===================================================================== > > ========= > > --- head/share/man/man4/uart.4 Tue Aug 14 13:52:08 2018 > > (r337749) > > +++ head/share/man/man4/uart.4 Tue Aug 14 13:52:10 2018 > > (r337750) > > @@ -225,6 +225,52 @@ Generally speaking, a connection to a DB-9 style > > conne > > level signal at up to 12 volts. > > A connection to header pins or an edge-connector on an embedded > > board > > is typically a TTL signal at 3.3 or 5 volts. > > +.Sh Special Devices > > +The > > +.Nm > > +driver also supports an initial-state and a lock-state control > > +device for each of the callin and the callout "data" devices. > > +The termios settings of a data device are copied > > +from those of the corresponding initial-state device > > +on first opens and are not inherited from previous opens. > > +Use > > +.Xr stty 1 > > +in the normal way on the initial-state devices to program > > +initial termios states suitable for your setup. > > +.Pp > > +The lock termios state acts as flags to disable changing > > +the termios state. > > +E.g., to lock a flag variable such as CRTSCTS, use > > +.Em stty crtscts > > +on the lock-state device. > > +Speeds and special characters > > +may be locked by setting the corresponding value in the lock-state > > +device to any nonzero value. > > +E.g., to lock a speed to 115200, use > > +.Dq Li stty 115200 > > +on the initial-state device and > > +.Dq Li stty 1 > > +on the lock-state device. > > +.Pp > > +Correct programs talking to correctly wired external devices > > +work with almost arbitrary initial states and almost no locking, > > +but other setups may benefit from changing some of the default > > +initial state and locking the state. > > +In particular, the initial states for non (POSIX) standard flags > > +should be set to suit the devices attached and may need to be > > +locked to prevent buggy programs from changing them. > > +E.g., CRTSCTS should be locked on for devices that support > > +RTS/CTS handshaking at all times and off for devices that do not > > +support it at all. > > +CLOCAL should be locked on for devices that do not support carrier. > > +HUPCL may be locked off if you do not > > +want to hang up for some reason. > > +In general, very bad things happen > > +if something is locked to the wrong state, and things should not > > +be locked for devices that support more than one setting. > > +The CLOCAL flag on callin ports should be locked off for logins > > +to avoid certain security holes, but this needs to be done by > > +getty if the callin port is used for anything else. > > .Sh FILES > > .Bl -tag -width "/dev/ttyu?.init" -compact > > .It Pa /dev/ttyu? > > > > Now they're documented together with a different single driver of many > that supports the feature. This is implemented in the tty layer and > applies to all serial drivers, shouldn't it be documented in tty(4)? Hmmm. You're right. I'd thought only uart supported it, but it looks like you're right it's down a layer. I'll move again and put a xref. Warner From owner-svn-src-all@freebsd.org Tue Aug 14 15:42:28 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 9FDFA107BF48; Tue, 14 Aug 2018 15:42:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54AD175C92; Tue, 14 Aug 2018 15:42:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 368211D939; Tue, 14 Aug 2018 15:42:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EFgSci061349; Tue, 14 Aug 2018 15:42:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EFgS0H061348; Tue, 14 Aug 2018 15:42:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808141542.w7EFgS0H061348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Aug 2018 15:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337760 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 337760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 15:42:28 -0000 Author: andrew Date: Tue Aug 14 15:42:27 2018 New Revision: 337760 URL: https://svnweb.freebsd.org/changeset/base/337760 Log: Fix the spelling of armv4_idcache_inv_all in an END macro. Modified: head/sys/arm/arm/cpufunc_asm_armv4.S Modified: head/sys/arm/arm/cpufunc_asm_armv4.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv4.S Tue Aug 14 15:27:50 2018 (r337759) +++ head/sys/arm/arm/cpufunc_asm_armv4.S Tue Aug 14 15:42:27 2018 (r337760) @@ -70,5 +70,5 @@ ENTRY(armv4_idcache_inv_all) mov r0, #0 mcr p15, 0, r0, c7, c7, 0 /* invalidate all I+D cache */ RET -END(armv4_drain_writebuf) +END(armv4_idcache_inv_all) From owner-svn-src-all@freebsd.org Tue Aug 14 15:48: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 5B7EC107C0A1; Tue, 14 Aug 2018 15:48:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FB6075EFA; Tue, 14 Aug 2018 15:48:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E519F1D943; Tue, 14 Aug 2018 15:48:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EFmDGd061648; Tue, 14 Aug 2018 15:48:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EFmDrb061647; Tue, 14 Aug 2018 15:48:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808141548.w7EFmDrb061647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Aug 2018 15:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337761 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 337761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 15:48:14 -0000 Author: andrew Date: Tue Aug 14 15:48:13 2018 New Revision: 337761 URL: https://svnweb.freebsd.org/changeset/base/337761 Log: Remove an old comment now the code it references has been removed. Modified: head/sys/arm/arm/cpufunc_asm.S Modified: head/sys/arm/arm/cpufunc_asm.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm.S Tue Aug 14 15:42:27 2018 (r337760) +++ head/sys/arm/arm/cpufunc_asm.S Tue Aug 14 15:48:13 2018 (r337761) @@ -53,19 +53,8 @@ ENTRY(cpufunc_nullop) END(cpufunc_nullop) /* - * Generic functions to read the internal coprocessor registers - * - * Currently these registers are : - * c0 - CPU ID - * c5 - Fault status - * c6 - Fault address - * - */ - -/* * Generic functions to write the internal coprocessor registers * - * Currently these registers are * c1 - CPU Control * c3 - Domain Access Control From owner-svn-src-all@freebsd.org Tue Aug 14 16:01: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 02E29107C594; Tue, 14 Aug 2018 16:01:27 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACB6D76641; Tue, 14 Aug 2018 16:01:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DE1F1DB21; Tue, 14 Aug 2018 16:01:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EG1QlU070375; Tue, 14 Aug 2018 16:01:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EG1QA2070373; Tue, 14 Aug 2018 16:01:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808141601.w7EG1QA2070373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Aug 2018 16:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337762 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 337762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:01:27 -0000 Author: andrew Date: Tue Aug 14 16:01:25 2018 New Revision: 337762 URL: https://svnweb.freebsd.org/changeset/base/337762 Log: Remove cpu_pfr from arm. It's unused. Modified: head/sys/arm/arm/identcpu-v4.c head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/identcpu-v4.c ============================================================================== --- head/sys/arm/arm/identcpu-v4.c Tue Aug 14 15:48:13 2018 (r337761) +++ head/sys/arm/arm/identcpu-v4.c Tue Aug 14 16:01:25 2018 (r337762) @@ -252,27 +252,6 @@ print_enadis(int enadis, char *s) enum cpu_class cpu_class = CPU_CLASS_NONE; -u_int cpu_pfr(int num) -{ - u_int feat; - - switch (num) { - case 0: - __asm __volatile("mrc p15, 0, %0, c0, c1, 0" - : "=r" (feat)); - break; - case 1: - __asm __volatile("mrc p15, 0, %0, c0, c1, 1" - : "=r" (feat)); - break; - default: - panic("Processor Feature Register %d not implemented", num); - break; - } - - return (feat); -} - void identify_arm_cpu(void) { Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Tue Aug 14 15:48:13 2018 (r337761) +++ head/sys/arm/include/cpufunc.h Tue Aug 14 16:01:25 2018 (r337762) @@ -210,7 +210,6 @@ int set_cpufuncs (void); void cpufunc_nullop (void); u_int cpufunc_control (u_int clear, u_int bic); void cpu_domains (u_int domains); -u_int cpu_pfr (int); #if defined(CPU_ARM9E) void arm9_tlb_flushID_SE (u_int va); From owner-svn-src-all@freebsd.org Tue Aug 14 16:03: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 C7A4D107C67C; Tue, 14 Aug 2018 16:03:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77BD3769BF; Tue, 14 Aug 2018 16:03:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52D851DC82; Tue, 14 Aug 2018 16:03:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EG34Ht071409; Tue, 14 Aug 2018 16:03:04 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EG34Db071408; Tue, 14 Aug 2018 16:03:04 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808141603.w7EG34Db071408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 14 Aug 2018 16:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337763 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 337763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:03:05 -0000 Author: br Date: Tue Aug 14 16:03:03 2018 New Revision: 337763 URL: https://svnweb.freebsd.org/changeset/base/337763 Log: Rewrite RISC-V disassembler: - Use macroses from encoding.h generated by riscv-opcodes. - Add support for C-compressed ISA extension. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/db_disasm.c Modified: head/sys/riscv/riscv/db_disasm.c ============================================================================== --- head/sys/riscv/riscv/db_disasm.c Tue Aug 14 16:01:25 2018 (r337762) +++ head/sys/riscv/riscv/db_disasm.c Tue Aug 14 16:03:03 2018 (r337763) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Ruslan Bukin + * Copyright (c) 2016-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -41,232 +41,26 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include -struct riscv_op { - char *name; - char *type; - char *fmt; - int opcode; - int funct3; - int funct7; /* Or imm, depending on type. */ -}; +#define X_RA 1 +#define X_SP 2 +#define X_GP 3 +#define X_TP 4 +#define X_T0 5 +#define X_T1 6 +#define X_T2 7 +#define X_T3 28 -/* - * Keep sorted by opcode, funct3, funct7 so some instructions - * aliases will be supported (e.g. "mv" instruction alias) - * Use same print format as binutils do. - */ -static struct riscv_op riscv_opcodes[] = { - { "lb", "I", "d,o(s)", 3, 0, -1 }, - { "lh", "I", "d,o(s)", 3, 1, -1 }, - { "lw", "I", "d,o(s)", 3, 2, -1 }, - { "ld", "I", "d,o(s)", 3, 3, -1 }, - { "lbu", "I", "d,o(s)", 3, 4, -1 }, - { "lhu", "I", "d,o(s)", 3, 5, -1 }, - { "lwu", "I", "d,o(s)", 3, 6, -1 }, - { "ldu", "I", "d,o(s)", 3, 7, -1 }, - { "fence", "I", "", 15, 0, -1 }, - { "fence.i", "I", "", 15, 1, -1 }, - { "mv", "I", "d,s", 19, 0, 0 }, - { "addi", "I", "d,s,j", 19, 0, -1 }, - { "slli", "R2", "d,s,>", 19, 1, 0 }, - { "slti", "I", "d,s,j", 19, 2, -1 }, - { "sltiu", "I", "d,s,j", 19, 3, -1 }, - { "xori", "I", "d,s,j", 19, 4, -1 }, - { "srli", "R2", "d,s,>", 19, 5, 0 }, - { "srai", "R2", "d,s,>", 19, 5, 0b010000 }, - { "ori", "I", "d,s,j", 19, 6, -1 }, - { "andi", "I", "d,s,j", 19, 7, -1 }, - { "auipc", "U", "d,u", 23, -1, -1 }, - { "sext.w", "I", "d,s", 27, 0, 0 }, - { "addiw", "I", "d,s,j", 27, 0, -1 }, - { "slliw", "R", "d,s,<", 27, 1, 0 }, - { "srliw", "R", "d,s,<", 27, 5, 0 }, - { "sraiw", "R", "d,s,<", 27, 5, 0b0100000 }, - { "sb", "S", "t,q(s)", 35, 0, -1 }, - { "sh", "S", "t,q(s)", 35, 1, -1 }, - { "sw", "S", "t,q(s)", 35, 2, -1 }, - { "sd", "S", "t,q(s)", 35, 3, -1 }, - { "sbu", "S", "t,q(s)", 35, 4, -1 }, - { "shu", "S", "t,q(s)", 35, 5, -1 }, - { "swu", "S", "t,q(s)", 35, 6, -1 }, - { "sdu", "S", "t,q(s)", 35, 7, -1 }, - { "lr.w", "R", "d,t,0(s)", 47, 2, 0b0001000 }, - { "sc.w", "R", "d,t,0(s)", 47, 2, 0b0001100 }, - { "amoswap.w", "R", "d,t,0(s)", 47, 2, 0b0000100 }, - { "amoadd.w", "R", "d,t,0(s)", 47, 2, 0b0000000 }, - { "amoxor.w", "R", "d,t,0(s)", 47, 2, 0b0010000 }, - { "amoand.w", "R", "d,t,0(s)", 47, 2, 0b0110000 }, - { "amoor.w", "R", "d,t,0(s)", 47, 2, 0b0100000 }, - { "amomin.w", "R", "d,t,0(s)", 47, 2, 0b1000000 }, - { "amomax.w", "R", "d,t,0(s)", 47, 2, 0b1010000 }, - { "amominu.w", "R", "d,t,0(s)", 47, 2, 0b1100000 }, - { "amomaxu.w", "R", "d,t,0(s)", 47, 2, 0b1110000 }, - { "lr.w.aq", "R", "d,t,0(s)", 47, 2, 0b0001000 }, - { "sc.w.aq", "R", "d,t,0(s)", 47, 2, 0b0001100 }, - { "amoswap.w.aq","R", "d,t,0(s)", 47, 2, 0b0000110 }, - { "amoadd.w.aq","R", "d,t,0(s)", 47, 2, 0b0000010 }, - { "amoxor.w.aq","R", "d,t,0(s)", 47, 2, 0b0010010 }, - { "amoand.w.aq","R", "d,t,0(s)", 47, 2, 0b0110010 }, - { "amoor.w.aq", "R", "d,t,0(s)", 47, 2, 0b0100010 }, - { "amomin.w.aq","R", "d,t,0(s)", 47, 2, 0b1000010 }, - { "amomax.w.aq","R", "d,t,0(s)", 47, 2, 0b1010010 }, - { "amominu.w.aq","R", "d,t,0(s)", 47, 2, 0b1100010 }, - { "amomaxu.w.aq","R", "d,t,0(s)", 47, 2, 0b1110010 }, - { "amoswap.w.rl","R", "d,t,0(s)", 47, 2, 0b0000110 }, - { "amoadd.w.rl","R", "d,t,0(s)", 47, 2, 0b0000001 }, - { "amoxor.w.rl","R", "d,t,0(s)", 47, 2, 0b0010001 }, - { "amoand.w.rl","R", "d,t,0(s)", 47, 2, 0b0110001 }, - { "amoor.w.rl", "R", "d,t,0(s)", 47, 2, 0b0100001 }, - { "amomin.w.rl","R", "d,t,0(s)", 47, 2, 0b1000001 }, - { "amomax.w.rl","R", "d,t,0(s)", 47, 2, 0b1010001 }, - { "amominu.w.rl","R", "d,t,0(s)", 47, 2, 0b1100001 }, - { "amomaxu.w.rl","R", "d,t,0(s)", 47, 2, 0b1110001 }, - { "amoswap.d", "R", "d,t,0(s)", 47, 3, 0b0000100 }, - { "amoadd.d", "R", "d,t,0(s)", 47, 3, 0b0000000 }, - { "amoxor.d", "R", "d,t,0(s)", 47, 3, 0b0010000 }, - { "amoand.d", "R", "d,t,0(s)", 47, 3, 0b0110000 }, - { "amoor.d", "R", "d,t,0(s)", 47, 3, 0b0100000 }, - { "amomin.d", "R", "d,t,0(s)", 47, 3, 0b1000000 }, - { "amomax.d", "R", "d,t,0(s)", 47, 3, 0b1010000 }, - { "amominu.d", "R", "d,t,0(s)", 47, 3, 0b1100000 }, - { "amomaxu.d", "R", "d,t,0(s)", 47, 3, 0b1110000 }, - { "lr.d.aq", "R", "d,t,0(s)", 47, 3, 0b0001000 }, - { "sc.d.aq", "R", "d,t,0(s)", 47, 3, 0b0001100 }, - { "amoswap.d.aq","R", "d,t,0(s)", 47, 3, 0b0000110 }, - { "amoadd.d.aq","R", "d,t,0(s)", 47, 3, 0b0000010 }, - { "amoxor.d.aq","R", "d,t,0(s)", 47, 3, 0b0010010 }, - { "amoand.d.aq","R", "d,t,0(s)", 47, 3, 0b0110010 }, - { "amoor.d.aq", "R", "d,t,0(s)", 47, 3, 0b0100010 }, - { "amomin.d.aq","R", "d,t,0(s)", 47, 3, 0b1000010 }, - { "amomax.d.aq","R", "d,t,0(s)", 47, 3, 0b1010010 }, - { "amominu.d.aq","R", "d,t,0(s)", 47, 3, 0b1100010 }, - { "amomaxu.d.aq","R", "d,t,0(s)", 47, 3, 0b1110010 }, - { "amoswap.d.rl","R", "d,t,0(s)", 47, 3, 0b0000110 }, - { "amoadd.d.rl","R", "d,t,0(s)", 47, 3, 0b0000001 }, - { "amoxor.d.rl","R", "d,t,0(s)", 47, 3, 0b0010001 }, - { "amoand.d.rl","R", "d,t,0(s)", 47, 3, 0b0110001 }, - { "amoor.d.rl", "R", "d,t,0(s)", 47, 3, 0b0100001 }, - { "amomin.d.rl","R", "d,t,0(s)", 47, 3, 0b1000001 }, - { "amomax.d.rl","R", "d,t,0(s)", 47, 3, 0b1010001 }, - { "amominu.d.rl","R", "d,t,0(s)", 47, 3, 0b1100001 }, - { "amomaxu.d.rl","R", "d,t,0(s)", 47, 3, 0b1110001 }, - { "add", "R", "d,s,t", 51, 0, 0 }, - { "sub", "R", "d,s,t", 51, 0, 0b0100000 }, - { "mul", "R", "d,s,t", 51, 0, 0b0000001 }, - { "sll", "R", "d,s,t", 51, 1, 0 }, - { "slt", "R", "d,s,t", 51, 2, 0 }, - { "sltu", "R", "d,s,t", 51, 3, 0 }, - { "xor", "R", "d,s,t", 51, 4, 0 }, - { "srl", "R", "d,s,t", 51, 5, 0 }, - { "sra", "R", "d,s,t", 51, 5, 0b0100000 }, - { "or", "R", "d,s,t", 51, 6, 0 }, - { "and", "R", "d,s,t", 51, 7, 0 }, - { "lui", "U", "d,u", 55, -1, -1 }, - { "addw", "R", "d,s,t", 59, 0, 0 }, - { "subw", "R", "d,s,t", 59, 0, 0b0100000 }, - { "mulw", "R", "d,s,t", 59, 0, 1 }, - { "sllw", "R", "d,s,t", 59, 1, 0 }, - { "srlw", "R", "d,s,t", 59, 5, 0 }, - { "sraw", "R", "d,s,t", 59, 5, 0b0100000 }, - { "beq", "SB", "s,t,p", 99, 0, -1 }, - { "bne", "SB", "s,t,p", 99, 1, -1 }, - { "blt", "SB", "s,t,p", 99, 4, -1 }, - { "bge", "SB", "s,t,p", 99, 5, -1 }, - { "bltu", "SB", "s,t,p", 99, 6, -1 }, - { "bgeu", "SB", "s,t,p", 99, 7, -1 }, - { "jalr", "I", "d,s,j", 103, 0, -1 }, - { "jal", "UJ", "a", 111, -1, -1 }, - { "eret", "I", "", 115, 0, 0b000100000000 }, - { "sfence.vm", "I", "", 115, 0, 0b000100000001 }, - { "wfi", "I", "", 115, 0, 0b000100000010 }, - { "csrrw", "I", "d,E,s", 115, 1, -1}, - { "csrrs", "I", "d,E,s", 115, 2, -1}, - { "csrrc", "I", "d,E,s", 115, 3, -1}, - { "csrrwi", "I", "d,E,Z", 115, 5, -1}, - { "csrrsi", "I", "d,E,Z", 115, 6, -1}, - { "csrrci", "I", "d,E,Z", 115, 7, -1}, - { NULL, NULL, NULL, 0, 0, 0 } -}; +#define RD_SHIFT 7 +#define RD_MASK (0x1f << RD_SHIFT) +#define RS1_SHIFT 15 +#define RS1_MASK (0x1f << RS1_SHIFT) +#define RS2_SHIFT 20 +#define RS2_MASK (0x1f << RS2_SHIFT) +#define IMM_SHIFT 20 +#define IMM_MASK (0xfff << IMM_SHIFT) -struct csr_op { - char *name; - int imm; -}; - -static struct csr_op csr_name[] = { - { "fflags", 0x001 }, - { "frm", 0x002 }, - { "fcsr", 0x003 }, - { "cycle", 0xc00 }, - { "time", 0xc01 }, - { "instret", 0xc02 }, - { "stats", 0x0c0 }, - { "uarch0", 0xcc0 }, - { "uarch1", 0xcc1 }, - { "uarch2", 0xcc2 }, - { "uarch3", 0xcc3 }, - { "uarch4", 0xcc4 }, - { "uarch5", 0xcc5 }, - { "uarch6", 0xcc6 }, - { "uarch7", 0xcc7 }, - { "uarch8", 0xcc8 }, - { "uarch9", 0xcc9 }, - { "uarch10", 0xcca }, - { "uarch11", 0xccb }, - { "uarch12", 0xccc }, - { "uarch13", 0xccd }, - { "uarch14", 0xcce }, - { "uarch15", 0xccf }, - { "sstatus", 0x100 }, - { "stvec", 0x101 }, - { "sie", 0x104 }, - { "sscratch", 0x140 }, - { "sepc", 0x141 }, - { "sip", 0x144 }, - { "sptbr", 0x180 }, - { "sasid", 0x181 }, - { "cyclew", 0x900 }, - { "timew", 0x901 }, - { "instretw", 0x902 }, - { "stime", 0xd01 }, - { "scause", 0xd42 }, - { "sbadaddr", 0xd43 }, - { "stimew", 0xa01 }, - { "mstatus", 0x300 }, - { "mtvec", 0x301 }, - { "mtdeleg", 0x302 }, - { "mie", 0x304 }, - { "mtimecmp", 0x321 }, - { "mscratch", 0x340 }, - { "mepc", 0x341 }, - { "mcause", 0x342 }, - { "mbadaddr", 0x343 }, - { "mip", 0x344 }, - { "mtime", 0x701 }, - { "mcpuid", 0xf00 }, - { "mimpid", 0xf01 }, - { "mhartid", 0xf10 }, - { "mtohost", 0x780 }, - { "mfromhost", 0x781 }, - { "mreset", 0x782 }, - { "send_ipi", 0x783 }, - { "miobase", 0x784 }, - { "cycleh", 0xc80 }, - { "timeh", 0xc81 }, - { "instreth", 0xc82 }, - { "cyclehw", 0x980 }, - { "timehw", 0x981 }, - { "instrethw", 0x982 }, - { "stimeh", 0xd81 }, - { "stimehw", 0xa81 }, - { "mtimecmph", 0x361 }, - { "mtimeh", 0x741 }, - { NULL, 0 } -}; - static char *reg_name[32] = { "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2", "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5", @@ -274,202 +68,536 @@ static char *reg_name[32] = { "s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6" }; -static int32_t -get_imm(InstFmt i, char *type, uint32_t *val) -{ - int imm; +static char *fp_reg_name[32] = { + "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", + "fs0", "fs1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", + "fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", + "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11" +}; - imm = 0; +struct riscv_op { + char *name; + char *fmt; + int match; + int mask; + int (*match_func)(struct riscv_op *op, uint32_t insn); +}; - if (strcmp(type, "I") == 0) { - imm = i.IType.imm; - *val = imm; - if (imm & (1 << 11)) - imm |= (0xfffff << 12); /* sign extend */ +static int +m_op(struct riscv_op *op, uint32_t insn) +{ - } else if (strcmp(type, "S") == 0) { - imm = i.SType.imm0_4; - imm |= (i.SType.imm5_11 << 5); - *val = imm; - if (imm & (1 << 11)) - imm |= (0xfffff << 12); /* sign extend */ + if (((insn ^ op->match) & op->mask) == 0) + return (1); - } else if (strcmp(type, "U") == 0) { - imm = i.UType.imm12_31; - *val = imm; + return (0); +} - } else if (strcmp(type, "UJ") == 0) { - imm = i.UJType.imm12_19 << 12; - imm |= i.UJType.imm11 << 11; - imm |= i.UJType.imm1_10 << 1; - imm |= i.UJType.imm20 << 20; - *val = imm; - if (imm & (1 << 20)) - imm |= (0xfff << 21); /* sign extend */ +static struct riscv_op riscv_opcodes[] = { + /* Aliases first */ + {"ret","", MATCH_JALR | (X_RA << RS1_SHIFT), + MASK_JALR | RD_MASK | RS1_MASK | IMM_MASK, m_op }, - } else if (strcmp(type, "SB") == 0) { - imm = i.SBType.imm11 << 11; - imm |= i.SBType.imm1_4 << 1; - imm |= i.SBType.imm5_10 << 5; - imm |= i.SBType.imm12 << 12; - *val = imm; - if (imm & (1 << 12)) - imm |= (0xfffff << 12); /* sign extend */ - } + { "beq", "s,t,p", MATCH_BEQ, MASK_BEQ, m_op }, + { "bne", "s,t,p", MATCH_BNE, MASK_BNE, m_op }, + { "blt", "s,t,p", MATCH_BLT, MASK_BLT, m_op }, + { "bge", "s,t,p", MATCH_BGE, MASK_BGE, m_op }, + { "bltu", "s,t,p", MATCH_BLTU, MASK_BLTU, m_op }, + { "bgeu", "s,t,p", MATCH_BGEU, MASK_BGEU, m_op }, + { "jalr", "d,o(s)", MATCH_JALR, MASK_JALR, m_op }, + { "jal", "d,a", MATCH_JAL, MASK_JAL, m_op }, + { "lui", "d,u", MATCH_LUI, MASK_LUI, m_op }, + { "auipc", "d,u", MATCH_AUIPC, MASK_AUIPC, m_op }, + { "addi", "d,s,j", MATCH_ADDI, MASK_ADDI, m_op }, + { "slli", "d,s,>", MATCH_SLLI, MASK_SLLI, m_op }, + { "slti", "d,s,j", MATCH_SLTI, MASK_SLTI, m_op }, + { "sltiu", "d,s,j", MATCH_SLTIU, MASK_SLTIU, m_op }, + { "xori", "d,s,j", MATCH_XORI, MASK_XORI, m_op }, + { "srli", "d,s,>", MATCH_SRLI, MASK_SRLI, m_op }, + { "srai", "d,s,>", MATCH_SRAI, MASK_SRAI, m_op }, + { "ori", "d,s,j", MATCH_ORI, MASK_ORI, m_op }, + { "andi", "d,s,j", MATCH_ANDI, MASK_ANDI, m_op }, + { "add", "d,s,t", MATCH_ADD, MASK_ADD, m_op }, + { "sub", "d,s,t", MATCH_SUB, MASK_SUB, m_op }, + { "sll", "d,s,t", MATCH_SLL, MASK_SLL, m_op }, + { "slt", "d,s,t", MATCH_SLT, MASK_SLT, m_op }, + { "sltu", "d,s,t", MATCH_SLTU, MASK_SLTU, m_op }, + { "xor", "d,s,t", MATCH_XOR, MASK_XOR, m_op }, + { "srl", "d,s,t", MATCH_SRL, MASK_SRL, m_op }, + { "sra", "d,s,t", MATCH_SRA, MASK_SRA, m_op }, + { "or", "d,s,t", MATCH_OR, MASK_OR, m_op }, + { "and", "d,s,t", MATCH_AND, MASK_AND, m_op }, + { "addiw", "d,s,j", MATCH_ADDIW, MASK_ADDIW, m_op }, + { "slliw", "d,s,<", MATCH_SLLIW, MASK_SLLIW, m_op }, + { "srliw", "d,s,<", MATCH_SRLIW, MASK_SRLIW, m_op }, + { "sraiw", "d,s,<", MATCH_SRAIW, MASK_SRAIW, m_op }, + { "addw", "d,s,t", MATCH_ADDW, MASK_ADDW, m_op }, + { "subw", "d,s,t", MATCH_SUBW, MASK_SUBW, m_op }, + { "sllw", "d,s,t", MATCH_SLLW, MASK_SLLW, m_op }, + { "srlw", "d,s,t", MATCH_SRLW, MASK_SRLW, m_op }, + { "sraw", "d,s,t", MATCH_SRAW, MASK_SRAW, m_op }, + { "lb", "d,o(s)", MATCH_LB, MASK_LB, m_op }, + { "lh", "d,o(s)", MATCH_LH, MASK_LH, m_op }, + { "lw", "d,o(s)", MATCH_LW, MASK_LW, m_op }, + { "ld", "d,o(s)", MATCH_LD, MASK_LD, m_op }, + { "lbu", "d,o(s)", MATCH_LBU, MASK_LBU, m_op }, + { "lhu", "d,o(s)", MATCH_LHU, MASK_LHU, m_op }, + { "lwu", "d,o(s)", MATCH_LWU, MASK_LWU, m_op }, + { "sb", "t,q(s)", MATCH_SB, MASK_SB, m_op }, + { "sh", "t,q(s)", MATCH_SH, MASK_SH, m_op }, + { "sw", "t,q(s)", MATCH_SW, MASK_SW, m_op }, + { "sd", "t,q(s)", MATCH_SD, MASK_SD, m_op }, + { "fence", "P,Q", MATCH_FENCE, MASK_FENCE, m_op }, + { "fence.i", "", MATCH_FENCE_I, MASK_FENCE_I, m_op }, + { "mul", "d,s,t", MATCH_MUL, MASK_MUL, m_op }, + { "mulh", "d,s,t", MATCH_MULH, MASK_MULH, m_op }, + { "mulhsu", "d,s,t", MATCH_MULHSU, MASK_MULHSU, m_op }, + { "mulhu", "d,s,t", MATCH_MULHU, MASK_MULHU, m_op }, + { "div", "d,s,t", MATCH_DIV, MASK_DIV, m_op }, + { "divu", "d,s,t", MATCH_DIVU, MASK_DIVU, m_op }, + { "rem", "d,s,t", MATCH_REM, MASK_REM, m_op }, + { "remu", "d,s,t", MATCH_REMU, MASK_REMU, m_op }, + { "mulw", "d,s,t", MATCH_MULW, MASK_MULW, m_op }, + { "divw", "d,s,t", MATCH_DIVW, MASK_DIVW, m_op }, + { "divuw", "d,s,t", MATCH_DIVUW, MASK_DIVUW, m_op }, + { "remw", "d,s,t", MATCH_REMW, MASK_REMW, m_op }, + { "remuw", "d,s,t", MATCH_REMUW, MASK_REMUW, m_op }, + { "amoadd.w", "d,t,0(s)", MATCH_AMOADD_W, MASK_AMOADD_W, m_op }, + { "amoxor.w", "d,t,0(s)", MATCH_AMOXOR_W, MASK_AMOXOR_W, m_op }, + { "amoor.w", "d,t,0(s)", MATCH_AMOOR_W, MASK_AMOOR_W, m_op }, + { "amoand.w", "d,t,0(s)", MATCH_AMOAND_W, MASK_AMOAND_W, m_op }, + { "amomin.w", "d,t,0(s)", MATCH_AMOMIN_W, MASK_AMOMIN_W, m_op }, + { "amomax.w", "d,t,0(s)", MATCH_AMOMAX_W, MASK_AMOMAX_W, m_op }, + { "amominu.w", "d,t,0(s)", MATCH_AMOMINU_W, MASK_AMOMINU_W,m_op }, + { "amomaxu.w", "d,t,0(s)", MATCH_AMOMAXU_W, MASK_AMOMAXU_W,m_op }, + { "amoswap.w", "d,t,0(s)", MATCH_AMOSWAP_W, MASK_AMOSWAP_W,m_op }, + { "lr.w", "d,0(s)", MATCH_LR_W, MASK_LR_W, m_op }, + { "sc.w", "d,t,0(s)", MATCH_SC_W, MASK_SC_W, m_op }, + { "amoadd.d", "d,t,0(s)", MATCH_AMOADD_D, MASK_AMOADD_D, m_op }, + { "amoxor.d", "d,t,0(s)", MATCH_AMOXOR_D, MASK_AMOXOR_D, m_op }, + { "amoor.d", "d,t,0(s)", MATCH_AMOOR_D, MASK_AMOOR_D, m_op }, + { "amoand.d", "d,t,0(s)", MATCH_AMOAND_D, MASK_AMOAND_D, m_op }, + { "amomin.d", "d,t,0(s)", MATCH_AMOMIN_D, MASK_AMOMIN_D, m_op }, + { "amomax.d", "d,t,0(s)", MATCH_AMOMAX_D, MASK_AMOMAX_D, m_op }, + { "amominu.d", "d,t,0(s)", MATCH_AMOMINU_D, MASK_AMOMINU_D,m_op }, + { "amomaxu.d", "d,t,0(s)", MATCH_AMOMAXU_D, MASK_AMOMAXU_D,m_op }, + { "amoswap.d", "d,t,0(s)", MATCH_AMOSWAP_D, MASK_AMOSWAP_D,m_op }, + { "lr.d", "d,0(s)", MATCH_LR_D, MASK_LR_D, m_op }, + { "sc.d", "d,t,0(s)", MATCH_SC_D, MASK_SC_D, m_op }, + { "ecall", "", MATCH_ECALL, MASK_ECALL, m_op }, + { "ebreak", "", MATCH_EBREAK, MASK_EBREAK, m_op }, + { "uret", "", MATCH_URET, MASK_URET, m_op }, + { "sret", "", MATCH_SRET, MASK_SRET, m_op }, + { "mret", "", MATCH_MRET, MASK_MRET, m_op }, + { "dret", "", MATCH_DRET, MASK_DRET, m_op }, + { "sfence.vma", "", MATCH_SFENCE_VMA, MASK_SFENCE_VMA, m_op }, + { "wfi", "", MATCH_WFI, MASK_WFI, m_op }, + { "csrrw", "d,E,s", MATCH_CSRRW, MASK_CSRRW, m_op }, + { "csrrs", "d,E,s", MATCH_CSRRS, MASK_CSRRS, m_op }, + { "csrrc", "d,E,s", MATCH_CSRRC, MASK_CSRRC, m_op }, + { "csrrwi", "d,E,Z", MATCH_CSRRWI, MASK_CSRRWI, m_op }, + { "csrrsi", "d,E,Z", MATCH_CSRRSI, MASK_CSRRSI, m_op }, + { "csrrci", "d,E,Z", MATCH_CSRRCI, MASK_CSRRCI, m_op }, + { "fadd.s", "D,S,T", MATCH_FADD_S, MASK_FADD_S, m_op }, + { "fsub.s", "D,S,T", MATCH_FSUB_S, MASK_FSUB_S, m_op }, + { "fmul.s", "D,S,T", MATCH_FMUL_S, MASK_FMUL_S, m_op }, + { "fdiv.s", "D,S,T", MATCH_FDIV_S, MASK_FDIV_S, m_op }, + { "fsgnj.s", "D,S,T", MATCH_FSGNJ_S, MASK_FSGNJ_S, m_op }, + { "fsgnjn.s", "D,S,T", MATCH_FSGNJN_S, MASK_FSGNJN_S, m_op }, + { "fsgnjx.s", "D,S,T", MATCH_FSGNJX_S, MASK_FSGNJX_S, m_op }, + { "fmin.s", "D,S,T", MATCH_FMIN_S, MASK_FMIN_S, m_op }, + { "fmax.s", "D,S,T", MATCH_FMAX_S, MASK_FMAX_S, m_op }, + { "fsqrt.s", "D,S", MATCH_FSQRT_S, MASK_FSQRT_S, m_op }, + { "fadd.d", "D,S,T", MATCH_FADD_D, MASK_FADD_D, m_op }, + { "fsub.d", "D,S,T", MATCH_FSUB_D, MASK_FSUB_D, m_op }, + { "fmul.d", "D,S,T", MATCH_FMUL_D, MASK_FMUL_D, m_op }, + { "fdiv.d", "D,S,T", MATCH_FDIV_D, MASK_FDIV_D, m_op }, + { "fsgnj.d", "D,S,T", MATCH_FSGNJ_D, MASK_FSGNJ_D, m_op }, + { "fsgnjn.d", "D,S,T", MATCH_FSGNJN_D, MASK_FSGNJN_D, m_op }, + { "fsgnjx.d", "D,S,T", MATCH_FSGNJX_D, MASK_FSGNJX_D, m_op }, + { "fmin.d", "D,S,T", MATCH_FMIN_D, MASK_FMIN_D, m_op }, + { "fmax.d", "D,S,T", MATCH_FMAX_D, MASK_FMAX_D, m_op }, + { "fcvt.s.d", "D,S", MATCH_FCVT_S_D, MASK_FCVT_S_D, m_op }, + { "fcvt.d.s", "D,S", MATCH_FCVT_D_S, MASK_FCVT_D_S, m_op }, + { "fsqrt.d", "D,S", MATCH_FSQRT_D, MASK_FSQRT_D, m_op }, + { "fadd.q", "D,S,T", MATCH_FADD_Q, MASK_FADD_Q, m_op }, + { "fsub.q", "D,S,T", MATCH_FSUB_Q, MASK_FSUB_Q, m_op }, + { "fmul.q", "D,S,T", MATCH_FMUL_Q, MASK_FMUL_Q, m_op }, + { "fdiv.q", "D,S,T", MATCH_FDIV_Q, MASK_FDIV_Q, m_op }, + { "fsgnj.q", "D,S,T", MATCH_FSGNJ_Q, MASK_FSGNJ_Q, m_op }, + { "fsgnjn.q", "D,S,T", MATCH_FSGNJN_Q, MASK_FSGNJN_Q, m_op }, + { "fsgnjx.q", "D,S,T", MATCH_FSGNJX_Q, MASK_FSGNJX_Q, m_op }, + { "fmin.q", "D,S,T", MATCH_FMIN_Q, MASK_FMIN_Q, m_op }, + { "fmax.q", "D,S,T", MATCH_FMAX_Q, MASK_FMAX_Q, m_op }, + { "fcvt.s.q", "D,S", MATCH_FCVT_S_Q, MASK_FCVT_S_Q, m_op }, + { "fcvt.q.s", "D,S", MATCH_FCVT_Q_S, MASK_FCVT_Q_S, m_op }, + { "fcvt.d.q", "D,S", MATCH_FCVT_D_Q, MASK_FCVT_D_Q, m_op }, + { "fcvt.q.d", "D,S", MATCH_FCVT_Q_D, MASK_FCVT_Q_D, m_op }, + { "fsqrt.q", "D,S", MATCH_FSQRT_Q, MASK_FSQRT_Q, m_op }, + { "fle.s", "d,S,T", MATCH_FLE_S, MASK_FLE_S, m_op }, + { "flt.s", "d,S,T", MATCH_FLT_S, MASK_FLT_S, m_op }, + { "feq.s", "d,S,T", MATCH_FEQ_S, MASK_FEQ_S, m_op }, + { "fle.d", "d,S,T", MATCH_FLE_D, MASK_FLE_D, m_op }, + { "flt.d", "d,S,T", MATCH_FLT_D, MASK_FLT_D, m_op }, + { "feq.d", "d,S,T", MATCH_FEQ_D, MASK_FEQ_D, m_op }, + { "fle.q", "d,S,T", MATCH_FLE_Q, MASK_FLE_Q, m_op }, + { "flt.q", "d,S,T", MATCH_FLT_Q, MASK_FLT_Q, m_op }, + { "feq.q", "d,S,T", MATCH_FEQ_Q, MASK_FEQ_Q, m_op }, + { "fcvt.w.s", "d,S", MATCH_FCVT_W_S, MASK_FCVT_W_S, m_op }, + { "fcvt.wu.s", "d,S", MATCH_FCVT_WU_S, MASK_FCVT_WU_S,m_op }, + { "fcvt.l.s", "d,S", MATCH_FCVT_L_S, MASK_FCVT_L_S, m_op }, + { "fcvt.lu.s", "d,S", MATCH_FCVT_LU_S, MASK_FCVT_LU_S,m_op }, + { "fmv.x.w", "d,S", MATCH_FMV_X_W, MASK_FMV_X_W, m_op }, + { "fclass.s", "d,S", MATCH_FCLASS_S, MASK_FCLASS_S, m_op }, + { "fcvt.w.d", "d,S", MATCH_FCVT_W_D, MASK_FCVT_W_D, m_op }, + { "fcvt.wu.d", "d,S", MATCH_FCVT_WU_D, MASK_FCVT_WU_D,m_op }, + { "fcvt.l.d", "d,S", MATCH_FCVT_L_D, MASK_FCVT_L_D, m_op }, + { "fcvt.lu.d", "d,S", MATCH_FCVT_LU_D, MASK_FCVT_LU_D,m_op }, + { "fmv.x.d", "d,S", MATCH_FMV_X_D, MASK_FMV_X_D, m_op }, + { "fclass.d", "d,S", MATCH_FCLASS_D, MASK_FCLASS_D, m_op }, + { "fcvt.w.q", "d,S", MATCH_FCVT_W_Q, MASK_FCVT_W_Q, m_op }, + { "fcvt.wu.q", "d,S", MATCH_FCVT_WU_Q, MASK_FCVT_WU_Q,m_op }, + { "fcvt.l.q", "d,S", MATCH_FCVT_L_Q, MASK_FCVT_L_Q, m_op }, + { "fcvt.lu.q", "d,S", MATCH_FCVT_LU_Q, MASK_FCVT_LU_Q,m_op }, + { "fmv.x.q", "d,S", MATCH_FMV_X_Q, MASK_FMV_X_Q, m_op }, + { "fclass.q", "d,S", MATCH_FCLASS_Q, MASK_FCLASS_Q, m_op }, + { "fcvt.s.w", "D,s", MATCH_FCVT_S_W, MASK_FCVT_S_W, m_op }, + { "fcvt.s.wu", "D,s", MATCH_FCVT_S_WU, MASK_FCVT_S_WU,m_op }, + { "fcvt.s.l", "D,s", MATCH_FCVT_S_L, MASK_FCVT_S_L, m_op }, + { "fcvt.s.lu", "D,s", MATCH_FCVT_S_LU, MASK_FCVT_S_LU,m_op }, + { "fmv.w.x", "D,s", MATCH_FMV_W_X, MASK_FMV_W_X, m_op }, + { "fcvt.d.w", "D,s", MATCH_FCVT_D_W, MASK_FCVT_D_W, m_op }, + { "fcvt.d.wu", "D,s", MATCH_FCVT_D_WU, MASK_FCVT_D_WU,m_op }, + { "fcvt.d.l", "D,s", MATCH_FCVT_D_L, MASK_FCVT_D_L, m_op }, + { "fcvt.d.lu", "D,s", MATCH_FCVT_D_LU, MASK_FCVT_D_LU,m_op }, + { "fmv.d.x", "D,s", MATCH_FMV_D_X, MASK_FMV_D_X, m_op }, + { "fcvt.q.w", "D,s", MATCH_FCVT_Q_W, MASK_FCVT_Q_W, m_op }, + { "fcvt.q.wu", "D,s", MATCH_FCVT_Q_WU, MASK_FCVT_Q_WU,m_op }, + { "fcvt.q.l", "D,s", MATCH_FCVT_Q_L, MASK_FCVT_Q_L, m_op }, + { "fcvt.q.lu", "D,s", MATCH_FCVT_Q_LU, MASK_FCVT_Q_LU,m_op }, + { "fmv.q.x", "D,s", MATCH_FMV_Q_X, MASK_FMV_Q_X, m_op }, + { "flw", "D,o(s)", MATCH_FLW, MASK_FLW, m_op }, + { "fld", "D,o(s)", MATCH_FLD, MASK_FLD, m_op }, + { "flq", "D,o(s)", MATCH_FLQ, MASK_FLQ, m_op }, + { "fsw", "T,q(s)", MATCH_FSW, MASK_FSW, m_op }, + { "fsd", "T,q(s)", MATCH_FSD, MASK_FSD, m_op }, + { "fsq", "T,q(s)", MATCH_FSQ, MASK_FSQ, m_op }, + { "fmadd.s", "D,S,T,R", MATCH_FMADD_S, MASK_FMADD_S, m_op }, + { "fmsub.s", "D,S,T,R", MATCH_FMSUB_S, MASK_FMSUB_S, m_op }, + { "fnmsub.s", "D,S,T,R", MATCH_FNMSUB_S, MASK_FNMSUB_S, m_op }, + { "fnmadd.s", "D,S,T,R", MATCH_FNMADD_S, MASK_FNMADD_S, m_op }, + { "fmadd.d", "D,S,T,R", MATCH_FMADD_D, MASK_FMADD_D, m_op }, + { "fmsub.d", "D,S,T,R", MATCH_FMSUB_D, MASK_FMSUB_D, m_op }, + { "fnmsub.d", "D,S,T,R", MATCH_FNMSUB_D, MASK_FNMSUB_D, m_op }, + { "fnmadd.d", "D,S,T,R", MATCH_FNMADD_D, MASK_FNMADD_D, m_op }, + { "fmadd.q", "D,S,T,R", MATCH_FMADD_Q, MASK_FMADD_Q, m_op }, + { "fmsub.q", "D,S,T,R", MATCH_FMSUB_Q, MASK_FMSUB_Q, m_op }, + { "fnmsub.q", "D,S,T,R", MATCH_FNMSUB_Q, MASK_FNMSUB_Q, m_op }, + { "fnmadd.q", "D,S,T,R", MATCH_FNMADD_Q, MASK_FNMADD_Q, m_op }, + { NULL, NULL, 0, 0, NULL }, +}; - return (imm); -} +static struct riscv_op riscv_c_opcodes[] = { + /* Aliases first */ + { "ret","",MATCH_C_JR | (X_RA << RD_SHIFT), MASK_C_JR | RD_MASK, m_op}, + /* C-Compressed ISA Extension Instructions */ + { "c.nop", "", MATCH_C_NOP, MASK_C_NOP, m_op }, + { "c.ebreak", "", MATCH_C_EBREAK, MASK_C_EBREAK, m_op }, + { "c.jr", "d", MATCH_C_JR, MASK_C_JR, m_op }, + { "c.jalr", "d", MATCH_C_JALR, MASK_C_JALR, m_op }, + { "c.jal", "Ca", MATCH_C_JAL, MASK_C_JAL, m_op }, + { "c.ld", "Ct,Cl(Cs)", MATCH_C_LD, MASK_C_LD, m_op }, + { "c.sd", "Ct,Cl(Cs)", MATCH_C_SD, MASK_C_SD, m_op }, + { "c.addiw", "d,Co", MATCH_C_ADDIW, MASK_C_ADDIW, m_op }, + { "c.ldsp", "d,Cn(Cc)", MATCH_C_LDSP, MASK_C_LDSP, m_op }, + { "c.sdsp", "CV,CN(Cc)", MATCH_C_SDSP, MASK_C_SDSP, m_op }, + { "c.addi4spn", "", MATCH_C_ADDI4SPN, MASK_C_ADDI4SPN, m_op }, + { "c.addi16sp", "", MATCH_C_ADDI16SP, MASK_C_ADDI16SP, m_op }, + { "c.fld", "CD,Cl(Cs)", MATCH_C_FLD, MASK_C_FLD, m_op }, + { "c.lw", "Ct,Ck(Cs)", MATCH_C_LW, MASK_C_LW, m_op }, + { "c.flw", "CD,Ck(Cs)", MATCH_C_FLW, MASK_C_FLW, m_op }, + { "c.fsd", "CD,Cl(Cs)", MATCH_C_FSD, MASK_C_FSD, m_op }, + { "c.sw", "Ct,Ck(Cs)", MATCH_C_SW, MASK_C_SW, m_op }, + { "c.fsw", "CD,Ck(Cs)", MATCH_C_FSW, MASK_C_FSW, m_op }, + { "c.addi", "d,Co", MATCH_C_ADDI, MASK_C_ADDI, m_op }, + { "c.li", "d,Co", MATCH_C_LI, MASK_C_LI, m_op }, + { "c.lui", "d,Cu", MATCH_C_LUI, MASK_C_LUI, m_op }, + { "c.srli", "Cs,C>", MATCH_C_SRLI, MASK_C_SRLI, m_op }, + { "c.srai", "Cs,C>", MATCH_C_SRAI, MASK_C_SRAI, m_op }, + { "c.andi", "Cs,Co", MATCH_C_ANDI, MASK_C_ANDI, m_op }, + { "c.sub", "Cs,Ct", MATCH_C_SUB, MASK_C_SUB, m_op }, + { "c.xor", "Cs,Ct", MATCH_C_XOR, MASK_C_XOR, m_op }, + { "c.or", "Cs,Ct", MATCH_C_OR, MASK_C_OR, m_op }, + { "c.and", "Cs,Ct", MATCH_C_AND, MASK_C_AND, m_op }, + { "c.subw", "Cs,Ct", MATCH_C_SUBW, MASK_C_SUBW, m_op }, + { "c.addw", "Cs,Ct", MATCH_C_ADDW, MASK_C_ADDW, m_op }, + { "c.j", "Ca", MATCH_C_J, MASK_C_J, m_op }, + { "c.beqz", "Cs,Cp", MATCH_C_BEQZ, MASK_C_BEQZ, m_op }, + { "c.bnez", "Cs,Cp", MATCH_C_BNEZ, MASK_C_BNEZ, m_op }, + { "c.slli", "d,C>", MATCH_C_SLLI, MASK_C_SLLI, m_op }, + { "c.fldsp", "D,Cn(Cc)", MATCH_C_FLDSP, MASK_C_FLDSP, m_op }, + { "c.lwsp", "d,Cm(Cc)", MATCH_C_LWSP, MASK_C_LWSP, m_op }, + { "c.flwsp", "D,Cm(Cc)", MATCH_C_FLWSP, MASK_C_FLWSP, m_op }, + { "c.mv", "d,CV", MATCH_C_MV, MASK_C_MV, m_op }, + { "c.add", "d,CV", MATCH_C_ADD, MASK_C_ADD, m_op }, + { "c.fsdsp", "CT,CN(Cc)", MATCH_C_FSDSP, MASK_C_FSDSP, m_op }, + { "c.swsp", "CV,CM(Cc)", MATCH_C_SWSP, MASK_C_SWSP, m_op }, + { "c.fswsp", "CT,CM(Cc)", MATCH_C_FSWSP, MASK_C_FSWSP, m_op }, + { NULL, NULL, 0, 0, NULL }, +}; + static int -oprint(struct riscv_op *op, vm_offset_t loc, int rd, - int rs1, int rs2, uint32_t val, vm_offset_t imm) +oprint(struct riscv_op *op, vm_offset_t loc, int insn) { + uint32_t rd, rs1, rs2, rs3; + uint32_t val; + const char *csr_name; + int imm; char *p; - int i; p = op->fmt; + rd = (insn & RD_MASK) >> RD_SHIFT; + rs1 = (insn & RS1_MASK) >> RS1_SHIFT; + rs2 = (insn & RS2_MASK) >> RS2_SHIFT; + db_printf("%s\t", op->name); while (*p) { - if (strncmp("d", p, 1) == 0) + switch (*p) { + case 'C': /* C-Compressed ISA extension */ + switch (*++p) { + case 't': + rd = (insn >> 2) & 0x7; + rd += 0x8; + db_printf("%s", reg_name[rd]); + break; + case 's': + rs2 = (insn >> 7) & 0x7; + rs2 += 0x8; + db_printf("%s", reg_name[rs2]); + break; + case 'l': + imm = ((insn >> 10) & 0x7) << 3; + imm |= ((insn >> 5) & 0x3) << 6; + if (imm & (1 << 8)) + imm |= 0xffffff << 8; + db_printf("%d", imm); + break; + case 'k': + imm = ((insn >> 10) & 0x7) << 3; + imm |= ((insn >> 6) & 0x1) << 2; + imm |= ((insn >> 5) & 0x1) << 6; + if (imm & (1 << 8)) + imm |= 0xffffff << 8; + db_printf("%d", imm); + break; + case 'c': + db_printf("sp"); + break; + case 'n': + imm = ((insn >> 5) & 0x3) << 3; + imm |= ((insn >> 12) & 0x1) << 5; + imm |= ((insn >> 2) & 0x7) << 6; + if (imm & (1 << 8)) + imm |= 0xffffff << 8; + db_printf("%d", imm); + break; + case 'N': + imm = ((insn >> 10) & 0x7) << 3; + imm |= ((insn >> 7) & 0x7) << 6; + if (imm & (1 << 8)) + imm |= 0xffffff << 8; + db_printf("%d", imm); + break; + case 'u': + imm = ((insn >> 2) & 0x1f) << 0; + imm |= ((insn >> 12) & 0x1) << 5; + if (imm & (1 << 5)) + imm |= (0x7ffffff << 5); /* sign ext */ + db_printf("0x%lx", imm); + break; + case 'o': + imm = ((insn >> 2) & 0x1f) << 0; + imm |= ((insn >> 12) & 0x1) << 5; + if (imm & (1 << 5)) + imm |= (0x7ffffff << 5); /* sign ext */ + db_printf("%d", imm); + break; + case 'a': + /* imm[11|4|9:8|10|6|7|3:1|5] << 2 */ + imm = ((insn >> 3) & 0x7) << 1; + imm |= ((insn >> 11) & 0x1) << 4; + imm |= ((insn >> 2) & 0x1) << 5; + imm |= ((insn >> 7) & 0x1) << 6; + imm |= ((insn >> 6) & 0x1) << 7; + imm |= ((insn >> 9) & 0x3) << 8; + imm |= ((insn >> 8) & 0x1) << 10; + imm |= ((insn >> 12) & 0x1) << 11; + if (imm & (1 << 11)) + imm |= (0xfffff << 12); /* sign ext */ + db_printf("0x%lx", (loc + imm)); + break; + case 'V': + rs2 = (insn >> 2) & 0x1f; + db_printf("%s", reg_name[rs2]); + break; + case '>': + imm = ((insn >> 2) & 0x1f) << 0; + imm |= ((insn >> 12) & 0x1) << 5; + db_printf("%d", imm); + }; + break; + case 'd': db_printf("%s", reg_name[rd]); - - else if (strncmp("s", p, 1) == 0) + break; + case 'D': + db_printf("%s", fp_reg_name[rd]); + break; + case 's': db_printf("%s", reg_name[rs1]); - - else if (strncmp("t", p, 1) == 0) + break; + case 'S': + db_printf("%s", fp_reg_name[rs1]); + break; + case 't': db_printf("%s", reg_name[rs2]); - - else if (strncmp(">", p, 1) == 0) - db_printf("0x%x", rs2); - - else if (strncmp("E", p, 1) == 0) { - for (i = 0; csr_name[i].name != NULL; i++) - if (csr_name[i].imm == val) - db_printf("%s", - csr_name[i].name); - } else if (strncmp("Z", p, 1) == 0) - db_printf("%d", rs1); - - else if (strncmp("<", p, 1) == 0) - db_printf("0x%x", rs2); - - else if (strncmp("j", p, 1) == 0) + break; + case 'T': + db_printf("%s", fp_reg_name[rs2]); + break; + case 'R': + rs3 = (insn >> 27) & 0x1f; + db_printf("%s", fp_reg_name[rs3]); + break; + case 'Z': + imm = (insn >> 15) & 0x1f; db_printf("%d", imm); - - else if (strncmp("u", p, 1) == 0) - db_printf("0x%x", imm); - - else if (strncmp("a", p, 1) == 0) - db_printf("0x%016lx", imm); - - else if (strncmp("p", p, 1) == 0) + break; + case 'p': + imm = ((insn >> 8) & 0xf) << 1; + imm |= ((insn >> 25) & 0x3f) << 5; + imm |= ((insn >> 7) & 0x1) << 11; + imm |= ((insn >> 31) & 0x1) << 12; + if (imm & (1 << 12)) + imm |= (0xfffff << 12); /* sign extend */ db_printf("0x%016lx", (loc + imm)); - - else if (strlen(p) >= 4) { - if (strncmp("o(s)", p, 4) == 0) - db_printf("%d(%s)", imm, reg_name[rs1]); - else if (strncmp("q(s)", p, 4) == 0) - db_printf("%d(%s)", imm, reg_name[rs1]); - else if (strncmp("0(s)", p, 4) == 0) - db_printf("(%s)", reg_name[rs1]); + break; + case '(': + case ')': + case '[': + case ']': + case ',': + db_printf("%c", *p); + break; + case '0': + if (!p[1]) + db_printf("%c", *p); + break; + + case 'o': + imm = (insn >> 20) & 0xfff; + if (imm & (1 << 11)) + imm |= (0xfffff << 12); /* sign extend */ + db_printf("%d", imm); + break; + case 'q': + imm = (insn >> 7) & 0x1f; + imm |= ((insn >> 25) & 0x7f) << 5; + if (imm & (1 << 11)) + imm |= (0xfffff << 12); /* sign extend */ + db_printf("%d", imm); + break; + case 'a': + /* imm[20|10:1|11|19:12] << 12 */ + imm = ((insn >> 21) & 0x3ff) << 1; + imm |= ((insn >> 20) & 0x1) << 11; + imm |= ((insn >> 12) & 0xff) << 12; + imm |= ((insn >> 31) & 0x1) << 20; + if (imm & (1 << 20)) + imm |= (0xfff << 20); /* sign extend */ + db_printf("0x%lx", (loc + imm)); + break; + case 'u': + /* imm[31:12] << 12 */ + imm = (insn >> 12) & 0xfffff; + if (imm & (1 << 20)) + imm |= (0xfff << 20); /* sign extend */ + db_printf("0x%lx", imm); + break; + case 'j': + /* imm[11:0] << 20 */ + imm = (insn >> 20) & 0xfff; + if (imm & (1 << 11)) + imm |= (0xfffff << 12); /* sign extend */ + db_printf("%d", imm); + break; + case '>': + val = (insn >> 20) & 0x3f; + db_printf("0x%x", val); + break; + case '<': + val = (insn >> 20) & 0x1f; + db_printf("0x%x", val); + break; + case 'E': + val = (insn >> 20) & 0xfff; + csr_name = NULL; + switch (val) { +#define DECLARE_CSR(name, num) case num: csr_name = #name; break; +#include "machine/encoding.h" +#undef DECLARE_CSR + } + if (csr_name) + db_printf("%s", csr_name); + else + db_printf("0x%x", val); + break; + case 'P': + if (insn & (1 << 27)) db_printf("i"); + if (insn & (1 << 26)) db_printf("o"); + if (insn & (1 << 25)) db_printf("r"); + if (insn & (1 << 24)) db_printf("w"); + break; + case 'Q': + if (insn & (1 << 23)) db_printf("i"); + if (insn & (1 << 22)) db_printf("o"); + if (insn & (1 << 21)) db_printf("r"); + if (insn & (1 << 20)) db_printf("w"); + break; } - while (*p && strncmp(p, ",", 1) != 0) - p++; - - if (*p) { - db_printf(", "); - p++; - } + p++; } - return (0); } -static int -match_type(InstFmt i, struct riscv_op *op, vm_offset_t loc) -{ - uint32_t val; - int found; - int imm; - - val = 0; - imm = get_imm(i, op->type, &val); - - if (strcmp(op->type, "U") == 0) { - oprint(op, loc, i.UType.rd, 0, 0, val, imm); - return (1); - } - if (strcmp(op->type, "UJ") == 0) { - oprint(op, loc, 0, 0, 0, val, (loc + imm)); - return (1); - } - if ((strcmp(op->type, "I") == 0) && \ - (op->funct3 == i.IType.funct3)) { - found = 0; - if (op->funct7 != -1) { - if (op->funct7 == i.IType.imm) - found = 1; - } else - found = 1; - - if (found) { - oprint(op, loc, i.IType.rd, - i.IType.rs1, 0, val, imm); - return (1); - } - } - if ((strcmp(op->type, "S") == 0) && \ - (op->funct3 == i.SType.funct3)) { - oprint(op, loc, 0, i.SType.rs1, i.SType.rs2, - val, imm); - return (1); - } - if ((strcmp(op->type, "SB") == 0) && \ - (op->funct3 == i.SBType.funct3)) { - oprint(op, loc, 0, i.SBType.rs1, i.SBType.rs2, - val, imm); - return (1); - } - if ((strcmp(op->type, "R2") == 0) && \ - (op->funct3 == i.R2Type.funct3) && \ - (op->funct7 == i.R2Type.funct7)) { - oprint(op, loc, i.R2Type.rd, i.R2Type.rs1, - i.R2Type.rs2, val, imm); - return (1); - } - if ((strcmp(op->type, "R") == 0) && \ - (op->funct3 == i.RType.funct3) && \ - (op->funct7 == i.RType.funct7)) { - oprint(op, loc, i.RType.rd, i.RType.rs1, - val, i.RType.rs2, imm); - return (1); - } - - return (0); -} - vm_offset_t db_disasm(vm_offset_t loc, bool altfmt) { struct riscv_op *op; - InstFmt i; + uint32_t insn; int j; - i.word = db_get_value(loc, INSN_SIZE, 0); - - /* First match opcode */ + insn = db_get_value(loc, 4, 0); for (j = 0; riscv_opcodes[j].name != NULL; j++) { op = &riscv_opcodes[j]; - if (op->opcode == i.RType.opcode) { - if (match_type(i, op, loc)) - break; + if (op->match_func(op, insn)) { + oprint(op, loc, insn); + return(loc + 4); } - } + }; - db_printf("\n"); - return(loc + INSN_SIZE); + insn = db_get_value(loc, 2, 0); + for (j = 0; riscv_c_opcodes[j].name != NULL; j++) { + op = &riscv_c_opcodes[j]; + if (op->match_func(op, insn)) { + oprint(op, loc, insn); + break; + } + }; + + return(loc + 2); } From owner-svn-src-all@freebsd.org Tue Aug 14 16:18: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 6AB51107D033; Tue, 14 Aug 2018 16:18:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AB627774B; Tue, 14 Aug 2018 16:18:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFBC71DE25; Tue, 14 Aug 2018 16:18:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EGIKY4077216; Tue, 14 Aug 2018 16:18:20 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGIFBI077184; Tue, 14 Aug 2018 16:18:15 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201808141618.w7EGIFBI077184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 14 Aug 2018 16:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337764 - in vendor-crypto/openssl/dist-1.0.2: . apps crypto crypto/asn1 crypto/bio crypto/bn crypto/bn/asm crypto/conf crypto/dh crypto/dsa crypto/ec crypto/ecdsa crypto/engine crypto/... X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-crypto/openssl/dist-1.0.2: . apps crypto crypto/asn1 crypto/bio crypto/bn crypto/bn/asm crypto/conf crypto/dh crypto/dsa crypto/ec crypto/ecdsa crypto/engine crypto/pem crypto/pkcs12 crypto/... X-SVN-Commit-Revision: 337764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:18:22 -0000 Author: jkim Date: Tue Aug 14 16:18:14 2018 New Revision: 337764 URL: https://svnweb.freebsd.org/changeset/base/337764 Log: Import OpenSSL 1.0.2p. Added: vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h (contents, props changed) vendor-crypto/openssl/dist-1.0.2/doc/man3/ vendor-crypto/openssl/dist-1.0.2/doc/man3/X509_cmp_time.pod Modified: vendor-crypto/openssl/dist-1.0.2/CHANGES vendor-crypto/openssl/dist-1.0.2/CONTRIBUTING vendor-crypto/openssl/dist-1.0.2/Configure vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade vendor-crypto/openssl/dist-1.0.2/Makefile vendor-crypto/openssl/dist-1.0.2/NEWS vendor-crypto/openssl/dist-1.0.2/README vendor-crypto/openssl/dist-1.0.2/apps/apps.c vendor-crypto/openssl/dist-1.0.2/apps/asn1pars.c vendor-crypto/openssl/dist-1.0.2/apps/ca.c vendor-crypto/openssl/dist-1.0.2/apps/ocsp.c vendor-crypto/openssl/dist-1.0.2/apps/passwd.c vendor-crypto/openssl/dist-1.0.2/apps/s_apps.h vendor-crypto/openssl/dist-1.0.2/apps/s_client.c vendor-crypto/openssl/dist-1.0.2/apps/s_server.c vendor-crypto/openssl/dist-1.0.2/apps/s_socket.c vendor-crypto/openssl/dist-1.0.2/apps/verify.c vendor-crypto/openssl/dist-1.0.2/crypto/Makefile vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_bool.c vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_object.c vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_strex.c vendor-crypto/openssl/dist-1.0.2/crypto/asn1/ameth_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/asn1/asn1.h vendor-crypto/openssl/dist-1.0.2/crypto/asn1/asn1_err.c vendor-crypto/openssl/dist-1.0.2/crypto/asn1/tasn_enc.c vendor-crypto/openssl/dist-1.0.2/crypto/bio/bss_log.c vendor-crypto/openssl/dist-1.0.2/crypto/bio/bss_mem.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/Makefile vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/armv4-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/ia64-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/mips-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/parisc-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/ppc-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/ppc64-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/rsaz-avx2.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/s390x-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/sparct4-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/sparcv9-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/via-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/vis3-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/x86-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/x86_64-mont.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/asm/x86_64-mont5.pl vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn.h vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_div.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_exp.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_gf2m.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lcl.h vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mod.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_mont.c vendor-crypto/openssl/dist-1.0.2/crypto/bn/bn_sqr.c vendor-crypto/openssl/dist-1.0.2/crypto/conf/conf_api.c vendor-crypto/openssl/dist-1.0.2/crypto/dh/dh_key.c vendor-crypto/openssl/dist-1.0.2/crypto/dh/dh_pmeth.c vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa.h vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_err.c vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_gen.c vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_ossl.c vendor-crypto/openssl/dist-1.0.2/crypto/dsa/dsa_pmeth.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_ameth.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ec_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/ec/ecp_nistz256.c vendor-crypto/openssl/dist-1.0.2/crypto/ecdsa/Makefile vendor-crypto/openssl/dist-1.0.2/crypto/ecdsa/ecdsatest.c vendor-crypto/openssl/dist-1.0.2/crypto/ecdsa/ecs_ossl.c vendor-crypto/openssl/dist-1.0.2/crypto/engine/eng_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/engine/tb_asnmth.c vendor-crypto/openssl/dist-1.0.2/crypto/o_time.c vendor-crypto/openssl/dist-1.0.2/crypto/opensslv.h vendor-crypto/openssl/dist-1.0.2/crypto/pem/pem.h vendor-crypto/openssl/dist-1.0.2/crypto/pem/pem_lib.c vendor-crypto/openssl/dist-1.0.2/crypto/pem/pem_pk8.c vendor-crypto/openssl/dist-1.0.2/crypto/pem/pem_pkey.c vendor-crypto/openssl/dist-1.0.2/crypto/pem/pvkfmt.c vendor-crypto/openssl/dist-1.0.2/crypto/pkcs12/p12_asn.c vendor-crypto/openssl/dist-1.0.2/crypto/rsa/Makefile vendor-crypto/openssl/dist-1.0.2/crypto/rsa/rsa_eay.c vendor-crypto/openssl/dist-1.0.2/crypto/rsa/rsa_gen.c vendor-crypto/openssl/dist-1.0.2/crypto/rsa/rsa_oaep.c vendor-crypto/openssl/dist-1.0.2/crypto/rsa/rsa_pk1.c vendor-crypto/openssl/dist-1.0.2/crypto/rsa/rsa_sign.c vendor-crypto/openssl/dist-1.0.2/crypto/rsa/rsa_ssl.c vendor-crypto/openssl/dist-1.0.2/crypto/sha/asm/sha1-586.pl vendor-crypto/openssl/dist-1.0.2/crypto/sha/asm/sha256-586.pl vendor-crypto/openssl/dist-1.0.2/crypto/ui/ui_openssl.c vendor-crypto/openssl/dist-1.0.2/crypto/x509/x509_cmp.c vendor-crypto/openssl/dist-1.0.2/crypto/x509/x509_lu.c vendor-crypto/openssl/dist-1.0.2/crypto/x509/x509_vfy.c vendor-crypto/openssl/dist-1.0.2/crypto/x509v3/v3_purp.c vendor-crypto/openssl/dist-1.0.2/doc/apps/cms.pod vendor-crypto/openssl/dist-1.0.2/doc/apps/config.pod vendor-crypto/openssl/dist-1.0.2/doc/apps/genpkey.pod vendor-crypto/openssl/dist-1.0.2/doc/apps/s_client.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/BIO_s_fd.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/BN_add.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/BN_bn2bin.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/BN_generate_prime.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/CMS_encrypt.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/CMS_get0_SignerInfos.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/CMS_get1_ReceiptRequest.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/DSA_do_sign.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/DSA_sign.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/OBJ_nid2obj.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/SMIME_read_PKCS7.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/ecdsa.pod vendor-crypto/openssl/dist-1.0.2/doc/crypto/pem.pod vendor-crypto/openssl/dist-1.0.2/doc/fingerprints.txt vendor-crypto/openssl/dist-1.0.2/doc/ssl/SSL_CTX_use_certificate.pod vendor-crypto/openssl/dist-1.0.2/doc/ssl/SSL_get_ciphers.pod vendor-crypto/openssl/dist-1.0.2/doc/ssl/SSL_get_session.pod vendor-crypto/openssl/dist-1.0.2/doc/ssl/SSL_get_version.pod vendor-crypto/openssl/dist-1.0.2/doc/ssl/ssl.pod vendor-crypto/openssl/dist-1.0.2/ssl/d1_both.c vendor-crypto/openssl/dist-1.0.2/ssl/s3_lib.c vendor-crypto/openssl/dist-1.0.2/ssl/s3_srvr.c vendor-crypto/openssl/dist-1.0.2/ssl/ssl.h vendor-crypto/openssl/dist-1.0.2/ssl/ssl_lib.c vendor-crypto/openssl/dist-1.0.2/ssl/ssl_locl.h vendor-crypto/openssl/dist-1.0.2/ssl/t1_lib.c vendor-crypto/openssl/dist-1.0.2/ssl/t1_trce.c vendor-crypto/openssl/dist-1.0.2/util/domd Modified: vendor-crypto/openssl/dist-1.0.2/CHANGES ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/CHANGES Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/CHANGES Tue Aug 14 16:18:14 2018 (r337764) @@ -7,6 +7,64 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.0.2o and 1.0.2p [14 Aug 2018] + + *) Client DoS due to large DH parameter + + During key agreement in a TLS handshake using a DH(E) based ciphersuite a + malicious server can send a very large prime value to the client. This will + cause the client to spend an unreasonably long period of time generating a + key for this prime resulting in a hang until the client has finished. This + could be exploited in a Denial Of Service attack. + + This issue was reported to OpenSSL on 5th June 2018 by Guido Vranken + (CVE-2018-0732) + [Guido Vranken] + + *) Cache timing vulnerability in RSA Key Generation + + The OpenSSL RSA Key generation algorithm has been shown to be vulnerable to + a cache timing side channel attack. An attacker with sufficient access to + mount cache timing attacks during the RSA key generation process could + recover the private key. + + This issue was reported to OpenSSL on 4th April 2018 by Alejandro Cabrera + Aldaya, Billy Brumley, Cesar Pereida Garcia and Luis Manuel Alvarez Tapia. + (CVE-2018-0737) + [Billy Brumley] + + *) Make EVP_PKEY_asn1_new() a bit stricter about its input. A NULL pem_str + parameter is no longer accepted, as it leads to a corrupt table. NULL + pem_str is reserved for alias entries only. + [Richard Levitte] + + *) Revert blinding in ECDSA sign and instead make problematic addition + length-invariant. Switch even to fixed-length Montgomery multiplication. + [Andy Polyakov] + + *) Change generating and checking of primes so that the error rate of not + being prime depends on the intended use based on the size of the input. + For larger primes this will result in more rounds of Miller-Rabin. + The maximal error rate for primes with more than 1080 bits is lowered + to 2^-128. + [Kurt Roeckx, Annie Yousar] + + *) Increase the number of Miller-Rabin rounds for DSA key generating to 64. + [Kurt Roeckx] + + *) Add blinding to ECDSA and DSA signatures to protect against side channel + attacks discovered by Keegan Ryan (NCC Group). + [Matt Caswell] + + *) When unlocking a pass phrase protected PEM file or PKCS#8 container, we + now allow empty (zero character) pass phrases. + [Richard Levitte] + + *) Certificate time validation (X509_cmp_time) enforces stricter + compliance with RFC 5280. Fractional seconds and timezone offsets + are no longer allowed. + [Emilia Käsper] + Changes between 1.0.2n and 1.0.2o [27 Mar 2018] *) Constructed ASN.1 types with a recursive definition could exceed the stack Modified: vendor-crypto/openssl/dist-1.0.2/CONTRIBUTING ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/CONTRIBUTING Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/CONTRIBUTING Tue Aug 14 16:18:14 2018 (r337764) @@ -1,27 +1,27 @@ -HOW TO CONTRIBUTE PATCHES TO OpenSSL ------------------------------------- +HOW TO CONTRIBUTE TO OpenSSL +---------------------------- (Please visit https://www.openssl.org/community/getting-started.html for other ideas about how to contribute.) -Development is coordinated on the openssl-dev mailing list (see the -above link or https://mta.openssl.org for information on subscribing). -If you are unsure as to whether a feature will be useful for the general -OpenSSL community you might want to discuss it on the openssl-dev mailing -list first. Someone may be already working on the same thing or there -may be a good reason as to why that feature isn't implemented. +Development is done on GitHub, https://github.com/openssl/openssl. -To submit a patch, make a pull request on GitHub. If you think the patch -could use feedback from the community, please start a thread on openssl-dev -to discuss it. +To request new features or report bugs, please open an issue on GitHub -Having addressed the following items before the PR will help make the -acceptance and review process faster: +To submit a patch, please open a pull request on GitHub. If you are thinking +of making a large contribution, open an issue for it before starting work, +to get comments from the community. Someone may be already working on +the same thing or there may be reasons why that feature isn't implemented. - 1. Anything other than trivial contributions will require a contributor - licensing agreement, giving us permission to use your code. See - https://www.openssl.org/policies/cla.html for details. +To make it easier to review and accept your pull request, please follow these +guidelines: + 1. Anything other than a trivial contribution requires a Contributor + License Agreement (CLA), giving us permission to use your code. See + https://www.openssl.org/policies/cla.html for details. If your + contribution is too small to require a CLA, put "CLA: trivial" on a + line by itself in your commit message body. + 2. All source files should start with the following text (with appropriate comment characters at the start of each line and the year(s) updated): @@ -34,21 +34,21 @@ acceptance and review process faster: https://www.openssl.org/source/license.html 3. Patches should be as current as possible; expect to have to rebase - often. We do not accept merge commits; You will be asked to remove - them before a patch is considered acceptable. + often. We do not accept merge commits, you will have to remove them + (usually by rebasing) before it will be acceptable. 4. Patches should follow our coding style (see - https://www.openssl.org/policies/codingstyle.html) and compile without - warnings. Where gcc or clang is availble you should use the + https://www.openssl.org/policies/codingstyle.html) and compile + without warnings. Where gcc or clang is available you should use the --strict-warnings Configure option. OpenSSL compiles on many varied - platforms: try to ensure you only use portable features. - Clean builds via Travis and AppVeyor are expected, and done whenever - a PR is created or updated. + platforms: try to ensure you only use portable features. Clean builds + via Travis and AppVeyor are required, and they are started automatically + whenever a PR is created or updated. 5. When at all possible, patches should include tests. These can either be added to an existing test, or completely new. Please see test/README for information on the test framework. 6. New features or changed functionality must include - documentation. Please look at the "pod" files in doc/apps, doc/crypto - and doc/ssl for examples of our style. + documentation. Please look at the "pod" files in doc for + examples of our style. Modified: vendor-crypto/openssl/dist-1.0.2/Configure ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/Configure Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/Configure Tue Aug 14 16:18:14 2018 (r337764) @@ -1173,6 +1173,7 @@ foreach (sort (keys %disabled)) $depflags .= " -DOPENSSL_NO_$ALGO"; } } + if (/^comp$/) { $zlib = 0; } } print "\n"; @@ -1671,6 +1672,13 @@ while () { } close(PIPE); +# Xcode did not handle $cc -M before clang support +my $cc_as_makedepend = 0; +if ($predefined{__GNUC__} >= 3 && !(defined($predefined{__APPLE_CC__}) + && !defined($predefined{__clang__}))) { + $cc_as_makedepend = 1; +} + if ($strict_warnings) { my $wopt; @@ -1730,14 +1738,14 @@ while () s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/; s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/; s/^RC=\s*/RC= \$\(CROSS_COMPILE\)/; - s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $predefined{__GNUC__} >= 3; + s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc_as_makedepend; } else { s/^CC=.*$/CC= $cc/; s/^AR=\s*ar/AR= $ar/; s/^RANLIB=.*/RANLIB= $ranlib/; s/^RC=.*/RC= $windres/; - s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $predefined{__GNUC__} >= 3; + s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc_as_makedepend; } s/^CFLAG=.*$/CFLAG= $cflags/; s/^DEPFLAG=.*$/DEPFLAG=$depflags/; Modified: vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/FREEBSD-upgrade Tue Aug 14 16:18:14 2018 (r337764) @@ -11,8 +11,8 @@ First, read http://wiki.freebsd.org/SubversionPrimer/V # Xlist setenv XLIST /FreeBSD/work/openssl/svn-FREEBSD-files/FREEBSD-Xlist setenv FSVN "svn+ssh://repo.freebsd.org/base" -setenv OSSLVER 1.0.2o -# OSSLTAG format: v1_0_2o +setenv OSSLVER 1.0.2p +# OSSLTAG format: v1_0_2p ###setenv OSSLTAG v`echo ${OSSLVER} | tr . _` @@ -21,10 +21,10 @@ fetch http://www.openssl.org/source/openssl-${OSSLVER} http://www.openssl.org/source/openssl-${OSSLVER}.tar.gz.asc gpg --verify openssl-${OSSLVER}.tar.gz.asc openssl-${OSSLVER}.tar.gz -svn co $FSVN/vendor-crypto/openssl/dist dist +svn co $FSVN/vendor-crypto/openssl/dist-1.0.2 dist-1.0.2 tar -x -X $XLIST -f openssl-${OSSLVER}.tar.gz -cd dist +cd dist-1.0.2 svn list -R | egrep -v -e '/$' -e '^FREEBSD-(Xlist|upgrade)$' | sort >../old cd ../openssl-${OSSLVER} find . -type f -or -type l | cut -c 3- | sort >../new @@ -35,21 +35,21 @@ comm -23 old new # See that files to add makes sense comm -13 old new -tar -cf - -C openssl-${OSSLVER} . | tar -xf - -C dist -cd dist +tar -cf - -C openssl-${OSSLVER} . | tar -xf - -C dist-1.0.2 +cd dist-1.0.2 comm -23 ../old ../new | xargs svn rm # Make sure to remove empty directories comm -13 ../old ../new | xargs svn --parents add svn stat svn ci -svn cp ^/vendor-crypto/openssl/dist ^/vendor-crypto/openssl/$OSSLVER +svn cp ^/vendor-crypto/openssl/dist-1.0.2 ^/vendor-crypto/openssl/$OSSLVER # Merge to head mkdir ../head cd ../head svn co $FSVN/head/crypto/openssl crypto/openssl -svn merge ^/vendor-crypto/openssl/dist crypto/openssl +svn merge ^/vendor-crypto/openssl/dist-1.0.2 crypto/openssl # Resolve conflicts manually Modified: vendor-crypto/openssl/dist-1.0.2/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/Makefile Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/Makefile Tue Aug 14 16:18:14 2018 (r337764) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2o +VERSION=1.0.2p MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 Modified: vendor-crypto/openssl/dist-1.0.2/NEWS ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/NEWS Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/NEWS Tue Aug 14 16:18:14 2018 (r337764) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2o and OpenSSL 1.0.2p [14 Aug 2018] + + o Client DoS due to large DH parameter (CVE-2018-0732) + o Cache timing vulnerability in RSA Key Generation (CVE-2018-0737) + Major changes between OpenSSL 1.0.2n and OpenSSL 1.0.2o [27 Mar 2018] o Constructed ASN.1 types with a recursive definition could exceed the Modified: vendor-crypto/openssl/dist-1.0.2/README ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/README Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/README Tue Aug 14 16:18:14 2018 (r337764) @@ -1,7 +1,7 @@ - OpenSSL 1.0.2o 27 Mar 2018 + OpenSSL 1.0.2p 14 Aug 2018 - Copyright (c) 1998-2015 The OpenSSL Project + Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson All rights reserved. Modified: vendor-crypto/openssl/dist-1.0.2/apps/apps.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/apps.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/apps.c Tue Aug 14 16:18:14 2018 (r337764) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1359,7 +1359,8 @@ int set_name_ex(unsigned long *flags, const char *arg) }; if (set_multi_opts(flags, arg, ex_tbl) == 0) return 0; - if ((*flags & XN_FLAG_SEP_MASK) == 0) + if (*flags != XN_FLAG_COMPAT + && (*flags & XN_FLAG_SEP_MASK) == 0) *flags |= XN_FLAG_SEP_CPLUS_SPC; return 1; } Modified: vendor-crypto/openssl/dist-1.0.2/apps/asn1pars.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/asn1pars.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/asn1pars.c Tue Aug 14 16:18:14 2018 (r337764) @@ -295,7 +295,7 @@ int MAIN(int argc, char **argv) ASN1_TYPE *atmp; int typ; j = atoi(sk_OPENSSL_STRING_value(osk, i)); - if (j == 0) { + if (j <= 0 || j >= tmplen) { BIO_printf(bio_err, "'%s' is an invalid number\n", sk_OPENSSL_STRING_value(osk, i)); continue; @@ -327,14 +327,14 @@ int MAIN(int argc, char **argv) num = tmplen; } - if (offset >= num) { - BIO_printf(bio_err, "Error: offset too large\n"); + if (offset < 0 || offset >= num) { + BIO_printf(bio_err, "Error: offset out of range\n"); goto end; } num -= offset; - if ((length == 0) || ((long)length > num)) + if (length == 0 || length > (unsigned int)num) length = (unsigned int)num; if (derout) { if (BIO_write(derout, str + offset, length) != (int)length) { Modified: vendor-crypto/openssl/dist-1.0.2/apps/ca.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/ca.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/ca.c Tue Aug 14 16:18:14 2018 (r337764) @@ -1176,10 +1176,13 @@ int MAIN(int argc, char **argv) if (j > 0) { total_done++; BIO_printf(bio_err, "\n"); - if (!BN_add_word(serial, 1)) + if (!BN_add_word(serial, 1)) { + X509_free(x); goto err; + } if (!sk_X509_push(cert_sk, x)) { BIO_printf(bio_err, "Memory allocation failure\n"); + X509_free(x); goto err; } } Modified: vendor-crypto/openssl/dist-1.0.2/apps/ocsp.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/ocsp.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/ocsp.c Tue Aug 14 16:18:14 2018 (r337764) @@ -4,7 +4,7 @@ * 2000. */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -787,7 +787,6 @@ int MAIN(int argc, char **argv) OCSP_response_status_str(i), i); if (ignore_err) goto redo_accept; - ret = 0; goto end; } Modified: vendor-crypto/openssl/dist-1.0.2/apps/passwd.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/passwd.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/passwd.c Tue Aug 14 16:18:14 2018 (r337764) @@ -306,9 +306,9 @@ static char *md5crypt(const char *passwd, const char * out_buf[0] = '$'; out_buf[1] = 0; assert(strlen(magic) <= 4); /* "1" or "apr1" */ - strncat(out_buf, magic, 4); - strncat(out_buf, "$", 1); - strncat(out_buf, salt, 8); + BUF_strlcat(out_buf, magic, sizeof(out_buf)); + BUF_strlcat(out_buf, "$", sizeof(out_buf)); + BUF_strlcat(out_buf, salt, sizeof(out_buf)); assert(strlen(out_buf) <= 6 + 8); /* "$apr1$..salt.." */ salt_out = out_buf + 2 + strlen(magic); salt_len = strlen(salt_out); Modified: vendor-crypto/openssl/dist-1.0.2/apps/s_apps.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/s_apps.h Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/s_apps.h Tue Aug 14 16:18:14 2018 (r337764) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -152,9 +152,8 @@ typedef fd_mask fd_set; #define PROTOCOL "tcp" int do_server(int port, int type, int *ret, - int (*cb) (char *hostname, int s, int stype, - unsigned char *context), unsigned char *context, - int naccept); + int (*cb) (int s, int stype, unsigned char *context), + unsigned char *context, int naccept); #ifdef HEADER_X509_H int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx); #endif Modified: vendor-crypto/openssl/dist-1.0.2/apps/s_client.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/s_client.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/s_client.c Tue Aug 14 16:18:14 2018 (r337764) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -337,7 +337,7 @@ static void sc_usage(void) BIO_printf(bio_err, " -prexit - print session information even on connection failure\n"); BIO_printf(bio_err, - " -showcerts - show all certificates in the chain\n"); + " -showcerts - Show all certificates sent by the server\n"); BIO_printf(bio_err, " -debug - extra output\n"); #ifdef WATT32 BIO_printf(bio_err, " -wdebug - WATT-32 tcp debugging\n"); Modified: vendor-crypto/openssl/dist-1.0.2/apps/s_server.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/s_server.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/s_server.c Tue Aug 14 16:18:14 2018 (r337764) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -209,9 +209,9 @@ typedef unsigned int u_int; #ifndef OPENSSL_NO_RSA static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength); #endif -static int sv_body(char *hostname, int s, int stype, unsigned char *context); -static int www_body(char *hostname, int s, int stype, unsigned char *context); -static int rev_body(char *hostname, int s, int stype, unsigned char *context); +static int sv_body(int s, int stype, unsigned char *context); +static int www_body(int s, int stype, unsigned char *context); +static int rev_body(int s, int stype, unsigned char *context); static void close_accept_socket(void); static void sv_usage(void); static int init_ssl_connection(SSL *s); @@ -1087,11 +1087,14 @@ int MAIN(int argc, char *argv[]) char *chCApath = NULL, *chCAfile = NULL; char *vfyCApath = NULL, *vfyCAfile = NULL; unsigned char *context = NULL; +#ifndef OPENSSL_NO_DH char *dhfile = NULL; + int no_dhe = 0; +#endif int badop = 0; int ret = 1; int build_chain = 0; - int no_tmp_rsa = 0, no_dhe = 0, no_ecdhe = 0, nocert = 0; + int no_tmp_rsa = 0, no_ecdhe = 0, nocert = 0; int state = 0; const SSL_METHOD *meth = NULL; int socket_type = SOCK_STREAM; @@ -1239,11 +1242,15 @@ int MAIN(int argc, char *argv[]) if (--argc < 1) goto bad; s_chain_file = *(++argv); - } else if (strcmp(*argv, "-dhparam") == 0) { + } +#ifndef OPENSSL_NO_DH + else if (strcmp(*argv, "-dhparam") == 0) { if (--argc < 1) goto bad; dhfile = *(++argv); - } else if (strcmp(*argv, "-dcertform") == 0) { + } +#endif + else if (strcmp(*argv, "-dcertform") == 0) { if (--argc < 1) goto bad; s_dcert_format = str2fmt(*(++argv)); @@ -1390,9 +1397,13 @@ int MAIN(int argc, char *argv[]) verify_quiet = 1; } else if (strcmp(*argv, "-no_tmp_rsa") == 0) { no_tmp_rsa = 1; - } else if (strcmp(*argv, "-no_dhe") == 0) { + } +#ifndef OPENSSL_NO_DH + else if (strcmp(*argv, "-no_dhe") == 0) { no_dhe = 1; - } else if (strcmp(*argv, "-no_ecdhe") == 0) { + } +#endif + else if (strcmp(*argv, "-no_ecdhe") == 0) { no_ecdhe = 1; } else if (strcmp(*argv, "-no_resume_ephemeral") == 0) { no_resume_ephemeral = 1; @@ -2165,7 +2176,7 @@ static void print_stats(BIO *bio, SSL_CTX *ssl_ctx) SSL_CTX_sess_get_cache_size(ssl_ctx)); } -static int sv_body(char *hostname, int s, int stype, unsigned char *context) +static int sv_body(int s, int stype, unsigned char *context) { char *buf = NULL; fd_set readfds; @@ -2780,7 +2791,7 @@ static int load_CA(SSL_CTX *ctx, char *file) } #endif -static int www_body(char *hostname, int s, int stype, unsigned char *context) +static int www_body(int s, int stype, unsigned char *context) { char *buf = NULL; int ret = 1; @@ -3183,7 +3194,7 @@ static int www_body(char *hostname, int s, int stype, return (ret); } -static int rev_body(char *hostname, int s, int stype, unsigned char *context) +static int rev_body(int s, int stype, unsigned char *context) { char *buf = NULL; int i; Modified: vendor-crypto/openssl/dist-1.0.2/apps/s_socket.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/s_socket.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/s_socket.c Tue Aug 14 16:18:14 2018 (r337764) @@ -109,7 +109,7 @@ static int ssl_sock_init(void); static int init_client_ip(int *sock, unsigned char ip[4], int port, int type); static int init_server(int *sock, int port, int type); static int init_server_long(int *sock, int port, char *ip, int type); -static int do_accept(int acc_sock, int *sock, char **host); +static int do_accept(int acc_sock, int *sock); static int host_ip(char *str, unsigned char ip[4]); # ifdef OPENSSL_SYS_WIN16 @@ -290,12 +290,10 @@ static int init_client_ip(int *sock, unsigned char ip[ } int do_server(int port, int type, int *ret, - int (*cb) (char *hostname, int s, int stype, - unsigned char *context), unsigned char *context, - int naccept) + int (*cb) (int s, int stype, unsigned char *context), + unsigned char *context, int naccept) { int sock; - char *name = NULL; int accept_socket = 0; int i; @@ -308,15 +306,13 @@ int do_server(int port, int type, int *ret, } for (;;) { if (type == SOCK_STREAM) { - if (do_accept(accept_socket, &sock, &name) == 0) { + if (do_accept(accept_socket, &sock) == 0) { SHUTDOWN(accept_socket); return (0); } } else sock = accept_socket; - i = (*cb) (name, sock, type, context); - if (name != NULL) - OPENSSL_free(name); + i = (*cb) (sock, type, context); if (type == SOCK_STREAM) SHUTDOWN2(sock); if (naccept != -1) @@ -386,30 +382,24 @@ static int init_server(int *sock, int port, int type) return (init_server_long(sock, port, NULL, type)); } -static int do_accept(int acc_sock, int *sock, char **host) +static int do_accept(int acc_sock, int *sock) { int ret; - struct hostent *h1, *h2; - static struct sockaddr_in from; - int len; -/* struct linger ling; */ if (!ssl_sock_init()) - return (0); + return 0; # ifndef OPENSSL_SYS_WINDOWS redoit: # endif - memset((char *)&from, 0, sizeof(from)); - len = sizeof(from); /* * Note: under VMS with SOCKETSHR the fourth parameter is currently of * type (int *) whereas under other systems it is (void *) if you don't * have a cast it will choke the compiler: if you do have a cast then you * can either go for (int *) or (void *). */ - ret = accept(acc_sock, (struct sockaddr *)&from, (void *)&len); + ret = accept(acc_sock, NULL, NULL); if (ret == INVALID_SOCKET) { # if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)) int i; @@ -425,56 +415,11 @@ static int do_accept(int acc_sock, int *sock, char **h fprintf(stderr, "errno=%d ", errno); perror("accept"); # endif - return (0); + return 0; } -/*- - ling.l_onoff=1; - ling.l_linger=0; - i=setsockopt(ret,SOL_SOCKET,SO_LINGER,(char *)&ling,sizeof(ling)); - if (i < 0) { perror("linger"); return(0); } - i=0; - i=setsockopt(ret,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); - if (i < 0) { perror("keepalive"); return(0); } -*/ - - if (host == NULL) - goto end; -# ifndef BIT_FIELD_LIMITS - /* I should use WSAAsyncGetHostByName() under windows */ - h1 = gethostbyaddr((char *)&from.sin_addr.s_addr, - sizeof(from.sin_addr.s_addr), AF_INET); -# else - h1 = gethostbyaddr((char *)&from.sin_addr, - sizeof(struct in_addr), AF_INET); -# endif - if (h1 == NULL) { - BIO_printf(bio_err, "bad gethostbyaddr\n"); - *host = NULL; - /* return(0); */ - } else { - if ((*host = (char *)OPENSSL_malloc(strlen(h1->h_name) + 1)) == NULL) { - perror("OPENSSL_malloc"); - closesocket(ret); - return (0); - } - BUF_strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1); - - h2 = GetHostByName(*host); - if (h2 == NULL) { - BIO_printf(bio_err, "gethostbyname failure\n"); - closesocket(ret); - return (0); - } - if (h2->h_addrtype != AF_INET) { - BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n"); - closesocket(ret); - return (0); - } - } - end: *sock = ret; - return (1); + return 1; } int extract_host_port(char *str, char **host_ptr, unsigned char *ip, Modified: vendor-crypto/openssl/dist-1.0.2/apps/verify.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/apps/verify.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/apps/verify.c Tue Aug 14 16:18:14 2018 (r337764) @@ -277,6 +277,7 @@ static int check(X509_STORE *ctx, char *file, X509_STORE_set_flags(ctx, vflags); if (!X509_STORE_CTX_init(csc, ctx, x, uchain)) { ERR_print_errors(bio_err); + X509_STORE_CTX_free(csc); goto end; } if (tchain) Modified: vendor-crypto/openssl/dist-1.0.2/crypto/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/Makefile Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/Makefile Tue Aug 14 16:18:14 2018 (r337764) @@ -45,7 +45,7 @@ SRC= $(LIBSRC) EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \ ossl_typ.h HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \ - constant_time_locl.h $(EXHEADER) + constant_time_locl.h bn_int.h $(EXHEADER) ALL= $(GENERAL) $(SRC) $(HEADER) Modified: vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_bool.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_bool.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_bool.c Tue Aug 14 16:18:14 2018 (r337764) @@ -63,17 +63,31 @@ int i2d_ASN1_BOOLEAN(int a, unsigned char **pp) { int r; - unsigned char *p; + unsigned char *p, *allocated = NULL; r = ASN1_object_size(0, 1, V_ASN1_BOOLEAN); if (pp == NULL) return (r); - p = *pp; + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(r)) == NULL) { + ASN1err(ASN1_F_I2D_ASN1_BOOLEAN, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } + ASN1_put_object(&p, 0, 1, V_ASN1_BOOLEAN, V_ASN1_UNIVERSAL); - *(p++) = (unsigned char)a; - *pp = p; - return (r); + *p = (unsigned char)a; + + + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + 1; + return r; } int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length) Modified: vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_object.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_object.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_object.c Tue Aug 14 16:18:14 2018 (r337764) @@ -66,7 +66,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) { - unsigned char *p; + unsigned char *p, *allocated = NULL; int objsize; if ((a == NULL) || (a->data == NULL)) @@ -76,13 +76,24 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp if (pp == NULL || objsize == -1) return objsize; - p = *pp; + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(objsize)) == NULL) { + ASN1err(ASN1_F_I2D_ASN1_OBJECT, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } + ASN1_put_object(&p, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL); memcpy(p, a->data, a->length); - p += a->length; - *pp = p; - return (objsize); + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + a->length; + return objsize; } int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) Modified: vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_strex.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_strex.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/asn1/a_strex.c Tue Aug 14 16:18:14 2018 (r337764) @@ -4,7 +4,7 @@ * 2000. */ /* ==================================================================== - * Copyright (c) 2000 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -194,18 +194,38 @@ static int do_buf(unsigned char *buf, int buflen, int type, unsigned char flags, char *quotes, char_io *io_ch, void *arg) { - int i, outlen, len; + int i, outlen, len, charwidth; unsigned char orflags, *p, *q; unsigned long c; p = buf; q = buf + buflen; outlen = 0; + charwidth = type & BUF_TYPE_WIDTH_MASK; + + switch (charwidth) { + case 4: + if (buflen & 3) { + ASN1err(ASN1_F_DO_BUF, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH); + return -1; + } + break; + case 2: + if (buflen & 1) { + ASN1err(ASN1_F_DO_BUF, ASN1_R_INVALID_BMPSTRING_LENGTH); + return -1; + } + break; + default: + break; + } + while (p != q) { if (p == buf && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_FIRST_ESC_2253; else orflags = 0; - switch (type & BUF_TYPE_WIDTH_MASK) { + + switch (charwidth) { case 4: c = ((unsigned long)*p++) << 24; c |= ((unsigned long)*p++) << 16; @@ -226,6 +246,7 @@ static int do_buf(unsigned char *buf, int buflen, i = UTF8_getc(p, buflen, &c); if (i < 0) return -1; /* Invalid UTF8String */ + buflen -= i; p += i; break; default: Modified: vendor-crypto/openssl/dist-1.0.2/crypto/asn1/ameth_lib.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/asn1/ameth_lib.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/asn1/ameth_lib.c Tue Aug 14 16:18:14 2018 (r337764) @@ -3,7 +3,7 @@ * 2006. */ /* ==================================================================== - * Copyright (c) 2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 2006-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -304,6 +304,18 @@ EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int fl goto err; } else ameth->info = NULL; + + /* + * One of the following must be true: + * + * pem_str == NULL AND ASN1_PKEY_ALIAS is set + * pem_str != NULL AND ASN1_PKEY_ALIAS is clear + * + * Anything else is an error and may lead to a corrupt ASN1 method table + */ + if (!((pem_str == NULL && (flags & ASN1_PKEY_ALIAS) != 0) + || (pem_str != NULL && (flags & ASN1_PKEY_ALIAS) == 0))) + goto err; if (pem_str) { ameth->pem_str = BUF_strdup(pem_str); Modified: vendor-crypto/openssl/dist-1.0.2/crypto/asn1/asn1.h ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/asn1/asn1.h Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/asn1/asn1.h Tue Aug 14 16:18:14 2018 (r337764) @@ -1164,6 +1164,7 @@ int SMIME_text(BIO *in, BIO *out); * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + void ERR_load_ASN1_strings(void); /* Error codes for the ASN1 functions. */ @@ -1264,7 +1265,10 @@ void ERR_load_ASN1_strings(void); # define ASN1_F_D2I_X509 156 # define ASN1_F_D2I_X509_CINF 157 # define ASN1_F_D2I_X509_PKEY 159 +# define ASN1_F_DO_BUF 221 # define ASN1_F_I2D_ASN1_BIO_STREAM 211 +# define ASN1_F_I2D_ASN1_BOOLEAN 223 +# define ASN1_F_I2D_ASN1_OBJECT 222 # define ASN1_F_I2D_ASN1_SET 188 # define ASN1_F_I2D_ASN1_TIME 160 # define ASN1_F_I2D_DSA_PUBKEY 161 @@ -1414,7 +1418,7 @@ void ERR_load_ASN1_strings(void); # define ASN1_R_WRONG_TAG 168 # define ASN1_R_WRONG_TYPE 169 -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif Modified: vendor-crypto/openssl/dist-1.0.2/crypto/asn1/asn1_err.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/asn1/asn1_err.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/asn1/asn1_err.c Tue Aug 14 16:18:14 2018 (r337764) @@ -166,7 +166,10 @@ static ERR_STRING_DATA ASN1_str_functs[] = { {ERR_FUNC(ASN1_F_D2I_X509), "D2I_X509"}, {ERR_FUNC(ASN1_F_D2I_X509_CINF), "D2I_X509_CINF"}, {ERR_FUNC(ASN1_F_D2I_X509_PKEY), "d2i_X509_PKEY"}, + {ERR_FUNC(ASN1_F_DO_BUF), "DO_BUF"}, {ERR_FUNC(ASN1_F_I2D_ASN1_BIO_STREAM), "i2d_ASN1_bio_stream"}, + {ERR_FUNC(ASN1_F_I2D_ASN1_BOOLEAN), "i2d_ASN1_BOOLEAN"}, + {ERR_FUNC(ASN1_F_I2D_ASN1_OBJECT), "i2d_ASN1_OBJECT"}, {ERR_FUNC(ASN1_F_I2D_ASN1_SET), "i2d_ASN1_SET"}, {ERR_FUNC(ASN1_F_I2D_ASN1_TIME), "I2D_ASN1_TIME"}, {ERR_FUNC(ASN1_F_I2D_DSA_PUBKEY), "i2d_DSA_PUBKEY"}, Modified: vendor-crypto/openssl/dist-1.0.2/crypto/asn1/tasn_enc.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/asn1/tasn_enc.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/asn1/tasn_enc.c Tue Aug 14 16:18:14 2018 (r337764) @@ -4,7 +4,7 @@ * 2000. */ /* ==================================================================== - * Copyright (c) 2000-2004 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -588,6 +588,8 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout otmp = (ASN1_OBJECT *)*pval; cont = otmp->data; len = otmp->length; + if (cont == NULL || len == 0) + return -1; break; case V_ASN1_NULL: Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bio/bss_log.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bio/bss_log.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bio/bss_log.c Tue Aug 14 16:18:14 2018 (r337764) @@ -1,6 +1,6 @@ /* crypto/bio/bss_log.c */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -242,7 +242,7 @@ static int MS_CALLBACK slg_write(BIO *b, const char *i if ((buf = (char *)OPENSSL_malloc(inl + 1)) == NULL) { return (0); } - strncpy(buf, in, inl); + memcpy(buf, in, inl); buf[inl] = '\0'; i = 0; Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bio/bss_mem.c ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bio/bss_mem.c Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bio/bss_mem.c Tue Aug 14 16:18:14 2018 (r337764) @@ -188,6 +188,8 @@ static int mem_write(BIO *b, const char *in, int inl) } BIO_clear_retry_flags(b); + if (inl == 0) + return 0; blen = bm->length; if (BUF_MEM_grow_clean(bm, blen + inl) != (blen + inl)) goto end; Modified: vendor-crypto/openssl/dist-1.0.2/crypto/bn/Makefile ============================================================================== --- vendor-crypto/openssl/dist-1.0.2/crypto/bn/Makefile Tue Aug 14 16:03:03 2018 (r337763) +++ vendor-crypto/openssl/dist-1.0.2/crypto/bn/Makefile Tue Aug 14 16:18:14 2018 (r337764) @@ -197,21 +197,24 @@ bn_add.o: ../../include/openssl/e_os2.h ../../include/ bn_add.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_add.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_add.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_add.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_add.c bn_lcl.h +bn_add.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_add.c +bn_add.o: bn_lcl.h bn_asm.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_asm.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_asm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_asm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_asm.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_asm.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_asm.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_asm.c bn_lcl.h +bn_asm.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_asm.c +bn_asm.o: bn_lcl.h bn_blind.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_blind.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_blind.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_blind.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_blind.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_blind.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_blind.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_blind.c bn_lcl.h +bn_blind.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h +bn_blind.o: bn_blind.c bn_lcl.h bn_const.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h bn_const.o: ../../include/openssl/opensslconf.h bn_const.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h @@ -223,7 +226,8 @@ bn_ctx.o: ../../include/openssl/e_os2.h ../../include/ bn_ctx.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_ctx.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_ctx.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_ctx.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_ctx.c bn_lcl.h +bn_ctx.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_ctx.c +bn_ctx.o: bn_lcl.h bn_depr.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_depr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h @@ -231,14 +235,15 @@ bn_depr.o: ../../include/openssl/lhash.h ../../include bn_depr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_depr.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h bn_depr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -bn_depr.o: ../cryptlib.h bn_depr.c bn_lcl.h +bn_depr.o: ../bn_int.h ../cryptlib.h bn_depr.c bn_lcl.h bn_div.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_div.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_div.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_div.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_div.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_div.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_div.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_div.c bn_lcl.h +bn_div.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_div.c +bn_div.o: bn_lcl.h bn_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h bn_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h bn_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h @@ -252,7 +257,7 @@ bn_exp.o: ../../include/openssl/e_os2.h ../../include/ bn_exp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Aug 14 16:18: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 A7C6F107D067; Tue, 14 Aug 2018 16:18:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50A9B77881; Tue, 14 Aug 2018 16:18:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17E4A1DE26; Tue, 14 Aug 2018 16:18:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EGIuHX077281; Tue, 14 Aug 2018 16:18:56 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGIuOZ077280; Tue, 14 Aug 2018 16:18:56 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201808141618.w7EGIuOZ077280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 14 Aug 2018 16:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337765 - vendor-crypto/openssl/1.0.2p X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-crypto/openssl/1.0.2p X-SVN-Commit-Revision: 337765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:18:57 -0000 Author: jkim Date: Tue Aug 14 16:18:56 2018 New Revision: 337765 URL: https://svnweb.freebsd.org/changeset/base/337765 Log: Tag OpenSSL 1.0.2p. Added: vendor-crypto/openssl/1.0.2p/ - copied from r337764, vendor-crypto/openssl/dist-1.0.2/ From owner-svn-src-all@freebsd.org Tue Aug 14 16:22: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 E47F6107D2B0; Tue, 14 Aug 2018 16:22:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A11177C4F; Tue, 14 Aug 2018 16:22:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B6651DEA7; Tue, 14 Aug 2018 16:22:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EGM42s081252; Tue, 14 Aug 2018 16:22:04 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGM4ve081251; Tue, 14 Aug 2018 16:22:04 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201808141622.w7EGM4ve081251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 14 Aug 2018 16:22:04 +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: r337766 - stable/11/contrib/flex X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/contrib/flex X-SVN-Commit-Revision: 337766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:22:05 -0000 Author: brooks Date: Tue Aug 14 16:22:04 2018 New Revision: 337766 URL: https://svnweb.freebsd.org/changeset/base/337766 Log: MFC r337508: Terminate filter_create_ext() args with NULL, not 0. filter_create_ext() is documented to take a NULL terminated set of arguments. 0 is promoted to an int so this would fail on 64-bit systems if the value was not passed in a register. On all currently supported 64-bit architectures it is. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: stable/11/contrib/flex/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/flex/main.c ============================================================================== --- stable/11/contrib/flex/main.c Tue Aug 14 16:18:56 2018 (r337765) +++ stable/11/contrib/flex/main.c Tue Aug 14 16:22:04 2018 (r337766) @@ -364,7 +364,7 @@ void check_options () output_chain = filter_create_int(NULL, filter_tee_header, headerfilename); if ( !(m4 = getenv("M4"))) m4 = M4; - filter_create_ext(output_chain, m4, "-gP", 0); + filter_create_ext(output_chain, m4, "-gP", NULL); filter_create_int(output_chain, filter_fix_linedirs, NULL); /* For debugging, only run the requested number of filters. */ From owner-svn-src-all@freebsd.org Tue Aug 14 16:22: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 5CB52107D2E1; Tue, 14 Aug 2018 16:22:15 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1342977D53; Tue, 14 Aug 2018 16:22:15 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E89F61DEB1; Tue, 14 Aug 2018 16:22:14 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EGMEYX081305; Tue, 14 Aug 2018 16:22:14 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGMEPn081304; Tue, 14 Aug 2018 16:22:14 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808141622.w7EGMEPn081304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 14 Aug 2018 16:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337767 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 337767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:22:15 -0000 Author: br Date: Tue Aug 14 16:22:14 2018 New Revision: 337767 URL: https://svnweb.freebsd.org/changeset/base/337767 Log: Remove unused code. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/include/riscvreg.h Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Tue Aug 14 16:22:04 2018 (r337766) +++ head/sys/riscv/include/riscvreg.h Tue Aug 14 16:22:14 2018 (r337767) @@ -155,13 +155,6 @@ #define SATP_MODE_SV39 (8ULL << SATP_MODE_S) #define SATP_MODE_SV48 (9ULL << SATP_MODE_S) -#if 0 -/* lowRISC TODO */ -#define NCSRS 4096 -#define CSR_IPI 0x783 -#define CSR_IO_IRQ 0x7c0 /* lowRISC only? */ -#endif - #define XLEN 8 #define INSN_SIZE 4 From owner-svn-src-all@freebsd.org Tue Aug 14 16:25: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 79F06107D44C; Tue, 14 Aug 2018 16:25:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EF8D7802C; Tue, 14 Aug 2018 16:25:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1120B1DFCB; Tue, 14 Aug 2018 16:25:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EGP9EF082197; Tue, 14 Aug 2018 16:25:09 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGP9Li082196; Tue, 14 Aug 2018 16:25:09 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201808141625.w7EGP9Li082196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 14 Aug 2018 16:25: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: r337768 - stable/10/contrib/flex X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/contrib/flex X-SVN-Commit-Revision: 337768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:25:10 -0000 Author: brooks Date: Tue Aug 14 16:25:09 2018 New Revision: 337768 URL: https://svnweb.freebsd.org/changeset/base/337768 Log: MFC r337508: Terminate filter_create_ext() args with NULL, not 0. filter_create_ext() is documented to take a NULL terminated set of arguments. 0 is promoted to an int so this would fail on 64-bit systems if the value was not passed in a register. On all currently supported 64-bit architectures it is. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: stable/10/contrib/flex/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/flex/main.c ============================================================================== --- stable/10/contrib/flex/main.c Tue Aug 14 16:22:14 2018 (r337767) +++ stable/10/contrib/flex/main.c Tue Aug 14 16:25:09 2018 (r337768) @@ -364,7 +364,7 @@ void check_options () output_chain = filter_create_int(NULL, filter_tee_header, headerfilename); if ( !(m4 = getenv("M4"))) m4 = M4; - filter_create_ext(output_chain, m4, "-gP", 0); + filter_create_ext(output_chain, m4, "-gP", NULL); filter_create_int(output_chain, filter_fix_linedirs, NULL); /* For debugging, only run the requested number of filters. */ From owner-svn-src-all@freebsd.org Tue Aug 14 16:26:45 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 5D20C107D4D9; Tue, 14 Aug 2018 16:26:45 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F7B9781DD; Tue, 14 Aug 2018 16:26:45 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4C741DFCD; Tue, 14 Aug 2018 16:26:44 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EGQio3082304; Tue, 14 Aug 2018 16:26:44 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGQi5m082303; Tue, 14 Aug 2018 16:26:44 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808141626.w7EGQi5m082303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 14 Aug 2018 16:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337769 - head/sys/mips/malta X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/mips/malta X-SVN-Commit-Revision: 337769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:26:45 -0000 Author: br Date: Tue Aug 14 16:26:44 2018 New Revision: 337769 URL: https://svnweb.freebsd.org/changeset/base/337769 Log: Avoid repeated address calculation for malta_ap_boot. Submitted by: "James Clarke" Reviewed by: br, arichardson Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16655 Modified: head/sys/mips/malta/asm_malta.S Modified: head/sys/mips/malta/asm_malta.S ============================================================================== --- head/sys/mips/malta/asm_malta.S Tue Aug 14 16:25:09 2018 (r337768) +++ head/sys/mips/malta/asm_malta.S Tue Aug 14 16:26:44 2018 (r337769) @@ -73,13 +73,15 @@ LEAF(malta_ap_wait) jal platform_processor_id nop + PTR_LA t1, malta_ap_boot + 1: - ll t0, malta_ap_boot + ll t0, 0(t1) bne v0, t0, 1b nop move t0, zero - sc t0, malta_ap_boot + sc t0, 0(t1) beqz t0, 1b nop From owner-svn-src-all@freebsd.org Tue Aug 14 16:27: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 88EF5107D51D; Tue, 14 Aug 2018 16:27:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E85F78360; Tue, 14 Aug 2018 16:27: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 2050E1DFDD; Tue, 14 Aug 2018 16:27: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 w7EGRIgv082373; Tue, 14 Aug 2018 16:27:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGRIbE082372; Tue, 14 Aug 2018 16:27:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808141627.w7EGRIbE082372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Aug 2018 16:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337770 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 337770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:27:18 -0000 Author: kib Date: Tue Aug 14 16:27:17 2018 New Revision: 337770 URL: https://svnweb.freebsd.org/changeset/base/337770 Log: Fix typo. Noted by: alc MFC after: 3 days Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Aug 14 16:26:44 2018 (r337769) +++ head/sys/amd64/amd64/pmap.c Tue Aug 14 16:27:17 2018 (r337770) @@ -7485,7 +7485,7 @@ pmap_activate_sw(struct thread *td) * pmap_activate_sw(), from the context switch, is * immune to this race, because interrupts are * disabled (while the thread lock is owned), and IPI - * happends after curpmap is updated. Protect other + * happens after curpmap is updated. Protect other * callers in a similar way, by disabling interrupts * around the %cr3 register reload and curpmap * assignment. From owner-svn-src-all@freebsd.org Tue Aug 14 16:29: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 EACE0107D62F; Tue, 14 Aug 2018 16:29:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0140785E3; Tue, 14 Aug 2018 16:29:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 827391DFEB; Tue, 14 Aug 2018 16:29:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EGTAsN082489; Tue, 14 Aug 2018 16:29:10 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGTA23082488; Tue, 14 Aug 2018 16:29:10 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808141629.w7EGTA23082488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 14 Aug 2018 16:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337771 - head/sys/mips/malta X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/mips/malta X-SVN-Commit-Revision: 337771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:29:11 -0000 Author: br Date: Tue Aug 14 16:29:10 2018 New Revision: 337771 URL: https://svnweb.freebsd.org/changeset/base/337771 Log: Query MVPConf0.PVPE for number of CPUs. Rather than hard-coding the number of CPUs to 2, look up the PVPE field in MVPConf0, as the valid VPE numbers are from 0 to PVPE inclusive. Submitted by: "James Clarke" Reviewed by: br Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16644 Modified: head/sys/mips/malta/malta_mp.c Modified: head/sys/mips/malta/malta_mp.c ============================================================================== --- head/sys/mips/malta/malta_mp.c Tue Aug 14 16:27:17 2018 (r337770) +++ head/sys/mips/malta/malta_mp.c Tue Aug 14 16:29:10 2018 (r337771) @@ -48,9 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include -#define MALTA_MAXCPU 2 #define VPECONF0_VPA (1 << 0) #define MVPCONTROL_VPC (1 << 1) +#define MVPCONF0_PVPE_SHIFT 10 +#define MVPCONF0_PVPE_MASK (0xf << MVPCONF0_PVPE_SHIFT) #define TCSTATUS_A (1 << 13) unsigned malta_ap_boot = ~0; @@ -208,10 +209,13 @@ platform_init_ap(int cpuid) void platform_cpu_mask(cpuset_t *mask) { - uint32_t i, m; + uint32_t i, ncpus, reg; + reg = mftc0(0, 2); + ncpus = ((reg & MVPCONF0_PVPE_MASK) >> MVPCONF0_PVPE_SHIFT) + 1; + CPU_ZERO(mask); - for (i = 0, m = 1 ; i < MALTA_MAXCPU; i++, m <<= 1) + for (i = 0; i < ncpus; i++) CPU_SET(i, mask); } From owner-svn-src-all@freebsd.org Tue Aug 14 16:33: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 EE3CC107D8E0; Tue, 14 Aug 2018 16:33:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F70378F37; Tue, 14 Aug 2018 16:33:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F4EF1E193; Tue, 14 Aug 2018 16:33:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EGXVfk087184; Tue, 14 Aug 2018 16:33:31 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGXUZd087178; Tue, 14 Aug 2018 16:33:30 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808141633.w7EGXUZd087178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 14 Aug 2018 16:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337772 - in head/sys: arm64/conf conf dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: in head/sys: arm64/conf conf dev/sdhci X-SVN-Commit-Revision: 337772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:33:32 -0000 Author: loos Date: Tue Aug 14 16:33:30 2018 New Revision: 337772 URL: https://svnweb.freebsd.org/changeset/base/337772 Log: Add support to the Marvell Xenon SDHCI controller. Tested on Espresso.bin (37x0) and Macchiato.bin (8k) with SD cards and eMMCs. Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Added: head/sys/dev/sdhci/sdhci_xenon.c (contents, props changed) head/sys/dev/sdhci/sdhci_xenon.h (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Aug 14 16:29:10 2018 (r337771) +++ head/sys/arm64/conf/GENERIC Tue Aug 14 16:33:30 2018 (r337772) @@ -159,6 +159,7 @@ device pass # Passthrough device (direct ATA/SCSI ac # MMC/SD/SDIO Card slot support device sdhci +device sdhci_xenon # Marvell Xenon SD/MMC controller device aw_mmc # Allwinner SD/MMC controller device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Aug 14 16:29:10 2018 (r337771) +++ head/sys/conf/files.arm64 Tue Aug 14 16:33:30 2018 (r337772) @@ -211,6 +211,7 @@ dev/pci/pci_host_generic_fdt.c optional pci fdt dev/psci/psci.c standard dev/psci/psci_arm64.S standard dev/psci/smccc.c standard +dev/sdhci/sdhci_xenon.c optional sdhci_xenon sdhci fdt dev/uart/uart_cpu_arm64.c optional uart dev/uart/uart_dev_mu.c optional uart uart_mu dev/uart/uart_dev_pl011.c optional uart pl011 Added: head/sys/dev/sdhci/sdhci_xenon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdhci/sdhci_xenon.c Tue Aug 14 16:33:30 2018 (r337772) @@ -0,0 +1,546 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Marvell Xenon SDHCI controller driver. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "mmcbr_if.h" +#include "sdhci_if.h" + +#define MAX_SLOTS 6 + +static struct ofw_compat_data compat_data[] = { + { "marvell,armada-3700-sdhci", 1 }, + { NULL, 0 } +}; + +struct sdhci_xenon_softc { + device_t dev; /* Controller device */ + int slot_id; /* Controller ID */ + phandle_t node; /* FDT node */ + uint32_t quirks; /* Chip specific quirks */ + uint32_t caps; /* If we override SDHCI_CAPABILITIES */ + uint32_t max_clk; /* Max possible freq */ + struct resource *irq_res; /* IRQ resource */ + void *intrhand; /* Interrupt handle */ + + struct sdhci_slot *slot; /* SDHCI internal data */ + struct resource *mem_res; /* Memory resource */ + + uint8_t znr; /* PHY ZNR */ + uint8_t zpr; /* PHY ZPR */ + bool no_18v; /* No 1.8V support */ + bool slow_mode; /* PHY slow mode */ + bool wp_inverted; /* WP pin is inverted */ +}; + +static uint8_t +sdhci_xenon_read_1(device_t dev, struct sdhci_slot *slot __unused, + bus_size_t off) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + + return (bus_read_1(sc->mem_res, off)); +} + +static void +sdhci_xenon_write_1(device_t dev, struct sdhci_slot *slot __unused, + bus_size_t off, uint8_t val) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + + bus_write_1(sc->mem_res, off, val); +} + +static uint16_t +sdhci_xenon_read_2(device_t dev, struct sdhci_slot *slot __unused, + bus_size_t off) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + + return (bus_read_2(sc->mem_res, off)); +} + +static void +sdhci_xenon_write_2(device_t dev, struct sdhci_slot *slot __unused, + bus_size_t off, uint16_t val) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + + bus_write_2(sc->mem_res, off, val); +} + +static uint32_t +sdhci_xenon_read_4(device_t dev, struct sdhci_slot *slot __unused, + bus_size_t off) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + uint32_t val32; + + val32 = bus_read_4(sc->mem_res, off); + if (off == SDHCI_CAPABILITIES && sc->no_18v) + val32 &= ~SDHCI_CAN_VDD_180; + + return (val32); +} + +static void +sdhci_xenon_write_4(device_t dev, struct sdhci_slot *slot __unused, + bus_size_t off, uint32_t val) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + + bus_write_4(sc->mem_res, off, val); +} + +static void +sdhci_xenon_read_multi_4(device_t dev, struct sdhci_slot *slot __unused, + bus_size_t off, uint32_t *data, bus_size_t count) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + + bus_read_multi_4(sc->mem_res, off, data, count); +} + +static void +sdhci_xenon_write_multi_4(device_t dev, struct sdhci_slot *slot __unused, + bus_size_t off, uint32_t *data, bus_size_t count) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + + bus_write_multi_4(sc->mem_res, off, data, count); +} + +static void +sdhci_xenon_intr(void *arg) +{ + struct sdhci_xenon_softc *sc = (struct sdhci_xenon_softc *)arg; + + sdhci_generic_intr(sc->slot); +} + +static int +sdhci_xenon_get_ro(device_t bus, device_t dev) +{ + struct sdhci_xenon_softc *sc = device_get_softc(bus); + + return (sdhci_generic_get_ro(bus, dev) ^ sc->wp_inverted); +} + +static int +sdhci_xenon_phy_init(device_t brdev, struct mmc_ios *ios) +{ + int i; + struct sdhci_xenon_softc *sc; + uint32_t reg; + + sc = device_get_softc(brdev); + reg = bus_read_4(sc->mem_res, XENON_EMMC_PHY_TIMING_ADJUST); + reg |= XENON_SAMPL_INV_QSP_PHASE_SELECT; + switch (ios->timing) { + case bus_timing_normal: + case bus_timing_hs: + case bus_timing_uhs_sdr12: + case bus_timing_uhs_sdr25: + case bus_timing_uhs_sdr50: + reg |= XENON_TIMING_ADJUST_SLOW_MODE; + break; + default: + reg &= ~XENON_TIMING_ADJUST_SLOW_MODE; + } + if (sc->slow_mode) + reg |= XENON_TIMING_ADJUST_SLOW_MODE; + bus_write_4(sc->mem_res, XENON_EMMC_PHY_TIMING_ADJUST, reg); + + reg = bus_read_4(sc->mem_res, XENON_EMMC_PHY_TIMING_ADJUST); + reg |= XENON_PHY_INITIALIZATION; + bus_write_4(sc->mem_res, XENON_EMMC_PHY_TIMING_ADJUST, reg); + + /* Wait for the eMMC PHY init. */ + for (i = 100; i > 0; i--) { + DELAY(100); + + reg = bus_read_4(sc->mem_res, XENON_EMMC_PHY_TIMING_ADJUST); + if ((reg & XENON_PHY_INITIALIZATION) == 0) + break; + } + + if (i == 0) { + device_printf(brdev, "eMMC PHY failed to initialize\n"); + return (ETIMEDOUT); + } + + return (0); +} + +static int +sdhci_xenon_phy_set(device_t brdev, struct mmc_ios *ios) +{ + struct sdhci_xenon_softc *sc; + uint32_t reg; + + sc = device_get_softc(brdev); + /* Setup pad, set bit[28] and bits[26:24] */ + reg = bus_read_4(sc->mem_res, XENON_EMMC_PHY_PAD_CONTROL); + reg |= (XENON_FC_DQ_RECEN | XENON_FC_CMD_RECEN | + XENON_FC_QSP_RECEN | XENON_OEN_QSN); + /* All FC_XX_RECEIVCE should be set as CMOS Type */ + reg |= XENON_FC_ALL_CMOS_RECEIVER; + bus_write_4(sc->mem_res, XENON_EMMC_PHY_PAD_CONTROL, reg); + + /* Set CMD and DQ Pull Up */ + reg = bus_read_4(sc->mem_res, XENON_EMMC_PHY_PAD_CONTROL1); + reg |= (XENON_EMMC_FC_CMD_PU | XENON_EMMC_FC_DQ_PU); + reg &= ~(XENON_EMMC_FC_CMD_PD | XENON_EMMC_FC_DQ_PD); + bus_write_4(sc->mem_res, XENON_EMMC_PHY_PAD_CONTROL1, reg); + + if (ios->timing == bus_timing_normal) + return (sdhci_xenon_phy_init(brdev, ios)); + + /* Clear SDIO mode, no SDIO support for now. */ + reg = bus_read_4(sc->mem_res, XENON_EMMC_PHY_TIMING_ADJUST); + reg &= ~XENON_TIMING_ADJUST_SDIO_MODE; + bus_write_4(sc->mem_res, XENON_EMMC_PHY_TIMING_ADJUST, reg); + + /* + * Set preferred ZNR and ZPR value. + * The ZNR and ZPR value vary between different boards. + * Define them both in the DTS for the board! + */ + reg = bus_read_4(sc->mem_res, XENON_EMMC_PHY_PAD_CONTROL2); + reg &= ~((XENON_ZNR_MASK << XENON_ZNR_SHIFT) | XENON_ZPR_MASK); + reg |= ((sc->znr << XENON_ZNR_SHIFT) | sc->zpr); + bus_write_4(sc->mem_res, XENON_EMMC_PHY_PAD_CONTROL2, reg); + + /* Disable the SD clock to set EMMC_PHY_FUNC_CONTROL. */ + reg = bus_read_4(sc->mem_res, SDHCI_CLOCK_CONTROL); + reg &= ~SDHCI_CLOCK_CARD_EN; + bus_write_4(sc->mem_res, SDHCI_CLOCK_CONTROL, reg); + + reg = bus_read_4(sc->mem_res, XENON_EMMC_PHY_FUNC_CONTROL); + switch (ios->timing) { + case bus_timing_mmc_hs400: + reg |= (XENON_DQ_DDR_MODE_MASK << XENON_DQ_DDR_MODE_SHIFT) | + XENON_CMD_DDR_MODE; + reg &= ~XENON_DQ_ASYNC_MODE; + break; + case bus_timing_uhs_ddr50: + case bus_timing_mmc_ddr52: + reg |= (XENON_DQ_DDR_MODE_MASK << XENON_DQ_DDR_MODE_SHIFT) | + XENON_CMD_DDR_MODE | XENON_DQ_ASYNC_MODE; + break; + default: + reg &= ~((XENON_DQ_DDR_MODE_MASK << XENON_DQ_DDR_MODE_SHIFT) | + XENON_CMD_DDR_MODE); + reg |= XENON_DQ_ASYNC_MODE; + } + bus_write_4(sc->mem_res, XENON_EMMC_PHY_FUNC_CONTROL, reg); + + /* Enable SD clock. */ + reg = bus_read_4(sc->mem_res, SDHCI_CLOCK_CONTROL); + reg |= SDHCI_CLOCK_CARD_EN; + bus_write_4(sc->mem_res, SDHCI_CLOCK_CONTROL, reg); + + if (ios->timing == bus_timing_mmc_hs400) + bus_write_4(sc->mem_res, XENON_EMMC_PHY_LOGIC_TIMING_ADJUST, + XENON_LOGIC_TIMING_VALUE); + else { + /* Disable both SDHC Data Strobe and Enhanced Strobe. */ + reg = bus_read_4(sc->mem_res, XENON_SLOT_EMMC_CTRL); + reg &= ~(XENON_ENABLE_DATA_STROBE | XENON_ENABLE_RESP_STROBE); + bus_write_4(sc->mem_res, XENON_SLOT_EMMC_CTRL, reg); + + /* Clear Strobe line Pull down or Pull up. */ + reg = bus_read_4(sc->mem_res, XENON_EMMC_PHY_PAD_CONTROL1); + reg &= ~(XENON_EMMC_FC_QSP_PD | XENON_EMMC_FC_QSP_PU); + bus_write_4(sc->mem_res, XENON_EMMC_PHY_PAD_CONTROL1, reg); + } + + return (sdhci_xenon_phy_init(brdev, ios)); +} + +static int +sdhci_xenon_update_ios(device_t brdev, device_t reqdev) +{ + int err; + struct sdhci_xenon_softc *sc; + struct mmc_ios *ios; + struct sdhci_slot *slot; + uint32_t reg; + + err = sdhci_generic_update_ios(brdev, reqdev); + if (err != 0) + return (err); + + sc = device_get_softc(brdev); + slot = device_get_ivars(reqdev); + ios = &slot->host.ios; + + /* Update the PHY settings. */ + if (ios->clock != 0) + sdhci_xenon_phy_set(brdev, ios); + + if (ios->clock > SD_MMC_CARD_ID_FREQUENCY) { + /* Enable SDCLK_IDLEOFF. */ + reg = bus_read_4(sc->mem_res, XENON_SYS_OP_CTRL); + reg |= 1 << (XENON_SDCLK_IDLEOFF_ENABLE_SHIFT + sc->slot_id); + bus_write_4(sc->mem_res, XENON_SYS_OP_CTRL, reg); + } + + return (0); +} + +static int +sdhci_xenon_probe(device_t dev) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + pcell_t cid; + + sc->quirks = 0; + sc->slot_id = 0; + sc->max_clk = XENON_MMC_MAX_CLK; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + sc->node = ofw_bus_get_node(dev); + device_set_desc(dev, "Armada Xenon SDHCI controller"); + + /* Allow dts to patch quirks, slots, and max-frequency. */ + if ((OF_getencprop(sc->node, "quirks", &cid, sizeof(cid))) > 0) + sc->quirks = cid; + if ((OF_getencprop(sc->node, "max-frequency", &cid, sizeof(cid))) > 0) + sc->max_clk = cid; + if (OF_hasprop(sc->node, "no-1-8-v")) + sc->no_18v = true; + if (OF_hasprop(sc->node, "wp-inverted")) + sc->wp_inverted = true; + if (OF_hasprop(sc->node, "marvell,xenon-phy-slow-mode")) + sc->slow_mode = true; + sc->znr = XENON_ZNR_DEF_VALUE; + if ((OF_getencprop(sc->node, "marvell,xenon-phy-znr", &cid, + sizeof(cid))) > 0) + sc->znr = cid & XENON_ZNR_MASK; + sc->zpr = XENON_ZPR_DEF_VALUE; + if ((OF_getencprop(sc->node, "marvell,xenon-phy-zpr", &cid, + sizeof(cid))) > 0) + sc->zpr = cid & XENON_ZPR_MASK; + + return (0); +} + +static int +sdhci_xenon_attach(device_t dev) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + struct sdhci_slot *slot; + int err, rid; + uint32_t reg; + + sc->dev = dev; + + /* Allocate IRQ. */ + rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "Can't allocate IRQ\n"); + return (ENOMEM); + } + + /* Allocate memory. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->mem_res == NULL) { + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(sc->irq_res), sc->irq_res); + device_printf(dev, "Can't allocate memory for slot\n"); + return (ENOMEM); + } + + slot = malloc(sizeof(*slot), M_DEVBUF, M_ZERO | M_WAITOK); + + /* Check if the device is flagged as non-removable. */ + if (OF_hasprop(sc->node, "non-removable")) { + slot->opt |= SDHCI_NON_REMOVABLE; + if (bootverbose) + device_printf(dev, "Non-removable media\n"); + } + + slot->quirks = sc->quirks; + slot->caps = sc->caps; + slot->max_clk = sc->max_clk; + sc->slot = slot; + + if (sdhci_init_slot(dev, sc->slot, 0)) + goto fail; + + /* Activate the interrupt */ + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, sdhci_xenon_intr, sc, &sc->intrhand); + if (err) { + device_printf(dev, "Cannot setup IRQ\n"); + goto fail; + } + + /* Disable Auto Clock Gating. */ + reg = bus_read_4(sc->mem_res, XENON_SYS_OP_CTRL); + reg |= XENON_AUTO_CLKGATE_DISABLE; + bus_write_4(sc->mem_res, XENON_SYS_OP_CTRL, reg); + + /* Enable this SD controller. */ + reg |= (1 << sc->slot_id); + bus_write_4(sc->mem_res, XENON_SYS_OP_CTRL, reg); + + /* Enable Parallel Transfer. */ + reg = bus_read_4(sc->mem_res, XENON_SYS_EXT_OP_CTRL); + reg |= (1 << sc->slot_id); + bus_write_4(sc->mem_res, XENON_SYS_EXT_OP_CTRL, reg); + + /* Enable Auto Clock Gating. */ + reg &= ~XENON_AUTO_CLKGATE_DISABLE; + bus_write_4(sc->mem_res, XENON_SYS_OP_CTRL, reg); + + /* Disable SDCLK_IDLEOFF before the card initialization. */ + reg = bus_read_4(sc->mem_res, XENON_SYS_OP_CTRL); + reg &= ~(1 << (XENON_SDCLK_IDLEOFF_ENABLE_SHIFT + sc->slot_id)); + bus_write_4(sc->mem_res, XENON_SYS_OP_CTRL, reg); + + /* Mask command conflict errors. */ + reg = bus_read_4(sc->mem_res, XENON_SYS_EXT_OP_CTRL); + reg |= XENON_MASK_CMD_CONFLICT_ERR; + bus_write_4(sc->mem_res, XENON_SYS_EXT_OP_CTRL, reg); + + /* Process cards detection. */ + sdhci_start_slot(sc->slot); + + return (0); + +fail: + bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq_res), + sc->irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->mem_res), + sc->mem_res); + free(sc->slot, M_DEVBUF); + sc->slot = NULL; + + return (ENXIO); +} + +static int +sdhci_xenon_detach(device_t dev) +{ + struct sdhci_xenon_softc *sc = device_get_softc(dev); + + bus_generic_detach(dev); + bus_teardown_intr(dev, sc->irq_res, sc->intrhand); + bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq_res), + sc->irq_res); + sdhci_cleanup_slot(sc->slot); + bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->mem_res), + sc->mem_res); + free(sc->slot, M_DEVBUF); + sc->slot = NULL; + + return (0); +} + +static device_method_t sdhci_xenon_methods[] = { + /* device_if */ + DEVMETHOD(device_probe, sdhci_xenon_probe), + DEVMETHOD(device_attach, sdhci_xenon_attach), + DEVMETHOD(device_detach, sdhci_xenon_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), + DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), + + /* mmcbr_if */ + DEVMETHOD(mmcbr_update_ios, sdhci_xenon_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, sdhci_xenon_get_ro), + DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), + DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + + /* SDHCI registers accessors */ + DEVMETHOD(sdhci_read_1, sdhci_xenon_read_1), + DEVMETHOD(sdhci_read_2, sdhci_xenon_read_2), + DEVMETHOD(sdhci_read_4, sdhci_xenon_read_4), + DEVMETHOD(sdhci_read_multi_4, sdhci_xenon_read_multi_4), + DEVMETHOD(sdhci_write_1, sdhci_xenon_write_1), + DEVMETHOD(sdhci_write_2, sdhci_xenon_write_2), + DEVMETHOD(sdhci_write_4, sdhci_xenon_write_4), + DEVMETHOD(sdhci_write_multi_4, sdhci_xenon_write_multi_4), + + DEVMETHOD_END +}; + +static driver_t sdhci_xenon_driver = { + "sdhci_xenon", + sdhci_xenon_methods, + sizeof(struct sdhci_xenon_softc), +}; +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); +MMC_DECLARE_BRIDGE(sdhci_xenon); Added: head/sys/dev/sdhci/sdhci_xenon.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdhci/sdhci_xenon.h Tue Aug 14 16:33:30 2018 (r337772) @@ -0,0 +1,100 @@ +/*- + * Copyright (c) 2018 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Marvel Xenon SDHCI driver defines. + */ + +#ifndef _SDHCI_XENON_H_ +#define _SDHCI_XENON_H_ + +#define XENON_LOWEST_SDCLK_FREQ 100000 +#define XENON_MMC_MAX_CLK 400000000 + +#define XENON_SYS_OP_CTRL 0x0108 +#define XENON_AUTO_CLKGATE_DISABLE (1 << 20) +#define XENON_SDCLK_IDLEOFF_ENABLE_SHIFT 8 + +#define XENON_SYS_EXT_OP_CTRL 0x010C +#define XENON_MASK_CMD_CONFLICT_ERR (1 << 8) + +#define XENON_SLOT_EMMC_CTRL 0x0130 +#define XENON_ENABLE_DATA_STROBE (1 << 24) +#define XENON_ENABLE_RESP_STROBE (1 << 25) + +/* eMMC PHY */ +#define XENON_EMMC_PHY_REG_BASE 0x170 + +#define XENON_EMMC_PHY_TIMING_ADJUST XENON_EMMC_PHY_REG_BASE +#define XENON_SAMPL_INV_QSP_PHASE_SELECT (1 << 18) +#define XENON_TIMING_ADJUST_SDIO_MODE (1 << 28) +#define XENON_TIMING_ADJUST_SLOW_MODE (1 << 29) +#define XENON_PHY_INITIALIZATION (1U << 31) +#define XENON_WAIT_CYCLE_BEFORE_USING_MASK 0xF +#define XENON_WAIT_CYCLE_BEFORE_USING_SHIFT 12 +#define XENON_FC_SYNC_EN_DURATION_MASK 0xF +#define XENON_FC_SYNC_EN_DURATION_SHIFT 8 +#define XENON_FC_SYNC_RST_EN_DURATION_MASK 0xF +#define XENON_FC_SYNC_RST_EN_DURATION_SHIFT 4 +#define XENON_FC_SYNC_RST_DURATION_MASK 0xF +#define XENON_FC_SYNC_RST_DURATION_SHIFT 0 + +#define XENON_EMMC_PHY_FUNC_CONTROL (XENON_EMMC_PHY_REG_BASE + 0x4) +#define XENON_DQ_ASYNC_MODE (1 << 4) +#define XENON_CMD_DDR_MODE (1 << 16) +#define XENON_DQ_DDR_MODE_SHIFT 8 +#define XENON_DQ_DDR_MODE_MASK 0xFF +#define XENON_ASYNC_DDRMODE_MASK (1 << 23) +#define XENON_ASYNC_DDRMODE_SHIFT 23 + +#define XENON_EMMC_PHY_PAD_CONTROL (XENON_EMMC_PHY_REG_BASE + 0x8) +#define XENON_FC_DQ_RECEN (1 << 24) +#define XENON_FC_CMD_RECEN (1 << 25) +#define XENON_FC_QSP_RECEN (1 << 26) +#define XENON_FC_QSN_RECEN (1 << 27) +#define XENON_OEN_QSN (1 << 28) +#define XENON_FC_ALL_CMOS_RECEIVER 0xF000 + +#define XENON_EMMC_PHY_PAD_CONTROL1 (XENON_EMMC_PHY_REG_BASE + 0xC) +#define XENON_EMMC_FC_CMD_PD (1 << 8) +#define XENON_EMMC_FC_QSP_PD (1 << 9) +#define XENON_EMMC_FC_CMD_PU (1 << 24) +#define XENON_EMMC_FC_QSP_PU (1 << 25) +#define XENON_EMMC_FC_DQ_PD 0xFF +#define XENON_EMMC_FC_DQ_PU (0xFF << 16) + +#define XENON_EMMC_PHY_PAD_CONTROL2 (XENON_EMMC_PHY_REG_BASE + 0x10) +#define XENON_ZNR_MASK 0x1F +#define XENON_ZNR_SHIFT 8 +#define XENON_ZPR_MASK 0x1F +#define XENON_ZNR_DEF_VALUE 0xF +#define XENON_ZPR_DEF_VALUE 0xF + +#define XENON_EMMC_PHY_LOGIC_TIMING_ADJUST (XENON_EMMC_PHY_REG_BASE + 0x18) +#define XENON_LOGIC_TIMING_VALUE 0x00AA8977 + +#endif /* _SDHCI_XENON_H_ */ From owner-svn-src-all@freebsd.org Tue Aug 14 16:37:16 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 2BF8C107DA87; Tue, 14 Aug 2018 16:37:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D44A17923F; Tue, 14 Aug 2018 16:37:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B12E81E19D; Tue, 14 Aug 2018 16:37:15 +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 w7EGbFK5087564; Tue, 14 Aug 2018 16:37:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EGbFpZ087559; Tue, 14 Aug 2018 16:37:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808141637.w7EGbFpZ087559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Aug 2018 16:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337773 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 337773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 16:37:16 -0000 Author: kib Date: Tue Aug 14 16:37:14 2018 New Revision: 337773 URL: https://svnweb.freebsd.org/changeset/base/337773 Log: amd64: ensure that curproc->p_vmspace pmap always matches PCPU curpmap. When performing context switch on a machine without PCID, if current %cr3 equals to the new pmap %cr3, which is typical for kernel_pmap vs. kernel process, I overlooked to update PCPU curpmap value. Remove check for %cr3 not equal to pm_cr3 for doing the update. It is believed that this case cannot happen at all, due to other changes in this revision. Also, do not set the very first curpmap to kernel_pmap, it should be vmspace0 pmap instead to match curproc. Move the common code to activate the initial pmap both on BSP and APs into pmap_activate_boot() helper. Reported by: eadler, ambrisko Discussed with: kevans Reviewed by: alc, markj (previous version) Tested by: ambrisko (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16618 Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue Aug 14 16:33:30 2018 (r337772) +++ head/sys/amd64/amd64/mp_machdep.c Tue Aug 14 16:37:14 2018 (r337773) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -297,7 +298,6 @@ init_secondary(void) pc->pc_gs32p = &gdt[NGDT * cpu + GUGS32_SEL]; pc->pc_ldt = (struct system_segment_descriptor *)&gdt[NGDT * cpu + GUSERLDT_SEL]; - pc->pc_curpmap = kernel_pmap; pc->pc_pcid_gen = 1; pc->pc_pcid_next = PMAP_PCID_KERN + 1; common_tss[cpu].tss_rsp0 = 0; @@ -342,6 +342,7 @@ init_secondary(void) while (atomic_load_acq_int(&aps_ready) == 0) ia32_pause(); + pmap_activate_boot(vmspace_pmap(proc0.p_vmspace)); init_secondary_tail(); } Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Aug 14 16:33:30 2018 (r337772) +++ head/sys/amd64/amd64/pmap.c Tue Aug 14 16:37:14 2018 (r337773) @@ -2655,9 +2655,7 @@ pmap_pinit0(pmap_t pmap) __pcpu[i].pc_ucr3 = PMAP_NO_CR3; } } - PCPU_SET(curpmap, kernel_pmap); - pmap_activate(curthread); - CPU_FILL(&kernel_pmap->pm_active); + pmap_activate_boot(pmap); } void @@ -7529,7 +7527,7 @@ pmap_activate_sw(struct thread *td) intr_restore(rflags); if (cached) PCPU_INC(pm_save_cnt); - } else if (cr3 != pmap->pm_cr3) { + } else { load_cr3(pmap->pm_cr3); PCPU_SET(curpmap, pmap); if (pti) { @@ -7557,6 +7555,26 @@ pmap_activate(struct thread *td) critical_enter(); pmap_activate_sw(td); critical_exit(); +} + +void +pmap_activate_boot(pmap_t pmap) +{ + u_int cpuid; + + /* + * kernel_pmap must be never deactivated, and we ensure that + * by never activating it at all. + */ + MPASS(pmap != kernel_pmap); + + cpuid = PCPU_GET(cpuid); +#ifdef SMP + CPU_SET_ATOMIC(cpuid, &pmap->pm_active); +#else + CPU_SET(cpuid, &pmap->pm_active); +#endif + PCPU_SET(curpmap, pmap); } void Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Tue Aug 14 16:33:30 2018 (r337772) +++ head/sys/amd64/include/pmap.h Tue Aug 14 16:37:14 2018 (r337773) @@ -407,6 +407,7 @@ extern int invpcid_works; struct thread; +void pmap_activate_boot(pmap_t pmap); void pmap_activate_sw(struct thread *); void pmap_bootstrap(vm_paddr_t *); int pmap_cache_bits(pmap_t pmap, int mode, boolean_t is_pde); From owner-svn-src-all@freebsd.org Tue Aug 14 17:14: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 BF6F8107E79D; Tue, 14 Aug 2018 17:14: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 730757B626; Tue, 14 Aug 2018 17:14: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 541121E832; Tue, 14 Aug 2018 17:14: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 w7EHEY4R010747; Tue, 14 Aug 2018 17:14:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHEY2j010746; Tue, 14 Aug 2018 17:14:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808141714.w7EHEY2j010746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Aug 2018 17:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337774 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 337774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:14:34 -0000 Author: kib Date: Tue Aug 14 17:14:33 2018 New Revision: 337774 URL: https://svnweb.freebsd.org/changeset/base/337774 Log: Reserve page at the physical address zero on amd64. We always zero the invalidated PTE/PDE for superpage, which means that L1TF CPU vulnerability (CVE-2018-3620) can be only used for reading from the page at zero. Note that both i386 and amd64 exclude the page from phys_avail[] array, so this change is redundant, but I think that phys_avail[] on UEFI-boot does not need to do that. Eventually the blacklisting should be made conditional on CPUs which report that they are not vulnerable to L1TF. Reviewed by: emaste. jhb Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Aug 14 16:37:14 2018 (r337773) +++ head/sys/amd64/amd64/pmap.c Tue Aug 14 17:14:33 2018 (r337774) @@ -1307,6 +1307,9 @@ pmap_init(void) vm_size_t s; int error, i, pv_npg, ret, skz63; + /* L1TF, reserve page @0 unconditionally */ + vm_page_blacklist_add(0, bootverbose); + /* Detect bare-metal Skylake Server and Skylake-X. */ if (vm_guest == VM_GUEST_NO && cpu_vendor_id == CPU_VENDOR_INTEL && CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) == 0x55) { From owner-svn-src-all@freebsd.org Tue Aug 14 17:15:48 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 01763107E819; Tue, 14 Aug 2018 17:15:48 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABAE17B77C; Tue, 14 Aug 2018 17:15:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CB6C1E833; Tue, 14 Aug 2018 17:15:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHFlLF010847; Tue, 14 Aug 2018 17:15:47 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHFlRK010846; Tue, 14 Aug 2018 17:15:47 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141715.w7EHFlRK010846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337775 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:15:48 -0000 Author: jtl Date: Tue Aug 14 17:15:47 2018 New Revision: 337775 URL: https://svnweb.freebsd.org/changeset/base/337775 Log: Improve hashing of IPv4 fragments. Currently, IPv4 fragments are hashed into buckets based on a 32-bit key which is calculated by (src_ip ^ ip_id) and combined with a random seed. However, because an attacker can control the values of src_ip and ip_id, it is possible to construct an attack which causes very deep chains to form in a given bucket. To ensure more uniform distribution (and lower predictability for an attacker), calculate the hash based on a key which includes all the fields we use to identify a reassembly queue (dst_ip, src_ip, ip_id, and the ip protocol) as well as a random seed. Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet/ip_reass.c Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Tue Aug 14 17:14:33 2018 (r337774) +++ head/sys/netinet/ip_reass.c Tue Aug 14 17:15:47 2018 (r337775) @@ -148,7 +148,7 @@ ip_reass(struct mbuf *m) struct ipqhead *head; int i, hlen, next; u_int8_t ecn, ecn0; - uint32_t hash; + uint32_t hash, hashkey[3]; #ifdef RSS uint32_t rss_hash, rss_type; #endif @@ -202,8 +202,12 @@ ip_reass(struct mbuf *m) m->m_data += hlen; m->m_len -= hlen; - hash = ip->ip_src.s_addr ^ ip->ip_id; - hash = jenkins_hash32(&hash, 1, V_ipq_hashseed) & IPREASS_HMASK; + hashkey[0] = ip->ip_src.s_addr; + hashkey[1] = ip->ip_dst.s_addr; + hashkey[2] = (uint32_t)ip->ip_p << 16; + hashkey[2] += ip->ip_id; + hash = jenkins_hash32(hashkey, nitems(hashkey), V_ipq_hashseed); + hash &= IPREASS_HMASK; head = &V_ipq[hash].head; IPQ_LOCK(hash); From owner-svn-src-all@freebsd.org Tue Aug 14 17:17: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 B6AFD107E938; Tue, 14 Aug 2018 17:17:38 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 602F37B9A7; Tue, 14 Aug 2018 17:17:38 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D0961E834; Tue, 14 Aug 2018 17:17:38 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHHca0010972; Tue, 14 Aug 2018 17:17:38 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHHcPf010971; Tue, 14 Aug 2018 17:17:38 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141717.w7EHHcPf010971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337776 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 337776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:17:39 -0000 Author: jtl Date: Tue Aug 14 17:17:37 2018 New Revision: 337776 URL: https://svnweb.freebsd.org/changeset/base/337776 Log: Improve IPv6 reassembly performance by hashing fragments into buckets. Currently, all IPv6 fragment reassembly queues are kept in a flat linked list. This has a number of implications. Two significant implications are: all reassembly operations share a common lock, and it is possible for the linked list to grow quite large. Improve IPv6 reassembly performance by hashing fragments into buckets, each of which has its own lock. Calculate the hash key using a Jenkins hash with a random seed. Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue Aug 14 17:15:47 2018 (r337775) +++ head/sys/netinet6/frag6.c Tue Aug 14 17:17:37 2018 (r337776) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -49,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -65,29 +68,41 @@ __FBSDID("$FreeBSD$"); #include -static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *); -static void frag6_deq(struct ip6asfrag *); -static void frag6_insque(struct ip6q *, struct ip6q *); -static void frag6_remque(struct ip6q *); -static void frag6_freef(struct ip6q *); - -static struct mtx ip6qlock; /* - * These fields all protected by ip6qlock. + * Reassembly headers are stored in hash buckets. */ -VNET_DEFINE_STATIC(u_int, frag6_nfragpackets); -VNET_DEFINE_STATIC(u_int, frag6_nfrags); -VNET_DEFINE_STATIC(struct ip6q, ip6q); /* ip6 reassemble queue */ +#define IP6REASS_NHASH_LOG2 6 +#define IP6REASS_NHASH (1 << IP6REASS_NHASH_LOG2) +#define IP6REASS_HMASK (IP6REASS_NHASH - 1) +static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *, + uint32_t bucket __unused); +static void frag6_deq(struct ip6asfrag *, uint32_t bucket __unused); +static void frag6_insque_head(struct ip6q *, struct ip6q *, + uint32_t bucket __unused); +static void frag6_remque(struct ip6q *, uint32_t bucket __unused); +static void frag6_freef(struct ip6q *, uint32_t bucket); + +struct ip6qbucket { + struct ip6q ip6q; + struct mtx lock; +}; + +VNET_DEFINE_STATIC(volatile u_int, frag6_nfragpackets); +VNET_DEFINE_STATIC(volatile u_int, frag6_nfrags); +VNET_DEFINE_STATIC(struct ip6qbucket, ip6q[IP6REASS_NHASH]); +VNET_DEFINE_STATIC(uint32_t, ip6q_hashseed); + #define V_frag6_nfragpackets VNET(frag6_nfragpackets) #define V_frag6_nfrags VNET(frag6_nfrags) #define V_ip6q VNET(ip6q) +#define V_ip6q_hashseed VNET(ip6q_hashseed) -#define IP6Q_LOCK_INIT() mtx_init(&ip6qlock, "ip6qlock", NULL, MTX_DEF); -#define IP6Q_LOCK() mtx_lock(&ip6qlock) -#define IP6Q_TRYLOCK() mtx_trylock(&ip6qlock) -#define IP6Q_LOCK_ASSERT() mtx_assert(&ip6qlock, MA_OWNED) -#define IP6Q_UNLOCK() mtx_unlock(&ip6qlock) +#define IP6Q_LOCK(i) mtx_lock(&V_ip6q[(i)].lock) +#define IP6Q_TRYLOCK(i) mtx_trylock(&V_ip6q[(i)].lock) +#define IP6Q_LOCK_ASSERT(i) mtx_assert(&V_ip6q[(i)].lock, MA_OWNED) +#define IP6Q_UNLOCK(i) mtx_unlock(&V_ip6q[(i)].lock) +#define IP6Q_HEAD(i) (&V_ip6q[(i)].ip6q) static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment reassembly header"); @@ -105,18 +120,22 @@ frag6_change(void *tag) void frag6_init(void) { + struct ip6q *q6; + int i; V_ip6_maxfragpackets = nmbclusters / 4; V_ip6_maxfrags = nmbclusters / 4; - V_ip6q.ip6q_next = V_ip6q.ip6q_prev = &V_ip6q; - + for (i = 0; i < IP6REASS_NHASH; i++) { + q6 = IP6Q_HEAD(i); + q6->ip6q_next = q6->ip6q_prev = q6; + mtx_init(&V_ip6q[i].lock, "ip6qlock", NULL, MTX_DEF); + } + V_ip6q_hashseed = arc4random(); if (!IS_DEFAULT_VNET(curvnet)) return; EVENTHANDLER_REGISTER(nmbclusters_change, frag6_change, NULL, EVENTHANDLER_PRI_ANY); - - IP6Q_LOCK_INIT(); } /* @@ -157,12 +176,13 @@ frag6_input(struct mbuf **mp, int *offp, int proto) struct mbuf *m = *mp, *t; struct ip6_hdr *ip6; struct ip6_frag *ip6f; - struct ip6q *q6; + struct ip6q *head, *q6; struct ip6asfrag *af6, *ip6af, *af6dwn; struct in6_ifaddr *ia; int offset = *offp, nxt, i, next; int first_frag = 0; int fragoff, frgpartlen; /* must be larger than u_int16_t */ + uint32_t hash, hashkey[sizeof(struct in6_addr) * 2 + 1], *hashkeyp; struct ifnet *dstifp; u_int8_t ecn, ecn0; #ifdef RSS @@ -231,7 +251,16 @@ frag6_input(struct mbuf **mp, int *offp, int proto) return (ip6f->ip6f_nxt); } - IP6Q_LOCK(); + hashkeyp = hashkey; + memcpy(hashkeyp, &ip6->ip6_src, sizeof(struct in6_addr)); + hashkeyp += sizeof(struct in6_addr) / sizeof(*hashkeyp); + memcpy(hashkeyp, &ip6->ip6_dst, sizeof(struct in6_addr)); + hashkeyp += sizeof(struct in6_addr) / sizeof(*hashkeyp); + *hashkeyp = ip6f->ip6f_ident; + hash = jenkins_hash32(hashkey, nitems(hashkey), V_ip6q_hashseed); + hash &= IP6REASS_HMASK; + head = IP6Q_HEAD(hash); + IP6Q_LOCK(hash); /* * Enforce upper bound on number of fragments. @@ -240,10 +269,10 @@ frag6_input(struct mbuf **mp, int *offp, int proto) */ if (V_ip6_maxfrags < 0) ; - else if (V_frag6_nfrags >= (u_int)V_ip6_maxfrags) + else if (atomic_load_int(&V_frag6_nfrags) >= (u_int)V_ip6_maxfrags) goto dropfrag; - for (q6 = V_ip6q.ip6q_next; q6 != &V_ip6q; q6 = q6->ip6q_next) + for (q6 = head->ip6q_next; q6 != head; q6 = q6->ip6q_next) if (ip6f->ip6f_ident == q6->ip6q_ident && IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &q6->ip6q_src) && IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &q6->ip6q_dst) @@ -253,7 +282,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) ) break; - if (q6 == &V_ip6q) { + if (q6 == head) { /* * the first fragment to arrive, create a reassembly queue. */ @@ -268,9 +297,10 @@ frag6_input(struct mbuf **mp, int *offp, int proto) */ if (V_ip6_maxfragpackets < 0) ; - else if (V_frag6_nfragpackets >= (u_int)V_ip6_maxfragpackets) + else if (atomic_load_int(&V_frag6_nfragpackets) >= + (u_int)V_ip6_maxfragpackets) goto dropfrag; - V_frag6_nfragpackets++; + atomic_add_int(&V_frag6_nfragpackets, 1); q6 = (struct ip6q *)malloc(sizeof(struct ip6q), M_FTABLE, M_NOWAIT); if (q6 == NULL) @@ -283,7 +313,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) } mac_ip6q_create(m, q6); #endif - frag6_insque(q6, &V_ip6q); + frag6_insque_head(q6, head, hash); /* ip6q_nxt will be filled afterwards, from 1st fragment */ q6->ip6q_down = q6->ip6q_up = (struct ip6asfrag *)q6; @@ -324,14 +354,14 @@ frag6_input(struct mbuf **mp, int *offp, int proto) icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offset - sizeof(struct ip6_frag) + offsetof(struct ip6_frag, ip6f_offlg)); - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); return (IPPROTO_DONE); } } else if (fragoff + frgpartlen > IPV6_MAXPACKET) { icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offset - sizeof(struct ip6_frag) + offsetof(struct ip6_frag, ip6f_offlg)); - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); return (IPPROTO_DONE); } /* @@ -350,7 +380,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) int erroff = af6->ip6af_offset; /* dequeue the fragment. */ - frag6_deq(af6); + frag6_deq(af6, hash); free(af6, M_FTABLE); /* adjust pointer. */ @@ -448,7 +478,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) } af6 = af6->ip6af_down; m_freem(IP6_REASS_MBUF(af6->ip6af_up)); - frag6_deq(af6->ip6af_up); + frag6_deq(af6->ip6af_up, hash); } #else /* @@ -500,26 +530,26 @@ insert: * Move to front of packet queue, as we are * the most recently active fragmented packet. */ - frag6_enq(ip6af, af6->ip6af_up); - V_frag6_nfrags++; + frag6_enq(ip6af, af6->ip6af_up, hash); + atomic_add_int(&V_frag6_nfrags, 1); q6->ip6q_nfrag++; #if 0 /* xxx */ - if (q6 != V_ip6q.ip6q_next) { - frag6_remque(q6); - frag6_insque(q6, &V_ip6q); + if (q6 != head->ip6q_next) { + frag6_remque(q6, hash); + frag6_insque_head(q6, head, hash); } #endif next = 0; for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = af6->ip6af_down) { if (af6->ip6af_off != next) { - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); return IPPROTO_DONE; } next += af6->ip6af_frglen; } if (af6->ip6af_up->ip6af_mff) { - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); return IPPROTO_DONE; } @@ -529,7 +559,7 @@ insert: ip6af = q6->ip6q_down; t = m = IP6_REASS_MBUF(ip6af); af6 = ip6af->ip6af_down; - frag6_deq(ip6af); + frag6_deq(ip6af, hash); while (af6 != (struct ip6asfrag *)q6) { m->m_pkthdr.csum_flags &= IP6_REASS_MBUF(af6)->m_pkthdr.csum_flags; @@ -537,7 +567,7 @@ insert: IP6_REASS_MBUF(af6)->m_pkthdr.csum_data; af6dwn = af6->ip6af_down; - frag6_deq(af6); + frag6_deq(af6, hash); while (t->m_next) t = t->m_next; m_adj(IP6_REASS_MBUF(af6), af6->ip6af_offset); @@ -564,13 +594,13 @@ insert: #endif if (ip6_deletefraghdr(m, offset, M_NOWAIT) != 0) { - frag6_remque(q6); - V_frag6_nfrags -= q6->ip6q_nfrag; + frag6_remque(q6, hash); + atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_destroy(q6); #endif free(q6, M_FTABLE); - V_frag6_nfragpackets--; + atomic_subtract_int(&V_frag6_nfragpackets, 1); goto dropfrag; } @@ -581,14 +611,14 @@ insert: m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), (caddr_t)&nxt); - frag6_remque(q6); - V_frag6_nfrags -= q6->ip6q_nfrag; + frag6_remque(q6, hash); + atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_reassemble(q6, m); mac_ip6q_destroy(q6); #endif free(q6, M_FTABLE); - V_frag6_nfragpackets--; + atomic_subtract_int(&V_frag6_nfragpackets, 1); if (m->m_flags & M_PKTHDR) { /* Isn't it always true? */ int plen = 0; @@ -610,7 +640,7 @@ insert: m_tag_prepend(m, mtag); #endif - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); IP6STAT_INC(ip6s_reassembled); in6_ifstat_inc(dstifp, ifs6_reass_ok); @@ -632,7 +662,7 @@ insert: return nxt; dropfrag: - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); in6_ifstat_inc(dstifp, ifs6_reass_fail); IP6STAT_INC(ip6s_fragdropped); m_freem(m); @@ -643,19 +673,19 @@ insert: * Free a fragment reassembly header and all * associated datagrams. */ -void -frag6_freef(struct ip6q *q6) +static void +frag6_freef(struct ip6q *q6, uint32_t bucket) { struct ip6asfrag *af6, *down6; - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = down6) { struct mbuf *m = IP6_REASS_MBUF(af6); down6 = af6->ip6af_down; - frag6_deq(af6); + frag6_deq(af6, bucket); /* * Return ICMP time exceeded error for the 1st fragment. @@ -677,24 +707,25 @@ frag6_freef(struct ip6q *q6) m_freem(m); free(af6, M_FTABLE); } - frag6_remque(q6); - V_frag6_nfrags -= q6->ip6q_nfrag; + frag6_remque(q6, bucket); + atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_destroy(q6); #endif free(q6, M_FTABLE); - V_frag6_nfragpackets--; + atomic_subtract_int(&V_frag6_nfragpackets, 1); } /* * Put an ip fragment on a reassembly chain. * Like insque, but pointers in middle of structure. */ -void -frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6) +static void +frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6, + uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); af6->ip6af_up = up6; af6->ip6af_down = up6->ip6af_down; @@ -705,21 +736,24 @@ frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6 /* * To frag6_enq as remque is to insque. */ -void -frag6_deq(struct ip6asfrag *af6) +static void +frag6_deq(struct ip6asfrag *af6, uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); af6->ip6af_up->ip6af_down = af6->ip6af_down; af6->ip6af_down->ip6af_up = af6->ip6af_up; } -void -frag6_insque(struct ip6q *new, struct ip6q *old) +static void +frag6_insque_head(struct ip6q *new, struct ip6q *old, uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); + KASSERT(IP6Q_HEAD(bucket) == old, + ("%s: attempt to insert at head of wrong bucket" + " (bucket=%u, old=%p)", __func__, bucket, old)); new->ip6q_prev = old; new->ip6q_next = old->ip6q_next; @@ -727,11 +761,11 @@ frag6_insque(struct ip6q *new, struct ip6q *old) old->ip6q_next = new; } -void -frag6_remque(struct ip6q *p6) +static void +frag6_remque(struct ip6q *p6, uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); p6->ip6q_prev->ip6q_next = p6->ip6q_next; p6->ip6q_next->ip6q_prev = p6->ip6q_prev; @@ -746,37 +780,42 @@ void frag6_slowtimo(void) { VNET_ITERATOR_DECL(vnet_iter); - struct ip6q *q6; + struct ip6q *head, *q6; + int i; VNET_LIST_RLOCK_NOSLEEP(); - IP6Q_LOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - q6 = V_ip6q.ip6q_next; - if (q6) - while (q6 != &V_ip6q) { - --q6->ip6q_ttl; - q6 = q6->ip6q_next; - if (q6->ip6q_prev->ip6q_ttl == 0) { - IP6STAT_INC(ip6s_fragtimeout); - /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(q6->ip6q_prev); + for (i = 0; i < IP6REASS_NHASH; i++) { + IP6Q_LOCK(i); + head = IP6Q_HEAD(i); + q6 = head->ip6q_next; + if (q6) + while (q6 != head) { + --q6->ip6q_ttl; + q6 = q6->ip6q_next; + if (q6->ip6q_prev->ip6q_ttl == 0) { + IP6STAT_INC(ip6s_fragtimeout); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(q6->ip6q_prev, i); + } } + /* + * If we are over the maximum number of fragments + * (due to the limit being lowered), drain off + * enough to get down to the new limit. + */ + while (atomic_load_int(&V_frag6_nfragpackets) > + (u_int)V_ip6_maxfragpackets && + head->ip6q_prev != head) { + IP6STAT_INC(ip6s_fragoverflow); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(head->ip6q_prev, i); } - /* - * If we are over the maximum number of fragments - * (due to the limit being lowered), drain off - * enough to get down to the new limit. - */ - while (V_frag6_nfragpackets > (u_int)V_ip6_maxfragpackets && - V_ip6q.ip6q_prev) { - IP6STAT_INC(ip6s_fragoverflow); - /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(V_ip6q.ip6q_prev); + IP6Q_UNLOCK(i); } CURVNET_RESTORE(); } - IP6Q_UNLOCK(); VNET_LIST_RUNLOCK_NOSLEEP(); } @@ -787,22 +826,25 @@ void frag6_drain(void) { VNET_ITERATOR_DECL(vnet_iter); + struct ip6q *head; + int i; VNET_LIST_RLOCK_NOSLEEP(); - if (IP6Q_TRYLOCK() == 0) { - VNET_LIST_RUNLOCK_NOSLEEP(); - return; - } VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - while (V_ip6q.ip6q_next != &V_ip6q) { - IP6STAT_INC(ip6s_fragdropped); - /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(V_ip6q.ip6q_next); + for (i = 0; i < IP6REASS_NHASH; i++) { + if (IP6Q_TRYLOCK(i) == 0) + continue; + head = IP6Q_HEAD(i); + while (head->ip6q_next != head) { + IP6STAT_INC(ip6s_fragdropped); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(head->ip6q_next, i); + } + IP6Q_UNLOCK(i); } CURVNET_RESTORE(); } - IP6Q_UNLOCK(); VNET_LIST_RUNLOCK_NOSLEEP(); } From owner-svn-src-all@freebsd.org Tue Aug 14 17:19: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 1EF8E107EA52; Tue, 14 Aug 2018 17:19:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8F9A7BB93; Tue, 14 Aug 2018 17:19:11 +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 AB5EB1E835; Tue, 14 Aug 2018 17:19:11 +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 w7EHJBKm011089; Tue, 14 Aug 2018 17:19:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHJBav011088; Tue, 14 Aug 2018 17:19:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808141719.w7EHJBav011088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Aug 2018 17:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337777 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 337777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:19:12 -0000 Author: kib Date: Tue Aug 14 17:19:11 2018 New Revision: 337777 URL: https://svnweb.freebsd.org/changeset/base/337777 Log: Add definitions related to the L1D flush operation capability and MSR. Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Tue Aug 14 17:17:37 2018 (r337776) +++ head/sys/x86/include/specialreg.h Tue Aug 14 17:19:11 2018 (r337777) @@ -427,6 +427,7 @@ */ #define CPUID_STDEXT3_IBPB 0x04000000 #define CPUID_STDEXT3_STIBP 0x08000000 +#define CPUID_STDEXT3_L1D_FLUSH 0x10000000 #define CPUID_STDEXT3_ARCH_CAP 0x20000000 #define CPUID_STDEXT3_SSBD 0x80000000 @@ -478,6 +479,7 @@ #define MSR_IA32_EXT_CONFIG 0x0ee /* Undocumented. Core Solo/Duo only */ #define MSR_MTRRcap 0x0fe #define MSR_IA32_ARCH_CAP 0x10a +#define MSR_IA32_FLUSH_CMD 0x10b #define MSR_BBL_CR_ADDR 0x116 #define MSR_BBL_CR_DECC 0x118 #define MSR_BBL_CR_CTL 0x119 @@ -710,6 +712,9 @@ /* MSR IA32_PRED_CMD */ #define IA32_PRED_CMD_IBPB_BARRIER 0x0000000000000001ULL + +/* MSR IA32_FLUSH_CMD */ +#define IA32_FLUSH_CMD_L1D 0x00000001 /* * PAT modes. From owner-svn-src-all@freebsd.org Tue Aug 14 17:20: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 444D1107EB77; Tue, 14 Aug 2018 17:20:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE2A47BE89; Tue, 14 Aug 2018 17:20:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D03C41E83A; Tue, 14 Aug 2018 17:20:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHKVto011266; Tue, 14 Aug 2018 17:20:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHKVTA011265; Tue, 14 Aug 2018 17:20:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808141720.w7EHKVTA011265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 14 Aug 2018 17:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337779 - head/usr.bin/tftp X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/usr.bin/tftp X-SVN-Commit-Revision: 337779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:20:32 -0000 Author: asomers Date: Tue Aug 14 17:20:31 2018 New Revision: 337779 URL: https://svnweb.freebsd.org/changeset/base/337779 Log: tftp: Close a resource leak when putting files Reported by: Coverity CID: 1394842 MFC after: 2 weeks Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Tue Aug 14 17:19:49 2018 (r337778) +++ head/usr.bin/tftp/main.c Tue Aug 14 17:20:31 2018 (r337779) @@ -499,6 +499,7 @@ put(int argc, char *argv[]) printf("putting %s to %s:%s [%s]\n", cp, hostname, targ, mode); xmitfile(peer, port, fd, targ, mode); + close(fd); return; } /* this assumes the target is a directory */ From owner-svn-src-all@freebsd.org Tue Aug 14 17:19: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 38887107EAD0; Tue, 14 Aug 2018 17:19:50 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E29447BD17; Tue, 14 Aug 2018 17:19:49 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4D8A1E836; Tue, 14 Aug 2018 17:19:49 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHJnZp011159; Tue, 14 Aug 2018 17:19:49 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHJnas011158; Tue, 14 Aug 2018 17:19:49 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141719.w7EHJnas011158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337778 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:19:50 -0000 Author: jtl Date: Tue Aug 14 17:19:49 2018 New Revision: 337778 URL: https://svnweb.freebsd.org/changeset/base/337778 Log: Add a global limit on the number of IPv4 fragments. The IP reassembly fragment limit is based on the number of mbuf clusters, which are a global resource. However, the limit is currently applied on a per-VNET basis. Given enough VNETs (or given sufficient customization of enough VNETs), it is possible that the sum of all the VNET limits will exceed the number of mbuf clusters available in the system. Given the fact that the fragment limit is intended (at least in part) to regulate access to a global resource, the fragment limit should be applied on a global basis. VNET-specific limits can be adjusted by modifying the net.inet.ip.maxfragpackets and net.inet.ip.maxfragsperpacket sysctls. To disable fragment reassembly globally, set net.inet.ip.maxfrags to 0. To disable fragment reassembly for a particular VNET, set net.inet.ip.maxfragpackets to 0. Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet/ip_reass.c Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Tue Aug 14 17:19:11 2018 (r337777) +++ head/sys/netinet/ip_reass.c Tue Aug 14 17:19:49 2018 (r337778) @@ -110,6 +110,15 @@ ipq_drop(struct ipqhead *head, struct ipq *fp) ipq_free(head, fp); } +static int maxfrags; +static volatile u_int nfrags; +SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfrags, CTLFLAG_RW, + &maxfrags, 0, + "Maximum number of IPv4 fragments allowed across all reassembly queues"); +SYSCTL_UINT(_net_inet_ip, OID_AUTO, curfrags, CTLFLAG_RD, + __DEVOLATILE(u_int *, &nfrags), 0, + "Current number of IPv4 fragments across all reassembly queues"); + VNET_DEFINE_STATIC(uma_zone_t, ipq_zone); #define V_ipq_zone VNET(ipq_zone) SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragpackets, CTLFLAG_VNET | @@ -146,7 +155,7 @@ ip_reass(struct mbuf *m) struct mbuf *p, *q, *nq, *t; struct ipq *fp; struct ipqhead *head; - int i, hlen, next; + int i, hlen, next, tmpmax; u_int8_t ecn, ecn0; uint32_t hash, hashkey[3]; #ifdef RSS @@ -156,8 +165,12 @@ ip_reass(struct mbuf *m) /* * If no reassembling or maxfragsperpacket are 0, * never accept fragments. + * Also, drop packet if it would exceed the maximum + * number of fragments. */ - if (V_noreass == 1 || V_maxfragsperpacket == 0) { + tmpmax = maxfrags; + if (V_noreass == 1 || V_maxfragsperpacket == 0 || + (tmpmax >= 0 && atomic_load_int(&nfrags) >= (u_int)tmpmax)) { IPSTAT_INC(ips_fragments); IPSTAT_INC(ips_fragdropped); m_freem(m); @@ -241,6 +254,7 @@ ip_reass(struct mbuf *m) #endif TAILQ_INSERT_HEAD(head, fp, ipq_list); fp->ipq_nfrags = 1; + atomic_add_int(&nfrags, 1); fp->ipq_ttl = IPFRAGTTL; fp->ipq_p = ip->ip_p; fp->ipq_id = ip->ip_id; @@ -251,6 +265,7 @@ ip_reass(struct mbuf *m) goto done; } else { fp->ipq_nfrags++; + atomic_add_int(&nfrags, 1); #ifdef MAC mac_ipq_update(m, fp); #endif @@ -327,6 +342,7 @@ ip_reass(struct mbuf *m) m->m_nextpkt = nq; IPSTAT_INC(ips_fragdropped); fp->ipq_nfrags--; + atomic_subtract_int(&nfrags, 1); m_freem(q); } @@ -392,6 +408,7 @@ ip_reass(struct mbuf *m) while (m->m_pkthdr.csum_data & 0xffff0000) m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16); + atomic_subtract_int(&nfrags, fp->ipq_nfrags); #ifdef MAC mac_ipq_reassemble(fp, m); mac_ipq_destroy(fp); @@ -451,8 +468,10 @@ ip_reass(struct mbuf *m) dropfrag: IPSTAT_INC(ips_fragdropped); - if (fp != NULL) + if (fp != NULL) { fp->ipq_nfrags--; + atomic_subtract_int(&nfrags, 1); + } m_freem(m); done: IPQ_UNLOCK(hash); @@ -479,9 +498,11 @@ ipreass_init(void) NULL, UMA_ALIGN_PTR, 0); uma_zone_set_max(V_ipq_zone, nmbclusters / 32); - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { + maxfrags = nmbclusters / 32; EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change, NULL, EVENTHANDLER_PRI_ANY); + } } /* @@ -564,9 +585,19 @@ ipreass_drain_tomax(void) static void ipreass_zone_change(void *tag) { + VNET_ITERATOR_DECL(vnet_iter); + int max; - uma_zone_set_max(V_ipq_zone, nmbclusters / 32); - ipreass_drain_tomax(); + maxfrags = nmbclusters / 32; + max = nmbclusters / 32; + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + uma_zone_set_max(V_ipq_zone, max); + ipreass_drain_tomax(); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK_NOSLEEP(); } /* @@ -629,6 +660,7 @@ ipq_reuse(int start) struct mbuf *m; IPSTAT_ADD(ips_fragtimeout, fp->ipq_nfrags); + atomic_subtract_int(&nfrags, fp->ipq_nfrags); while (fp->ipq_frags) { m = fp->ipq_frags; fp->ipq_frags = m->m_nextpkt; @@ -653,6 +685,7 @@ ipq_free(struct ipqhead *fhp, struct ipq *fp) { struct mbuf *q; + atomic_subtract_int(&nfrags, fp->ipq_nfrags); while (fp->ipq_frags) { q = fp->ipq_frags; fp->ipq_frags = q->m_nextpkt; From owner-svn-src-all@freebsd.org Tue Aug 14 17:23: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 BB8DD107EDC0; Tue, 14 Aug 2018 17:23:06 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E5E57C362; Tue, 14 Aug 2018 17:23:06 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50A9D1E9C3; Tue, 14 Aug 2018 17:23:06 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHN6TA016590; Tue, 14 Aug 2018 17:23:06 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHN67L016589; Tue, 14 Aug 2018 17:23:06 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141723.w7EHN67L016589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337780 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:23:07 -0000 Author: jtl Date: Tue Aug 14 17:23:05 2018 New Revision: 337780 URL: https://svnweb.freebsd.org/changeset/base/337780 Log: Implement a limit on on the number of IPv4 reassembly queues per bucket. There is a hashing algorithm which should distribute IPv4 reassembly queues across the available buckets in a relatively even way. However, if there is a flaw in the hashing algorithm which allows a large number of IPv4 fragment reassembly queues to end up in a single bucket, a per- bucket limit could help mitigate the performance impact of this flaw. Implement such a limit, with a default of twice the maximum number of reassembly queues divided by the number of buckets. Recalculate the limit any time the maximum number of reassembly queues changes. However, allow the user to override the value using a sysctl (net.inet.ip.maxfragbucketsize). Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet/ip_reass.c Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Tue Aug 14 17:20:31 2018 (r337779) +++ head/sys/netinet/ip_reass.c Tue Aug 14 17:23:05 2018 (r337780) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ SYSCTL_DECL(_net_inet_ip); struct ipqbucket { TAILQ_HEAD(ipqhead, ipq) head; struct mtx lock; + int count; }; VNET_DEFINE_STATIC(struct ipqbucket, ipq[IPREASS_NHASH]); @@ -82,6 +84,9 @@ VNET_DEFINE_STATIC(uint32_t, ipq_hashseed); #define IPQ_UNLOCK(i) mtx_unlock(&V_ipq[i].lock) #define IPQ_LOCK_ASSERT(i) mtx_assert(&V_ipq[i].lock, MA_OWNED) +VNET_DEFINE_STATIC(int, ipreass_maxbucketsize); +#define V_ipreass_maxbucketsize VNET(ipreass_maxbucketsize) + void ipreass_init(void); void ipreass_drain(void); void ipreass_slowtimo(void); @@ -89,25 +94,26 @@ void ipreass_slowtimo(void); void ipreass_destroy(void); #endif static int sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS); +static int sysctl_maxfragbucketsize(SYSCTL_HANDLER_ARGS); static void ipreass_zone_change(void *); static void ipreass_drain_tomax(void); -static void ipq_free(struct ipqhead *, struct ipq *); +static void ipq_free(struct ipqbucket *, struct ipq *); static struct ipq * ipq_reuse(int); static inline void -ipq_timeout(struct ipqhead *head, struct ipq *fp) +ipq_timeout(struct ipqbucket *bucket, struct ipq *fp) { IPSTAT_ADD(ips_fragtimeout, fp->ipq_nfrags); - ipq_free(head, fp); + ipq_free(bucket, fp); } static inline void -ipq_drop(struct ipqhead *head, struct ipq *fp) +ipq_drop(struct ipqbucket *bucket, struct ipq *fp) { IPSTAT_ADD(ips_fragdropped, fp->ipq_nfrags); - ipq_free(head, fp); + ipq_free(bucket, fp); } static int maxfrags; @@ -136,6 +142,10 @@ VNET_DEFINE_STATIC(int, maxfragsperpacket); SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(maxfragsperpacket), 0, "Maximum number of IPv4 fragments allowed per packet"); +SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragbucketsize, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, + sysctl_maxfragbucketsize, "I", + "Maximum number of IPv4 fragment reassembly queue entries per bucket"); /* * Take incoming datagram fragment and try to reassemble it into @@ -241,9 +251,12 @@ ip_reass(struct mbuf *m) * If first fragment to arrive, create a reassembly queue. */ if (fp == NULL) { - fp = uma_zalloc(V_ipq_zone, M_NOWAIT); + if (V_ipq[hash].count < V_ipreass_maxbucketsize) + fp = uma_zalloc(V_ipq_zone, M_NOWAIT); if (fp == NULL) fp = ipq_reuse(hash); + if (fp == NULL) + goto dropfrag; #ifdef MAC if (mac_ipq_init(fp, M_NOWAIT) != 0) { uma_zfree(V_ipq_zone, fp); @@ -253,6 +266,7 @@ ip_reass(struct mbuf *m) mac_ipq_create(m, fp); #endif TAILQ_INSERT_HEAD(head, fp, ipq_list); + V_ipq[hash].count++; fp->ipq_nfrags = 1; atomic_add_int(&nfrags, 1); fp->ipq_ttl = IPFRAGTTL; @@ -360,7 +374,7 @@ ip_reass(struct mbuf *m) for (p = NULL, q = fp->ipq_frags; q; p = q, q = q->m_nextpkt) { if (ntohs(GETIP(q)->ip_off) != next) { if (fp->ipq_nfrags > V_maxfragsperpacket) - ipq_drop(head, fp); + ipq_drop(&V_ipq[hash], fp); goto done; } next += ntohs(GETIP(q)->ip_len); @@ -368,7 +382,7 @@ ip_reass(struct mbuf *m) /* Make sure the last packet didn't have the IP_MF flag */ if (p->m_flags & M_IP_FRAG) { if (fp->ipq_nfrags > V_maxfragsperpacket) - ipq_drop(head, fp); + ipq_drop(&V_ipq[hash], fp); goto done; } @@ -379,7 +393,7 @@ ip_reass(struct mbuf *m) ip = GETIP(q); if (next + (ip->ip_hl << 2) > IP_MAXPACKET) { IPSTAT_INC(ips_toolong); - ipq_drop(head, fp); + ipq_drop(&V_ipq[hash], fp); goto done; } @@ -423,6 +437,7 @@ ip_reass(struct mbuf *m) ip->ip_src = fp->ipq_src; ip->ip_dst = fp->ipq_dst; TAILQ_REMOVE(head, fp, ipq_list); + V_ipq[hash].count--; uma_zfree(V_ipq_zone, fp); m->m_len += (ip->ip_hl << 2); m->m_data -= (ip->ip_hl << 2); @@ -486,17 +501,21 @@ done: void ipreass_init(void) { + int max; for (int i = 0; i < IPREASS_NHASH; i++) { TAILQ_INIT(&V_ipq[i].head); mtx_init(&V_ipq[i].lock, "IP reassembly", NULL, MTX_DEF | MTX_DUPOK); + V_ipq[i].count = 0; } V_ipq_hashseed = arc4random(); V_maxfragsperpacket = 16; V_ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - uma_zone_set_max(V_ipq_zone, nmbclusters / 32); + max = nmbclusters / 32; + max = uma_zone_set_max(V_ipq_zone, max); + V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); if (IS_DEFAULT_VNET(curvnet)) { maxfrags = nmbclusters / 32; @@ -517,7 +536,7 @@ ipreass_slowtimo(void) IPQ_LOCK(i); TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, tmp) if (--fp->ipq_ttl == 0) - ipq_timeout(&V_ipq[i].head, fp); + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } } @@ -532,7 +551,10 @@ ipreass_drain(void) for (int i = 0; i < IPREASS_NHASH; i++) { IPQ_LOCK(i); while(!TAILQ_EMPTY(&V_ipq[i].head)) - ipq_drop(&V_ipq[i].head, TAILQ_FIRST(&V_ipq[i].head)); + ipq_drop(&V_ipq[i], TAILQ_FIRST(&V_ipq[i].head)); + KASSERT(V_ipq[i].count == 0, + ("%s: V_ipq[%d] count %d (V_ipq=%p)", __func__, i, + V_ipq[i].count, V_ipq)); IPQ_UNLOCK(i); } } @@ -560,9 +582,23 @@ ipreass_destroy(void) static void ipreass_drain_tomax(void) { + struct ipq *fp; int target; /* + * Make sure each bucket is under the new limit. If + * necessary, drop enough of the oldest elements from + * each bucket to get under the new limit. + */ + for (int i = 0; i < IPREASS_NHASH; i++) { + IPQ_LOCK(i); + while (V_ipq[i].count > V_ipreass_maxbucketsize && + (fp = TAILQ_LAST(&V_ipq[i].head, ipqhead)) != NULL) + ipq_timeout(&V_ipq[i], fp); + IPQ_UNLOCK(i); + } + + /* * If we are over the maximum number of fragments, * drain off enough to get down to the new limit, * stripping off last elements on queues. Every @@ -570,13 +606,11 @@ ipreass_drain_tomax(void) */ target = uma_zone_get_max(V_ipq_zone); while (uma_zone_get_cur(V_ipq_zone) > target) { - struct ipq *fp; - for (int i = 0; i < IPREASS_NHASH; i++) { IPQ_LOCK(i); fp = TAILQ_LAST(&V_ipq[i].head, ipqhead); if (fp != NULL) - ipq_timeout(&V_ipq[i].head, fp); + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } } @@ -593,7 +627,8 @@ ipreass_zone_change(void *tag) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - uma_zone_set_max(V_ipq_zone, max); + max = uma_zone_set_max(V_ipq_zone, max); + V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); ipreass_drain_tomax(); CURVNET_RESTORE(); } @@ -625,6 +660,7 @@ sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS) * and place an extreme upper bound. */ max = uma_zone_set_max(V_ipq_zone, max); + V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); ipreass_drain_tomax(); V_noreass = 0; } else if (max == 0) { @@ -633,6 +669,7 @@ sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS) } else if (max == -1) { V_noreass = 0; uma_zone_set_max(V_ipq_zone, 0); + V_ipreass_maxbucketsize = INT_MAX; } else return (EINVAL); return (0); @@ -646,16 +683,15 @@ static struct ipq * ipq_reuse(int start) { struct ipq *fp; - int i; + int bucket, i; IPQ_LOCK_ASSERT(start); - for (i = start;; i++) { - if (i == IPREASS_NHASH) - i = 0; - if (i != start && IPQ_TRYLOCK(i) == 0) + for (i = 0; i < IPREASS_NHASH; i++) { + bucket = (start + i) % IPREASS_NHASH; + if (bucket != start && IPQ_TRYLOCK(bucket) == 0) continue; - fp = TAILQ_LAST(&V_ipq[i].head, ipqhead); + fp = TAILQ_LAST(&V_ipq[bucket].head, ipqhead); if (fp) { struct mbuf *m; @@ -666,22 +702,24 @@ ipq_reuse(int start) fp->ipq_frags = m->m_nextpkt; m_freem(m); } - TAILQ_REMOVE(&V_ipq[i].head, fp, ipq_list); - if (i != start) - IPQ_UNLOCK(i); - IPQ_LOCK_ASSERT(start); - return (fp); + TAILQ_REMOVE(&V_ipq[bucket].head, fp, ipq_list); + V_ipq[bucket].count--; + if (bucket != start) + IPQ_UNLOCK(bucket); + break; } - if (i != start) - IPQ_UNLOCK(i); + if (bucket != start) + IPQ_UNLOCK(bucket); } + IPQ_LOCK_ASSERT(start); + return (fp); } /* * Free a fragment reassembly header and all associated datagrams. */ static void -ipq_free(struct ipqhead *fhp, struct ipq *fp) +ipq_free(struct ipqbucket *bucket, struct ipq *fp) { struct mbuf *q; @@ -691,6 +729,26 @@ ipq_free(struct ipqhead *fhp, struct ipq *fp) fp->ipq_frags = q->m_nextpkt; m_freem(q); } - TAILQ_REMOVE(fhp, fp, ipq_list); + TAILQ_REMOVE(&bucket->head, fp, ipq_list); + bucket->count--; uma_zfree(V_ipq_zone, fp); +} + +/* + * Get or set the maximum number of reassembly queues per bucket. + */ +static int +sysctl_maxfragbucketsize(SYSCTL_HANDLER_ARGS) +{ + int error, max; + + max = V_ipreass_maxbucketsize; + error = sysctl_handle_int(oidp, &max, 0, req); + if (error || !req->newptr) + return (error); + if (max <= 0) + return (EINVAL); + V_ipreass_maxbucketsize = max; + ipreass_drain_tomax(); + return (0); } From owner-svn-src-all@freebsd.org Tue Aug 14 17:24:28 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 05F73107EE8F; Tue, 14 Aug 2018 17:24:28 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B00C57C551; Tue, 14 Aug 2018 17:24:27 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9129C1E9C5; Tue, 14 Aug 2018 17:24:27 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHORIB016690; Tue, 14 Aug 2018 17:24:27 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHOQ0a016687; Tue, 14 Aug 2018 17:24:26 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141724.w7EHOQ0a016687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337781 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 337781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:24:28 -0000 Author: jtl Date: Tue Aug 14 17:24:26 2018 New Revision: 337781 URL: https://svnweb.freebsd.org/changeset/base/337781 Log: Make the IPv6 fragment limits be global, rather than per-VNET, limits. The IPv6 reassembly fragment limit is based on the number of mbuf clusters, which are a global resource. However, the limit is currently applied on a per-VNET basis. Given enough VNETs (or given sufficient customization on enough VNETs), it is possible that the sum of all the VNET fragment limits will exceed the number of mbuf clusters available in the system. Given the fact that the fragment limits are intended (at least in part) to regulate access to a global resource, the IPv6 fragment limit should be applied on a global basis. Note that it is still possible to disable fragmentation for a particular VNET by setting the net.inet6.ip6.maxfragpackets sysctl to 0 for that VNET. In addition, it is now possible to disable fragmentation globally by setting the net.inet6.ip6.maxfrags sysctl to 0. Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet6/frag6.c head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue Aug 14 17:23:05 2018 (r337780) +++ head/sys/netinet6/frag6.c Tue Aug 14 17:24:26 2018 (r337781) @@ -89,12 +89,11 @@ struct ip6qbucket { }; VNET_DEFINE_STATIC(volatile u_int, frag6_nfragpackets); -VNET_DEFINE_STATIC(volatile u_int, frag6_nfrags); +volatile u_int frag6_nfrags = 0; VNET_DEFINE_STATIC(struct ip6qbucket, ip6q[IP6REASS_NHASH]); VNET_DEFINE_STATIC(uint32_t, ip6q_hashseed); #define V_frag6_nfragpackets VNET(frag6_nfragpackets) -#define V_frag6_nfrags VNET(frag6_nfrags) #define V_ip6q VNET(ip6q) #define V_ip6q_hashseed VNET(ip6q_hashseed) @@ -112,9 +111,16 @@ static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment r static void frag6_change(void *tag) { + VNET_ITERATOR_DECL(vnet_iter); - V_ip6_maxfragpackets = nmbclusters / 4; - V_ip6_maxfrags = nmbclusters / 4; + ip6_maxfrags = nmbclusters / 4; + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_ip6_maxfragpackets = nmbclusters / 4; + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK_NOSLEEP(); } void @@ -124,7 +130,6 @@ frag6_init(void) int i; V_ip6_maxfragpackets = nmbclusters / 4; - V_ip6_maxfrags = nmbclusters / 4; for (i = 0; i < IP6REASS_NHASH; i++) { q6 = IP6Q_HEAD(i); q6->ip6q_next = q6->ip6q_prev = q6; @@ -134,6 +139,7 @@ frag6_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + ip6_maxfrags = nmbclusters / 4; EVENTHANDLER_REGISTER(nmbclusters_change, frag6_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -267,9 +273,9 @@ frag6_input(struct mbuf **mp, int *offp, int proto) * If maxfrag is 0, never accept fragments. * If maxfrag is -1, accept all fragments without limitation. */ - if (V_ip6_maxfrags < 0) + if (ip6_maxfrags < 0) ; - else if (atomic_load_int(&V_frag6_nfrags) >= (u_int)V_ip6_maxfrags) + else if (atomic_load_int(&frag6_nfrags) >= (u_int)ip6_maxfrags) goto dropfrag; for (q6 = head->ip6q_next; q6 != head; q6 = q6->ip6q_next) @@ -531,7 +537,7 @@ insert: * the most recently active fragmented packet. */ frag6_enq(ip6af, af6->ip6af_up, hash); - atomic_add_int(&V_frag6_nfrags, 1); + atomic_add_int(&frag6_nfrags, 1); q6->ip6q_nfrag++; #if 0 /* xxx */ if (q6 != head->ip6q_next) { @@ -595,7 +601,7 @@ insert: if (ip6_deletefraghdr(m, offset, M_NOWAIT) != 0) { frag6_remque(q6, hash); - atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); + atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_destroy(q6); #endif @@ -612,7 +618,7 @@ insert: (caddr_t)&nxt); frag6_remque(q6, hash); - atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); + atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_reassemble(q6, m); mac_ip6q_destroy(q6); @@ -708,7 +714,7 @@ frag6_freef(struct ip6q *q6, uint32_t bucket) free(af6, M_FTABLE); } frag6_remque(q6, bucket); - atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); + atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_destroy(q6); #endif Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Tue Aug 14 17:23:05 2018 (r337780) +++ head/sys/netinet6/in6_proto.c Tue Aug 14 17:24:26 2018 (r337781) @@ -385,7 +385,7 @@ VNET_DEFINE(int, ip6_no_radr) = 0; VNET_DEFINE(int, ip6_norbit_raif) = 0; VNET_DEFINE(int, ip6_rfc6204w3) = 0; VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ -VNET_DEFINE(int, ip6_maxfrags); /* initialized in frag6.c:frag6_init() */ +int ip6_maxfrags; /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_log_interval) = 5; VNET_DEFINE(int, ip6_hdrnestlimit) = 15;/* How many header options will we * process? */ @@ -559,8 +559,10 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEFAULTZONE, us CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_use_defzone), 0, "Use the default scope zone when none is specified"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS, maxfrags, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfrags), 0, - "Maximum allowed number of outstanding IPv6 packet fragments"); + CTLFLAG_RW, &ip6_maxfrags, 0, + "Maximum allowed number of outstanding IPv6 packet fragments. " + "A value of 0 means no fragmented packets will be accepted, while a " + "a value of -1 means no limit"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MCAST_PMTU, mcast_pmtu, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_mcast_pmtu), 0, "Enable path MTU discovery for multicast packets"); Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Tue Aug 14 17:23:05 2018 (r337780) +++ head/sys/netinet6/ip6_var.h Tue Aug 14 17:24:26 2018 (r337781) @@ -301,7 +301,7 @@ VNET_DECLARE(struct socket *, ip6_mrouter); /* multica VNET_DECLARE(int, ip6_sendredirects); /* send IP redirects when forwarding? */ VNET_DECLARE(int, ip6_maxfragpackets); /* Maximum packets in reassembly * queue */ -VNET_DECLARE(int, ip6_maxfrags); /* Maximum fragments in reassembly +extern int ip6_maxfrags; /* Maximum fragments in reassembly * queue */ VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */ VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */ @@ -317,7 +317,6 @@ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionT #define V_ip6_mrouter VNET(ip6_mrouter) #define V_ip6_sendredirects VNET(ip6_sendredirects) #define V_ip6_maxfragpackets VNET(ip6_maxfragpackets) -#define V_ip6_maxfrags VNET(ip6_maxfrags) #define V_ip6_accept_rtadv VNET(ip6_accept_rtadv) #define V_ip6_no_radr VNET(ip6_no_radr) #define V_ip6_norbit_raif VNET(ip6_norbit_raif) From owner-svn-src-all@freebsd.org Tue Aug 14 17:26: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 AA7B1107F0BE; Tue, 14 Aug 2018 17:26:08 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 821D67C818; Tue, 14 Aug 2018 17:26:08 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 605471E9C6; Tue, 14 Aug 2018 17:26:08 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHQ898016820; Tue, 14 Aug 2018 17:26:08 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHQ7aj016815; Tue, 14 Aug 2018 17:26:07 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141726.w7EHQ7aj016815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337782 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 337782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:26:09 -0000 Author: jtl Date: Tue Aug 14 17:26:07 2018 New Revision: 337782 URL: https://svnweb.freebsd.org/changeset/base/337782 Log: Add a limit of the number of fragments per IPv6 packet. The IPv4 fragment reassembly code supports a limit on the number of fragments per packet. The default limit is currently 17 fragments. Among other things, this limit serves to limit the number of fragments the code must parse when trying to reassembly a packet. Add a limit to the IPv6 reassembly code. By default, limit a packet to 65 fragments (64 on the queue, plus one final fragment to complete the packet). This allows an average fragment size of 1,008 bytes, which should be sufficient to hold a fragment. (Recall that the IPv6 minimum MTU is 1280 bytes. Therefore, this configuration allows a full-size IPv6 packet to be fragmented on a link with the minimum MTU and still carry approximately 272 bytes of headers before the fragmented portion of the packet.) Users can adjust this limit using the net.inet6.ip6.maxfragsperpacket sysctl. Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet6/frag6.c head/sys/netinet6/in6.h head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue Aug 14 17:24:26 2018 (r337781) +++ head/sys/netinet6/frag6.c Tue Aug 14 17:26:07 2018 (r337782) @@ -136,6 +136,7 @@ frag6_init(void) mtx_init(&V_ip6q[i].lock, "ip6qlock", NULL, MTX_DEF); } V_ip6q_hashseed = arc4random(); + V_ip6_maxfragsperpacket = 64; if (!IS_DEFAULT_VNET(curvnet)) return; @@ -533,6 +534,7 @@ insert: /* * Stick new segment in its place; * check for complete reassembly. + * If not complete, check fragment limit. * Move to front of packet queue, as we are * the most recently active fragmented packet. */ @@ -549,12 +551,20 @@ insert: for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = af6->ip6af_down) { if (af6->ip6af_off != next) { + if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { + IP6STAT_INC(ip6s_fragdropped); + frag6_freef(q6, hash); + } IP6Q_UNLOCK(hash); return IPPROTO_DONE; } next += af6->ip6af_frglen; } if (af6->ip6af_up->ip6af_mff) { + if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { + IP6STAT_INC(ip6s_fragdropped); + frag6_freef(q6, hash); + } IP6Q_UNLOCK(hash); return IPPROTO_DONE; } Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Tue Aug 14 17:24:26 2018 (r337781) +++ head/sys/netinet6/in6.h Tue Aug 14 17:26:07 2018 (r337782) @@ -642,7 +642,8 @@ struct ip6_mtuinfo { #define IPV6CTL_INTRQMAXLEN 51 /* max length of IPv6 netisr queue */ #define IPV6CTL_INTRDQMAXLEN 52 /* max length of direct IPv6 netisr * queue */ -#define IPV6CTL_MAXID 53 +#define IPV6CTL_MAXFRAGSPERPACKET 53 /* Max fragments per packet */ +#define IPV6CTL_MAXID 54 #endif /* __BSD_VISIBLE */ /* Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Tue Aug 14 17:24:26 2018 (r337781) +++ head/sys/netinet6/in6_proto.c Tue Aug 14 17:26:07 2018 (r337782) @@ -386,6 +386,7 @@ VNET_DEFINE(int, ip6_norbit_raif) = 0; VNET_DEFINE(int, ip6_rfc6204w3) = 0; VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ int ip6_maxfrags; /* initialized in frag6.c:frag6_init() */ +VNET_DEFINE(int, ip6_maxfragsperpacket); /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_log_interval) = 5; VNET_DEFINE(int, ip6_hdrnestlimit) = 15;/* How many header options will we * process? */ @@ -563,6 +564,9 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS, maxfrags, "Maximum allowed number of outstanding IPv6 packet fragments. " "A value of 0 means no fragmented packets will be accepted, while a " "a value of -1 means no limit"); +SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGSPERPACKET, maxfragsperpacket, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragsperpacket), 0, + "Maximum allowed number of fragments per packet"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MCAST_PMTU, mcast_pmtu, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_mcast_pmtu), 0, "Enable path MTU discovery for multicast packets"); Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Tue Aug 14 17:24:26 2018 (r337781) +++ head/sys/netinet6/ip6_var.h Tue Aug 14 17:26:07 2018 (r337782) @@ -303,6 +303,7 @@ VNET_DECLARE(int, ip6_maxfragpackets); /* Maximum pack * queue */ extern int ip6_maxfrags; /* Maximum fragments in reassembly * queue */ +VNET_DECLARE(int, ip6_maxfragsperpacket); /* Maximum fragments per packet */ VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */ VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */ VNET_DECLARE(int, ip6_norbit_raif); /* Disable R-bit in NA on RA @@ -317,6 +318,7 @@ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionT #define V_ip6_mrouter VNET(ip6_mrouter) #define V_ip6_sendredirects VNET(ip6_sendredirects) #define V_ip6_maxfragpackets VNET(ip6_maxfragpackets) +#define V_ip6_maxfragsperpacket VNET(ip6_maxfragsperpacket) #define V_ip6_accept_rtadv VNET(ip6_accept_rtadv) #define V_ip6_no_radr VNET(ip6_no_radr) #define V_ip6_norbit_raif VNET(ip6_norbit_raif) From owner-svn-src-all@freebsd.org Tue Aug 14 17:27: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 A0AED107F2BD; Tue, 14 Aug 2018 17:27:42 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FB6C7CB08; Tue, 14 Aug 2018 17:27:42 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 208C21E9C7; Tue, 14 Aug 2018 17:27:42 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHRgEo016929; Tue, 14 Aug 2018 17:27:42 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHRfPI016925; Tue, 14 Aug 2018 17:27:41 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141727.w7EHRfPI016925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337783 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 337783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:27:42 -0000 Author: jtl Date: Tue Aug 14 17:27:41 2018 New Revision: 337783 URL: https://svnweb.freebsd.org/changeset/base/337783 Log: Implement a limit on on the number of IPv6 reassembly queues per bucket. There is a hashing algorithm which should distribute IPv6 reassembly queues across the available buckets in a relatively even way. However, if there is a flaw in the hashing algorithm which allows a large number of IPv6 fragment reassembly queues to end up in a single bucket, a per- bucket limit could help mitigate the performance impact of this flaw. Implement such a limit, with a default of twice the maximum number of reassembly queues divided by the number of buckets. Recalculate the limit any time the maximum number of reassembly queues changes. However, allow the user to override the value using a sysctl (net.inet6.ip6.maxfragbucketsize). Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet6/frag6.c head/sys/netinet6/in6.h head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue Aug 14 17:26:07 2018 (r337782) +++ head/sys/netinet6/frag6.c Tue Aug 14 17:27:41 2018 (r337783) @@ -79,13 +79,14 @@ static void frag6_enq(struct ip6asfrag *, struct ip6as uint32_t bucket __unused); static void frag6_deq(struct ip6asfrag *, uint32_t bucket __unused); static void frag6_insque_head(struct ip6q *, struct ip6q *, - uint32_t bucket __unused); -static void frag6_remque(struct ip6q *, uint32_t bucket __unused); + uint32_t bucket); +static void frag6_remque(struct ip6q *, uint32_t bucket); static void frag6_freef(struct ip6q *, uint32_t bucket); struct ip6qbucket { struct ip6q ip6q; struct mtx lock; + int count; }; VNET_DEFINE_STATIC(volatile u_int, frag6_nfragpackets); @@ -108,6 +109,15 @@ static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment r /* * Initialise reassembly queue and fragment identifier. */ +void +frag6_set_bucketsize() +{ + int i; + + if ((i = V_ip6_maxfragpackets) > 0) + V_ip6_maxfragbucketsize = imax(i / (IP6REASS_NHASH / 2), 1); +} + static void frag6_change(void *tag) { @@ -118,6 +128,7 @@ frag6_change(void *tag) VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); V_ip6_maxfragpackets = nmbclusters / 4; + frag6_set_bucketsize(); CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); @@ -130,10 +141,12 @@ frag6_init(void) int i; V_ip6_maxfragpackets = nmbclusters / 4; + frag6_set_bucketsize(); for (i = 0; i < IP6REASS_NHASH; i++) { q6 = IP6Q_HEAD(i); q6->ip6q_next = q6->ip6q_prev = q6; mtx_init(&V_ip6q[i].lock, "ip6qlock", NULL, MTX_DEF); + V_ip6q[i].count = 0; } V_ip6q_hashseed = arc4random(); V_ip6_maxfragsperpacket = 64; @@ -304,7 +317,8 @@ frag6_input(struct mbuf **mp, int *offp, int proto) */ if (V_ip6_maxfragpackets < 0) ; - else if (atomic_load_int(&V_frag6_nfragpackets) >= + else if (V_ip6q[hash].count >= V_ip6_maxfragbucketsize || + atomic_load_int(&V_frag6_nfragpackets) >= (u_int)V_ip6_maxfragpackets) goto dropfrag; atomic_add_int(&V_frag6_nfragpackets, 1); @@ -763,7 +777,7 @@ frag6_deq(struct ip6asfrag *af6, uint32_t bucket __unu } static void -frag6_insque_head(struct ip6q *new, struct ip6q *old, uint32_t bucket __unused) +frag6_insque_head(struct ip6q *new, struct ip6q *old, uint32_t bucket) { IP6Q_LOCK_ASSERT(bucket); @@ -775,16 +789,18 @@ frag6_insque_head(struct ip6q *new, struct ip6q *old, new->ip6q_next = old->ip6q_next; old->ip6q_next->ip6q_prev= new; old->ip6q_next = new; + V_ip6q[bucket].count++; } static void -frag6_remque(struct ip6q *p6, uint32_t bucket __unused) +frag6_remque(struct ip6q *p6, uint32_t bucket) { IP6Q_LOCK_ASSERT(bucket); p6->ip6q_prev->ip6q_next = p6->ip6q_next; p6->ip6q_next->ip6q_prev = p6->ip6q_prev; + V_ip6q[bucket].count--; } /* @@ -806,29 +822,59 @@ frag6_slowtimo(void) IP6Q_LOCK(i); head = IP6Q_HEAD(i); q6 = head->ip6q_next; - if (q6) - while (q6 != head) { - --q6->ip6q_ttl; - q6 = q6->ip6q_next; - if (q6->ip6q_prev->ip6q_ttl == 0) { - IP6STAT_INC(ip6s_fragtimeout); - /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(q6->ip6q_prev, i); - } + if (q6 == NULL) { + /* + * XXXJTL: This should never happen. This + * should turn into an assertion. + */ + IP6Q_UNLOCK(i); + continue; + } + while (q6 != head) { + --q6->ip6q_ttl; + q6 = q6->ip6q_next; + if (q6->ip6q_prev->ip6q_ttl == 0) { + IP6STAT_INC(ip6s_fragtimeout); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(q6->ip6q_prev, i); } + } /* * If we are over the maximum number of fragments * (due to the limit being lowered), drain off * enough to get down to the new limit. + * Note that we drain all reassembly queues if + * maxfragpackets is 0 (fragmentation is disabled), + * and don't enforce a limit when maxfragpackets + * is negative. */ - while (atomic_load_int(&V_frag6_nfragpackets) > - (u_int)V_ip6_maxfragpackets && + while ((V_ip6_maxfragpackets == 0 || + (V_ip6_maxfragpackets > 0 && + V_ip6q[i].count > V_ip6_maxfragbucketsize)) && head->ip6q_prev != head) { IP6STAT_INC(ip6s_fragoverflow); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(head->ip6q_prev, i); } IP6Q_UNLOCK(i); + } + /* + * If we are still over the maximum number of fragmented + * packets, drain off enough to get down to the new limit. + */ + i = 0; + while (V_ip6_maxfragpackets >= 0 && + atomic_load_int(&V_frag6_nfragpackets) > + (u_int)V_ip6_maxfragpackets) { + IP6Q_LOCK(i); + head = IP6Q_HEAD(i); + if (head->ip6q_prev != head) { + IP6STAT_INC(ip6s_fragoverflow); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(head->ip6q_prev, i); + } + IP6Q_UNLOCK(i); + i = (i + 1) % IP6REASS_NHASH; } CURVNET_RESTORE(); } Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Tue Aug 14 17:26:07 2018 (r337782) +++ head/sys/netinet6/in6.h Tue Aug 14 17:27:41 2018 (r337783) @@ -643,7 +643,8 @@ struct ip6_mtuinfo { #define IPV6CTL_INTRDQMAXLEN 52 /* max length of direct IPv6 netisr * queue */ #define IPV6CTL_MAXFRAGSPERPACKET 53 /* Max fragments per packet */ -#define IPV6CTL_MAXID 54 +#define IPV6CTL_MAXFRAGBUCKETSIZE 54 /* Max reassembly queues per bucket */ +#define IPV6CTL_MAXID 55 #endif /* __BSD_VISIBLE */ /* Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Tue Aug 14 17:26:07 2018 (r337782) +++ head/sys/netinet6/in6_proto.c Tue Aug 14 17:27:41 2018 (r337783) @@ -386,6 +386,7 @@ VNET_DEFINE(int, ip6_norbit_raif) = 0; VNET_DEFINE(int, ip6_rfc6204w3) = 0; VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ int ip6_maxfrags; /* initialized in frag6.c:frag6_init() */ +VNET_DEFINE(int, ip6_maxfragbucketsize);/* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_maxfragsperpacket); /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_log_interval) = 5; VNET_DEFINE(int, ip6_hdrnestlimit) = 15;/* How many header options will we @@ -473,6 +474,20 @@ sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARGS) return (0); } +static int +sysctl_ip6_maxfragpackets(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = V_ip6_maxfragpackets; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || !req->newptr) + return (error); + V_ip6_maxfragpackets = val; + frag6_set_bucketsize(); + return (0); +} + SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_forwarding), 0, "Enable forwarding of IPv6 packets between interfaces"); @@ -485,8 +500,9 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_STATS, stats, struct ip6stat, ip6stat, "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)"); -SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragpackets), 0, +SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, NULL, 0, + sysctl_ip6_maxfragpackets, "I", "Default maximum number of outstanding fragmented IPv6 packets. " "A value of 0 means no fragmented packets will be accepted, while a " "a value of -1 means no limit"); @@ -564,6 +580,9 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS, maxfrags, "Maximum allowed number of outstanding IPv6 packet fragments. " "A value of 0 means no fragmented packets will be accepted, while a " "a value of -1 means no limit"); +SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGBUCKETSIZE, maxfragbucketsize, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragbucketsize), 0, + "Maximum number of reassembly queues per hash bucket"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGSPERPACKET, maxfragsperpacket, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragsperpacket), 0, "Maximum allowed number of fragments per packet"); Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Tue Aug 14 17:26:07 2018 (r337782) +++ head/sys/netinet6/ip6_var.h Tue Aug 14 17:27:41 2018 (r337783) @@ -303,6 +303,7 @@ VNET_DECLARE(int, ip6_maxfragpackets); /* Maximum pack * queue */ extern int ip6_maxfrags; /* Maximum fragments in reassembly * queue */ +VNET_DECLARE(int, ip6_maxfragbucketsize); /* Maximum reassembly queues per bucket */ VNET_DECLARE(int, ip6_maxfragsperpacket); /* Maximum fragments per packet */ VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */ VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */ @@ -318,6 +319,7 @@ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionT #define V_ip6_mrouter VNET(ip6_mrouter) #define V_ip6_sendredirects VNET(ip6_sendredirects) #define V_ip6_maxfragpackets VNET(ip6_maxfragpackets) +#define V_ip6_maxfragbucketsize VNET(ip6_maxfragbucketsize) #define V_ip6_maxfragsperpacket VNET(ip6_maxfragsperpacket) #define V_ip6_accept_rtadv VNET(ip6_accept_rtadv) #define V_ip6_no_radr VNET(ip6_no_radr) @@ -405,6 +407,7 @@ int ip6_fragment(struct ifnet *, struct mbuf *, int, u int route6_input(struct mbuf **, int *, int); +void frag6_set_bucketsize(void); void frag6_init(void); int frag6_input(struct mbuf **, int *, int); void frag6_slowtimo(void); From owner-svn-src-all@freebsd.org Tue Aug 14 17:29: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 95AEF107F39B; Tue, 14 Aug 2018 17:29:23 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 041CD7CD06; Tue, 14 Aug 2018 17:29:23 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6F7B1E9C8; Tue, 14 Aug 2018 17:29:22 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHTMS3017050; Tue, 14 Aug 2018 17:29:22 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHTMMN017049; Tue, 14 Aug 2018 17:29:22 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141729.w7EHTMMN017049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337784 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 337784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:29:23 -0000 Author: jtl Date: Tue Aug 14 17:29:22 2018 New Revision: 337784 URL: https://svnweb.freebsd.org/changeset/base/337784 Log: Drop 0-byte IPv6 fragments. Currently, we process IPv6 fragments with 0 bytes of payload, add them to the reassembly queue, and do not recognize them as duplicating or overlapping with adjacent 0-byte fragments. An attacker can exploit this to create long fragment queues. There is no legitimate reason for a fragment with no payload. However, because IPv6 packets with an empty payload are acceptable, allow an "atomic" fragment with no payload. Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue Aug 14 17:27:41 2018 (r337783) +++ head/sys/netinet6/frag6.c Tue Aug 14 17:29:22 2018 (r337784) @@ -271,6 +271,16 @@ frag6_input(struct mbuf **mp, int *offp, int proto) return (ip6f->ip6f_nxt); } + /* Get fragment length and discard 0-byte fragments. */ + frgpartlen = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) - offset; + if (frgpartlen == 0) { + icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, + offsetof(struct ip6_hdr, ip6_plen)); + in6_ifstat_inc(dstifp, ifs6_reass_fail); + IP6STAT_INC(ip6s_fragdropped); + return IPPROTO_DONE; + } + hashkeyp = hashkey; memcpy(hashkeyp, &ip6->ip6_src, sizeof(struct in6_addr)); hashkeyp += sizeof(struct in6_addr) / sizeof(*hashkeyp); @@ -368,7 +378,6 @@ frag6_input(struct mbuf **mp, int *offp, int proto) * in size. * If it would exceed, discard the fragment and return an ICMP error. */ - frgpartlen = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) - offset; if (q6->ip6q_unfrglen >= 0) { /* The 1st fragment has already arrived. */ if (q6->ip6q_unfrglen + fragoff + frgpartlen > IPV6_MAXPACKET) { From owner-svn-src-all@freebsd.org Tue Aug 14 17:29: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 EA9BD107F3D9; Tue, 14 Aug 2018 17:29:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B29D7CE3E; Tue, 14 Aug 2018 17:29:42 +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 4C4F11E9C9; Tue, 14 Aug 2018 17:29:42 +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 w7EHTgRw017110; Tue, 14 Aug 2018 17:29:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHTfrd017107; Tue, 14 Aug 2018 17:29:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808141729.w7EHTfrd017107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Aug 2018 17:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337785 - head/sys/amd64/vmm/intel X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/vmm/intel X-SVN-Commit-Revision: 337785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:29:43 -0000 Author: kib Date: Tue Aug 14 17:29:41 2018 New Revision: 337785 URL: https://svnweb.freebsd.org/changeset/base/337785 Log: Provide part of the mitigation for L1TF-VMM. On the guest entry in bhyve, flush L1 data cache, using either L1D flush command MSR if available, or by reading enough uninteresting data to fill whole cache. Flush is automatically enabled on CPUs which do not report RDCL_NO, and can be disabled with the hw.vmm.l1d_flush tunable/kenv. Security: CVE-2018-3646 Reviewed by: emaste. jhb, Tony Luck Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx_genassym.c head/sys/amd64/vmm/intel/vmx_support.S Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Aug 14 17:29:22 2018 (r337784) +++ head/sys/amd64/vmm/intel/vmx.c Tue Aug 14 17:29:41 2018 (r337785) @@ -188,6 +188,12 @@ static u_int vpid_alloc_failed; SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_alloc_failed, CTLFLAG_RD, &vpid_alloc_failed, 0, NULL); +static int guest_l1d_flush; +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush, CTLFLAG_RD, + &guest_l1d_flush, 0, NULL); + +uint64_t vmx_msr_flush_cmd; + /* * The definitions of SDT probes for VMX. */ @@ -798,6 +804,12 @@ vmx_init(int ipinum) printf("vmx_init: ept initialization failed (%d)\n", error); return (error); } + + guest_l1d_flush = (cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) == 0; + TUNABLE_INT_FETCH("hw.vmm.l1d_flush", &guest_l1d_flush); + if (guest_l1d_flush && + (cpu_stdext_feature3 & CPUID_STDEXT3_L1D_FLUSH) != 0) + vmx_msr_flush_cmd = IA32_FLUSH_CMD_L1D; /* * Stash the cr0 and cr4 bits that must be fixed to 0 or 1 Modified: head/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_genassym.c Tue Aug 14 17:29:22 2018 (r337784) +++ head/sys/amd64/vmm/intel/vmx_genassym.c Tue Aug 14 17:29:41 2018 (r337785) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "vmx_cpufunc.h" @@ -88,3 +89,6 @@ ASSYM(PM_EPTGEN, offsetof(struct pmap, pm_eptgen)); ASSYM(KERNEL_SS, GSEL(GDATA_SEL, SEL_KPL)); ASSYM(KERNEL_CS, GSEL(GCODE_SEL, SEL_KPL)); + +ASSYM(PAGE_SIZE, PAGE_SIZE); +ASSYM(KERNBASE, KERNBASE); Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Tue Aug 14 17:29:22 2018 (r337784) +++ head/sys/amd64/vmm/intel/vmx_support.S Tue Aug 14 17:29:41 2018 (r337785) @@ -30,6 +30,7 @@ */ #include +#include #include "vmx_assym.h" @@ -175,9 +176,47 @@ ENTRY(vmx_enter_guest) jbe invept_error /* Check invept instruction error */ guest_restore: - cmpl $0, %edx - je do_launch + /* + * Flush L1D cache if requested. Use IA32_FLUSH_CMD MSR if available, + * otherwise load enough of the data from the zero_region to flush + * existing L1D content. + */ +#define L1D_FLUSH_SIZE (64 * 1024) + movl %edx, %r8d + cmpb $0, guest_l1d_flush(%rip) + je after_l1d + movq vmx_msr_flush_cmd(%rip), %rax + testq %rax, %rax + jz 1f + movq %rax, %rdx + shrq $32, %rdx + movl $MSR_IA32_FLUSH_CMD, %ecx + wrmsr + jmp after_l1d +1: movq $KERNBASE, %r9 + movq $-L1D_FLUSH_SIZE, %rcx + /* + * pass 1: Preload TLB. + * Kernel text is mapped using superpages. TLB preload is + * done for the benefit of older CPUs which split 2M page + * into 4k TLB entries. + */ +2: movb L1D_FLUSH_SIZE(%r9, %rcx), %al + addq $PAGE_SIZE, %rcx + jne 2b + xorl %eax, %eax + cpuid + movq $-L1D_FLUSH_SIZE, %rcx + /* pass 2: Read each cache line */ +3: movb L1D_FLUSH_SIZE(%r9, %rcx), %al + addq $64, %rcx + jne 3b + lfence +#undef L1D_FLUSH_SIZE +after_l1d: + cmpl $0, %r8d + je do_launch VMX_GUEST_RESTORE vmresume /* From owner-svn-src-all@freebsd.org Tue Aug 14 17:30: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 02ABF107F5CD; Tue, 14 Aug 2018 17:30:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A54A67D035; Tue, 14 Aug 2018 17:30:46 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F82C1E9D8; Tue, 14 Aug 2018 17:30:46 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHUkio017539; Tue, 14 Aug 2018 17:30:46 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHUk3C017526; Tue, 14 Aug 2018 17:30:46 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141730.w7EHUk3C017526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337786 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:30:47 -0000 Author: jtl Date: Tue Aug 14 17:30:46 2018 New Revision: 337786 URL: https://svnweb.freebsd.org/changeset/base/337786 Log: Lower the default limits on the IPv4 reassembly queue. In particular, try to ensure that no bucket will have a reassembly queue larger than approximately 100 items. This limits the cost to find the correct reassembly queue when processing an incoming fragment. Due to the low limits on each bucket's length, increase the size of the hash table from 64 to 1024. Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet/ip_reass.c Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Tue Aug 14 17:29:41 2018 (r337785) +++ head/sys/netinet/ip_reass.c Tue Aug 14 17:30:46 2018 (r337786) @@ -64,7 +64,7 @@ SYSCTL_DECL(_net_inet_ip); /* * Reassembly headers are stored in hash buckets. */ -#define IPREASS_NHASH_LOG2 6 +#define IPREASS_NHASH_LOG2 10 #define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2) #define IPREASS_HMASK (IPREASS_NHASH - 1) @@ -116,6 +116,22 @@ ipq_drop(struct ipqbucket *bucket, struct ipq *fp) ipq_free(bucket, fp); } +/* + * By default, limit the number of IP fragments across all reassembly + * queues to 1/32 of the total number of mbuf clusters. + * + * Limit the total number of reassembly queues per VNET to the + * IP fragment limit, but ensure the limit will not allow any bucket + * to grow above 100 items. (The bucket limit is + * IP_MAXFRAGPACKETS / (IPREASS_NHASH / 2), so the 50 is the correct + * multiplier to reach a 100-item limit.) + * The 100-item limit was chosen as brief testing seems to show that + * this produces "reasonable" performance on some subset of systems + * under DoS attack. + */ +#define IP_MAXFRAGS (nmbclusters / 32) +#define IP_MAXFRAGPACKETS (imin(IP_MAXFRAGS, IPREASS_NHASH * 50)) + static int maxfrags; static volatile u_int nfrags; SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfrags, CTLFLAG_RW, @@ -513,12 +529,12 @@ ipreass_init(void) V_maxfragsperpacket = 16; V_ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - max = nmbclusters / 32; + max = IP_MAXFRAGPACKETS; max = uma_zone_set_max(V_ipq_zone, max); V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); if (IS_DEFAULT_VNET(curvnet)) { - maxfrags = nmbclusters / 32; + maxfrags = IP_MAXFRAGS; EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -622,8 +638,8 @@ ipreass_zone_change(void *tag) VNET_ITERATOR_DECL(vnet_iter); int max; - maxfrags = nmbclusters / 32; - max = nmbclusters / 32; + maxfrags = IP_MAXFRAGS; + max = IP_MAXFRAGPACKETS; VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); From owner-svn-src-all@freebsd.org Tue Aug 14 17:32: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 58ABD107F6AE; Tue, 14 Aug 2018 17:32:08 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CEE47D4BC; Tue, 14 Aug 2018 17:32:08 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E22151EB33; Tue, 14 Aug 2018 17:32:07 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHW7qi020649; Tue, 14 Aug 2018 17:32:07 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHW7dg020587; Tue, 14 Aug 2018 17:32:07 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141732.w7EHW7dg020587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337787 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 337787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:32:08 -0000 Author: jtl Date: Tue Aug 14 17:32:07 2018 New Revision: 337787 URL: https://svnweb.freebsd.org/changeset/base/337787 Log: Lower the default limits on the IPv6 reassembly queue. Currently, the limits are quite high. On machines with millions of mbuf clusters, the reassembly queue limits can also run into the millions. Lower these values. Also, try to ensure that no bucket will have a reassembly queue larger than approximately 100 items. This limits the cost to find the correct reassembly queue when processing an incoming fragment. Due to the low limits on each bucket's length, increase the size of the hash table from 64 to 1024. Reviewed by: jhb Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue Aug 14 17:30:46 2018 (r337786) +++ head/sys/netinet6/frag6.c Tue Aug 14 17:32:07 2018 (r337787) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); /* * Reassembly headers are stored in hash buckets. */ -#define IP6REASS_NHASH_LOG2 6 +#define IP6REASS_NHASH_LOG2 10 #define IP6REASS_NHASH (1 << IP6REASS_NHASH_LOG2) #define IP6REASS_HMASK (IP6REASS_NHASH - 1) @@ -107,6 +107,22 @@ VNET_DEFINE_STATIC(uint32_t, ip6q_hashseed); static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment reassembly header"); /* + * By default, limit the number of IP6 fragments across all reassembly + * queues to 1/32 of the total number of mbuf clusters. + * + * Limit the total number of reassembly queues per VNET to the + * IP6 fragment limit, but ensure the limit will not allow any bucket + * to grow above 100 items. (The bucket limit is + * IP_MAXFRAGPACKETS / (IPREASS_NHASH / 2), so the 50 is the correct + * multiplier to reach a 100-item limit.) + * The 100-item limit was chosen as brief testing seems to show that + * this produces "reasonable" performance on some subset of systems + * under DoS attack. + */ +#define IP6_MAXFRAGS (nmbclusters / 32) +#define IP6_MAXFRAGPACKETS (imin(IP6_MAXFRAGS, IP6REASS_NHASH * 50)) + +/* * Initialise reassembly queue and fragment identifier. */ void @@ -123,11 +139,11 @@ frag6_change(void *tag) { VNET_ITERATOR_DECL(vnet_iter); - ip6_maxfrags = nmbclusters / 4; + ip6_maxfrags = IP6_MAXFRAGS; VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - V_ip6_maxfragpackets = nmbclusters / 4; + V_ip6_maxfragpackets = IP6_MAXFRAGPACKETS; frag6_set_bucketsize(); CURVNET_RESTORE(); } @@ -140,7 +156,7 @@ frag6_init(void) struct ip6q *q6; int i; - V_ip6_maxfragpackets = nmbclusters / 4; + V_ip6_maxfragpackets = IP6_MAXFRAGPACKETS; frag6_set_bucketsize(); for (i = 0; i < IP6REASS_NHASH; i++) { q6 = IP6Q_HEAD(i); @@ -153,7 +169,7 @@ frag6_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; - ip6_maxfrags = nmbclusters / 4; + ip6_maxfrags = IP6_MAXFRAGS; EVENTHANDLER_REGISTER(nmbclusters_change, frag6_change, NULL, EVENTHANDLER_PRI_ANY); } From owner-svn-src-all@freebsd.org Tue Aug 14 17:36:22 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 6EF55107F7E3; Tue, 14 Aug 2018 17:36:22 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 237F67D77C; Tue, 14 Aug 2018 17:36:22 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0066D1EB5F; Tue, 14 Aug 2018 17:36:21 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHaLaE022140; Tue, 14 Aug 2018 17:36:21 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHaLdl022138; Tue, 14 Aug 2018 17:36:21 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141736.w7EHaLdl022138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337788 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 337788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:36:22 -0000 Author: jtl Date: Tue Aug 14 17:36:21 2018 New Revision: 337788 URL: https://svnweb.freebsd.org/changeset/base/337788 Log: Update the inet(4) and inet6(4) man pages to reflect the changes made to the reassembly code in r337778, r337780, r337781, r337782, and r337783. Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: head/share/man/man4/inet.4 head/share/man/man4/inet6.4 Modified: head/share/man/man4/inet.4 ============================================================================== --- head/share/man/man4/inet.4 Tue Aug 14 17:32:07 2018 (r337787) +++ head/share/man/man4/inet.4 Tue Aug 14 17:36:21 2018 (r337788) @@ -28,7 +28,7 @@ .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd Feb 4, 2016 +.Dd August 14, 2018 .Dt INET 4 .Os .Sh NAME @@ -229,15 +229,38 @@ At the same time, on high-speed links, it can decrease cycle greatly. Default is 0 (sequential IP IDs). IPv6 flow IDs and fragment IDs are always random. +.It Va ip.maxfrags +Integer: maximum number of fragments the host will accept and simultaneously +hold across all reassembly queues in all VNETs. +If set to 0, reassembly is disabled. +If set to -1, this limit is not applied. +This limit is recalculated when the number of mbuf clusters is changed. +This is a global limit. .It Va ip.maxfragpackets -Integer: maximum number of fragmented packets the host will accept and hold -in the reassembling queue simultaneously. -0 means that the host will not accept any fragmented packets. -\-1 means that the host will accept as many fragmented packets as it receives. +Integer: maximum number of fragmented packets the host will accept and +simultaneously hold in the reassembly queue for a particular VNET. +0 means that the host will not accept any fragmented packets for that VNET. +\-1 means that the host will not apply this limit for that VNET. +This limit is recalculated when the number of mbuf clusters is changed. +This is a per-VNET limit. +.It Va ip.maxfragbucketsize +Integer: maximum number of reassembly queues per bucket. +Fragmented packets are hashed to buckets. +Each bucket has a list of reassembly queues. +The system must compare the incoming packets to the existing reassembly queues +in the bucket to find a matching reassembly queue. +To preserve system resources, the system limits the number of reassembly +queues allowed in each bucket. +This limit is recalculated when the number of mbuf clusters is changed or +when the value of +.Va ip.maxfragpackets +changes. +This is a per-VNET limit. .It Va ip.maxfragsperpacket Integer: maximum number of fragments the host will accept and hold -in the reassembling queue for a packet. -0 means that the host will not accept any fragmented packets. +in the reassembly queue for a packet. +0 means that the host will not accept any fragmented packets for the VNET. +This is a per-VNET limit. .El .Sh SEE ALSO .Xr ioctl 2 , Modified: head/share/man/man4/inet6.4 ============================================================================== --- head/share/man/man4/inet6.4 Tue Aug 14 17:32:07 2018 (r337787) +++ head/share/man/man4/inet6.4 Tue Aug 14 17:36:21 2018 (r337788) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2009 +.Dd August 14, 2018 .Dt INET6 4 .Os .Sh NAME @@ -219,12 +219,41 @@ packets. This value applies to all the transport protocols on top of .Tn IPv6 . There are APIs to override the value. +.It Dv IPV6CTL_MAXFRAGS +.Pq ip6.maxfrags +Integer: maximum number of fragments the host will accept and simultaneously +hold across all reassembly queues in all VNETs. +If set to 0, fragment reassembly is disabled. +If set to -1, this limit is not applied. +This limit is recalculated when the number of mbuf clusters is changed. +This is a global limit. .It Dv IPV6CTL_MAXFRAGPACKETS .Pq ip6.maxfragpackets -Integer: default maximum number of fragmented packets the node will accept. -0 means that the node will not accept any fragmented packets. --1 means that the node will accept as many fragmented packets as it receives. -The flag is provided basically for avoiding possible DoS attacks. +Integer: maximum number of fragmented packets the node will accept and +simultaneously hold in the reassembly queue for a particular VNET. +0 means that the node will not accept any fragmented packets for that VNET. +-1 means that the node will not apply this limit for that VNET. +This limit is recalculated when the number of mbuf clusters is changed. +This is a per-VNET limit. +.It Dv IPV6CTL_MAXFRAGBUCKETSIZE +.Pq ip6.maxfragbucketsize +Integer: maximum number of reassembly queues per bucket. +Fragmented packets are hashed to buckets. +Each bucket has a list of reassembly queues. +The system must compare the incoming packets to the existing reassembly queues +in the bucket to find a matching reassembly queue. +To preserve system resources, the system limits the number of reassembly +queues allowed in each bucket. +This limit is recalculated when the number of mbuf clusters is changed or +when the value of +.Va ip6.maxfragpackets +changes. +This is a per-VNET limit. +.It Dv IPV6CTL_MAXFRAGSPERPACKET +.Pq ip6.maxfragsperpacket +Integer: maximum number of fragments the host will accept and hold in the +ressembly queue for a packet. +This is a per-VNET limit. .It Dv IPV6CTL_ACCEPT_RTADV .Pq ip6.accept_rtadv Boolean: the default value of a per-interface flag to From owner-svn-src-all@freebsd.org Tue Aug 14 17:43: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 1231A107F9E8; Tue, 14 Aug 2018 17:43:12 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B79217DD4E; Tue, 14 Aug 2018 17:43:11 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EB621ED4E; Tue, 14 Aug 2018 17:43:11 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHhBfi026884; Tue, 14 Aug 2018 17:43:11 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHhBKS026883; Tue, 14 Aug 2018 17:43:11 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141743.w7EHhBKS026883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337789 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 337789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:43:12 -0000 Author: jtl Date: Tue Aug 14 17:43:11 2018 New Revision: 337789 URL: https://svnweb.freebsd.org/changeset/base/337789 Log: MFC r337775: Improve hashing of IPv4 fragments. Currently, IPv4 fragments are hashed into buckets based on a 32-bit key which is calculated by (src_ip ^ ip_id) and combined with a random seed. However, because an attacker can control the values of src_ip and ip_id, it is possible to construct an attack which causes very deep chains to form in a given bucket. To ensure more uniform distribution (and lower predictability for an attacker), calculate the hash based on a key which includes all the fields we use to identify a reassembly queue (dst_ip, src_ip, ip_id, and the ip protocol) as well as a random seed. Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet/ip_reass.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_reass.c ============================================================================== --- stable/11/sys/netinet/ip_reass.c Tue Aug 14 17:36:21 2018 (r337788) +++ stable/11/sys/netinet/ip_reass.c Tue Aug 14 17:43:11 2018 (r337789) @@ -148,7 +148,7 @@ ip_reass(struct mbuf *m) struct ipqhead *head; int i, hlen, next; u_int8_t ecn, ecn0; - uint32_t hash; + uint32_t hash, hashkey[3]; #ifdef RSS uint32_t rss_hash, rss_type; #endif @@ -202,8 +202,12 @@ ip_reass(struct mbuf *m) m->m_data += hlen; m->m_len -= hlen; - hash = ip->ip_src.s_addr ^ ip->ip_id; - hash = jenkins_hash32(&hash, 1, V_ipq_hashseed) & IPREASS_HMASK; + hashkey[0] = ip->ip_src.s_addr; + hashkey[1] = ip->ip_dst.s_addr; + hashkey[2] = (uint32_t)ip->ip_p << 16; + hashkey[2] += ip->ip_id; + hash = jenkins_hash32(hashkey, nitems(hashkey), V_ipq_hashseed); + hash &= IPREASS_HMASK; head = &V_ipq[hash].head; IPQ_LOCK(hash); From owner-svn-src-all@freebsd.org Tue Aug 14 17:46:55 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 38E94107FACA; Tue, 14 Aug 2018 17:46:55 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E09177DFAA; Tue, 14 Aug 2018 17:46:54 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A49371ED4F; Tue, 14 Aug 2018 17:46:54 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHksGZ027122; Tue, 14 Aug 2018 17:46:54 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHkskL027121; Tue, 14 Aug 2018 17:46:54 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141746.w7EHkskL027121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337790 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 337790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:46:55 -0000 Author: jtl Date: Tue Aug 14 17:46:54 2018 New Revision: 337790 URL: https://svnweb.freebsd.org/changeset/base/337790 Log: MFC r337776: Improve IPv6 reassembly performance by hashing fragments into buckets. Currently, all IPv6 fragment reassembly queues are kept in a flat linked list. This has a number of implications. Two significant implications are: all reassembly operations share a common lock, and it is possible for the linked list to grow quite large. Improve IPv6 reassembly performance by hashing fragments into buckets, each of which has its own lock. Calculate the hash key using a Jenkins hash with a random seed. Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet6/frag6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Tue Aug 14 17:43:11 2018 (r337789) +++ stable/11/sys/netinet6/frag6.c Tue Aug 14 17:46:54 2018 (r337790) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -63,29 +66,41 @@ __FBSDID("$FreeBSD$"); #include -static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *); -static void frag6_deq(struct ip6asfrag *); -static void frag6_insque(struct ip6q *, struct ip6q *); -static void frag6_remque(struct ip6q *); -static void frag6_freef(struct ip6q *); - -static struct mtx ip6qlock; /* - * These fields all protected by ip6qlock. + * Reassembly headers are stored in hash buckets. */ -static VNET_DEFINE(u_int, frag6_nfragpackets); -static VNET_DEFINE(u_int, frag6_nfrags); -static VNET_DEFINE(struct ip6q, ip6q); /* ip6 reassemble queue */ +#define IP6REASS_NHASH_LOG2 6 +#define IP6REASS_NHASH (1 << IP6REASS_NHASH_LOG2) +#define IP6REASS_HMASK (IP6REASS_NHASH - 1) +static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *, + uint32_t bucket __unused); +static void frag6_deq(struct ip6asfrag *, uint32_t bucket __unused); +static void frag6_insque_head(struct ip6q *, struct ip6q *, + uint32_t bucket __unused); +static void frag6_remque(struct ip6q *, uint32_t bucket __unused); +static void frag6_freef(struct ip6q *, uint32_t bucket); + +struct ip6qbucket { + struct ip6q ip6q; + struct mtx lock; +}; + +static VNET_DEFINE(volatile u_int, frag6_nfragpackets); +static VNET_DEFINE(volatile u_int, frag6_nfrags); +static VNET_DEFINE(struct ip6qbucket, ip6q[IP6REASS_NHASH]); +static VNET_DEFINE(uint32_t, ip6q_hashseed); + #define V_frag6_nfragpackets VNET(frag6_nfragpackets) #define V_frag6_nfrags VNET(frag6_nfrags) #define V_ip6q VNET(ip6q) +#define V_ip6q_hashseed VNET(ip6q_hashseed) -#define IP6Q_LOCK_INIT() mtx_init(&ip6qlock, "ip6qlock", NULL, MTX_DEF); -#define IP6Q_LOCK() mtx_lock(&ip6qlock) -#define IP6Q_TRYLOCK() mtx_trylock(&ip6qlock) -#define IP6Q_LOCK_ASSERT() mtx_assert(&ip6qlock, MA_OWNED) -#define IP6Q_UNLOCK() mtx_unlock(&ip6qlock) +#define IP6Q_LOCK(i) mtx_lock(&V_ip6q[(i)].lock) +#define IP6Q_TRYLOCK(i) mtx_trylock(&V_ip6q[(i)].lock) +#define IP6Q_LOCK_ASSERT(i) mtx_assert(&V_ip6q[(i)].lock, MA_OWNED) +#define IP6Q_UNLOCK(i) mtx_unlock(&V_ip6q[(i)].lock) +#define IP6Q_HEAD(i) (&V_ip6q[(i)].ip6q) static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment reassembly header"); @@ -103,18 +118,22 @@ frag6_change(void *tag) void frag6_init(void) { + struct ip6q *q6; + int i; V_ip6_maxfragpackets = nmbclusters / 4; V_ip6_maxfrags = nmbclusters / 4; - V_ip6q.ip6q_next = V_ip6q.ip6q_prev = &V_ip6q; - + for (i = 0; i < IP6REASS_NHASH; i++) { + q6 = IP6Q_HEAD(i); + q6->ip6q_next = q6->ip6q_prev = q6; + mtx_init(&V_ip6q[i].lock, "ip6qlock", NULL, MTX_DEF); + } + V_ip6q_hashseed = arc4random(); if (!IS_DEFAULT_VNET(curvnet)) return; EVENTHANDLER_REGISTER(nmbclusters_change, frag6_change, NULL, EVENTHANDLER_PRI_ANY); - - IP6Q_LOCK_INIT(); } /* @@ -155,12 +174,13 @@ frag6_input(struct mbuf **mp, int *offp, int proto) struct mbuf *m = *mp, *t; struct ip6_hdr *ip6; struct ip6_frag *ip6f; - struct ip6q *q6; + struct ip6q *head, *q6; struct ip6asfrag *af6, *ip6af, *af6dwn; struct in6_ifaddr *ia; int offset = *offp, nxt, i, next; int first_frag = 0; int fragoff, frgpartlen; /* must be larger than u_int16_t */ + uint32_t hash, hashkey[sizeof(struct in6_addr) * 2 + 1], *hashkeyp; struct ifnet *dstifp; u_int8_t ecn, ecn0; #ifdef RSS @@ -229,7 +249,16 @@ frag6_input(struct mbuf **mp, int *offp, int proto) return (ip6f->ip6f_nxt); } - IP6Q_LOCK(); + hashkeyp = hashkey; + memcpy(hashkeyp, &ip6->ip6_src, sizeof(struct in6_addr)); + hashkeyp += sizeof(struct in6_addr) / sizeof(*hashkeyp); + memcpy(hashkeyp, &ip6->ip6_dst, sizeof(struct in6_addr)); + hashkeyp += sizeof(struct in6_addr) / sizeof(*hashkeyp); + *hashkeyp = ip6f->ip6f_ident; + hash = jenkins_hash32(hashkey, nitems(hashkey), V_ip6q_hashseed); + hash &= IP6REASS_HMASK; + head = IP6Q_HEAD(hash); + IP6Q_LOCK(hash); /* * Enforce upper bound on number of fragments. @@ -241,7 +270,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) else if (V_frag6_nfrags >= (u_int)V_ip6_maxfrags) goto dropfrag; - for (q6 = V_ip6q.ip6q_next; q6 != &V_ip6q; q6 = q6->ip6q_next) + for (q6 = head->ip6q_next; q6 != head; q6 = q6->ip6q_next) if (ip6f->ip6f_ident == q6->ip6q_ident && IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &q6->ip6q_src) && IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &q6->ip6q_dst) @@ -251,7 +280,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) ) break; - if (q6 == &V_ip6q) { + if (q6 == head) { /* * the first fragment to arrive, create a reassembly queue. */ @@ -268,7 +297,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) ; else if (V_frag6_nfragpackets >= (u_int)V_ip6_maxfragpackets) goto dropfrag; - V_frag6_nfragpackets++; + atomic_add_int(&V_frag6_nfragpackets, 1); q6 = (struct ip6q *)malloc(sizeof(struct ip6q), M_FTABLE, M_NOWAIT); if (q6 == NULL) @@ -281,7 +310,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) } mac_ip6q_create(m, q6); #endif - frag6_insque(q6, &V_ip6q); + frag6_insque_head(q6, head, hash); /* ip6q_nxt will be filled afterwards, from 1st fragment */ q6->ip6q_down = q6->ip6q_up = (struct ip6asfrag *)q6; @@ -322,14 +351,14 @@ frag6_input(struct mbuf **mp, int *offp, int proto) icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offset - sizeof(struct ip6_frag) + offsetof(struct ip6_frag, ip6f_offlg)); - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); return (IPPROTO_DONE); } } else if (fragoff + frgpartlen > IPV6_MAXPACKET) { icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offset - sizeof(struct ip6_frag) + offsetof(struct ip6_frag, ip6f_offlg)); - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); return (IPPROTO_DONE); } /* @@ -348,7 +377,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) int erroff = af6->ip6af_offset; /* dequeue the fragment. */ - frag6_deq(af6); + frag6_deq(af6, hash); free(af6, M_FTABLE); /* adjust pointer. */ @@ -446,7 +475,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) } af6 = af6->ip6af_down; m_freem(IP6_REASS_MBUF(af6->ip6af_up)); - frag6_deq(af6->ip6af_up); + frag6_deq(af6->ip6af_up, hash); } #else /* @@ -498,26 +527,26 @@ insert: * Move to front of packet queue, as we are * the most recently active fragmented packet. */ - frag6_enq(ip6af, af6->ip6af_up); - V_frag6_nfrags++; + frag6_enq(ip6af, af6->ip6af_up, hash); + atomic_add_int(&V_frag6_nfrags, 1); q6->ip6q_nfrag++; #if 0 /* xxx */ - if (q6 != V_ip6q.ip6q_next) { - frag6_remque(q6); - frag6_insque(q6, &V_ip6q); + if (q6 != head->ip6q_next) { + frag6_remque(q6, hash); + frag6_insque_head(q6, head, hash); } #endif next = 0; for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = af6->ip6af_down) { if (af6->ip6af_off != next) { - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); return IPPROTO_DONE; } next += af6->ip6af_frglen; } if (af6->ip6af_up->ip6af_mff) { - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); return IPPROTO_DONE; } @@ -527,7 +556,7 @@ insert: ip6af = q6->ip6q_down; t = m = IP6_REASS_MBUF(ip6af); af6 = ip6af->ip6af_down; - frag6_deq(ip6af); + frag6_deq(ip6af, hash); while (af6 != (struct ip6asfrag *)q6) { m->m_pkthdr.csum_flags &= IP6_REASS_MBUF(af6)->m_pkthdr.csum_flags; @@ -535,7 +564,7 @@ insert: IP6_REASS_MBUF(af6)->m_pkthdr.csum_data; af6dwn = af6->ip6af_down; - frag6_deq(af6); + frag6_deq(af6, hash); while (t->m_next) t = t->m_next; m_adj(IP6_REASS_MBUF(af6), af6->ip6af_offset); @@ -562,13 +591,13 @@ insert: #endif if (ip6_deletefraghdr(m, offset, M_NOWAIT) != 0) { - frag6_remque(q6); - V_frag6_nfrags -= q6->ip6q_nfrag; + frag6_remque(q6, hash); + atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_destroy(q6); #endif free(q6, M_FTABLE); - V_frag6_nfragpackets--; + atomic_subtract_int(&V_frag6_nfragpackets, 1); goto dropfrag; } @@ -579,14 +608,14 @@ insert: m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), (caddr_t)&nxt); - frag6_remque(q6); - V_frag6_nfrags -= q6->ip6q_nfrag; + frag6_remque(q6, hash); + atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_reassemble(q6, m); mac_ip6q_destroy(q6); #endif free(q6, M_FTABLE); - V_frag6_nfragpackets--; + atomic_subtract_int(&V_frag6_nfragpackets, 1); if (m->m_flags & M_PKTHDR) { /* Isn't it always true? */ int plen = 0; @@ -608,7 +637,7 @@ insert: m_tag_prepend(m, mtag); #endif - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); IP6STAT_INC(ip6s_reassembled); in6_ifstat_inc(dstifp, ifs6_reass_ok); @@ -630,7 +659,7 @@ insert: return nxt; dropfrag: - IP6Q_UNLOCK(); + IP6Q_UNLOCK(hash); in6_ifstat_inc(dstifp, ifs6_reass_fail); IP6STAT_INC(ip6s_fragdropped); m_freem(m); @@ -641,19 +670,19 @@ insert: * Free a fragment reassembly header and all * associated datagrams. */ -void -frag6_freef(struct ip6q *q6) +static void +frag6_freef(struct ip6q *q6, uint32_t bucket) { struct ip6asfrag *af6, *down6; - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = down6) { struct mbuf *m = IP6_REASS_MBUF(af6); down6 = af6->ip6af_down; - frag6_deq(af6); + frag6_deq(af6, bucket); /* * Return ICMP time exceeded error for the 1st fragment. @@ -675,24 +704,25 @@ frag6_freef(struct ip6q *q6) m_freem(m); free(af6, M_FTABLE); } - frag6_remque(q6); - V_frag6_nfrags -= q6->ip6q_nfrag; + frag6_remque(q6, bucket); + atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_destroy(q6); #endif free(q6, M_FTABLE); - V_frag6_nfragpackets--; + atomic_subtract_int(&V_frag6_nfragpackets, 1); } /* * Put an ip fragment on a reassembly chain. * Like insque, but pointers in middle of structure. */ -void -frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6) +static void +frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6, + uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); af6->ip6af_up = up6; af6->ip6af_down = up6->ip6af_down; @@ -703,21 +733,24 @@ frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6 /* * To frag6_enq as remque is to insque. */ -void -frag6_deq(struct ip6asfrag *af6) +static void +frag6_deq(struct ip6asfrag *af6, uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); af6->ip6af_up->ip6af_down = af6->ip6af_down; af6->ip6af_down->ip6af_up = af6->ip6af_up; } -void -frag6_insque(struct ip6q *new, struct ip6q *old) +static void +frag6_insque_head(struct ip6q *new, struct ip6q *old, uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); + KASSERT(IP6Q_HEAD(bucket) == old, + ("%s: attempt to insert at head of wrong bucket" + " (bucket=%u, old=%p)", __func__, bucket, old)); new->ip6q_prev = old; new->ip6q_next = old->ip6q_next; @@ -725,11 +758,11 @@ frag6_insque(struct ip6q *new, struct ip6q *old) old->ip6q_next = new; } -void -frag6_remque(struct ip6q *p6) +static void +frag6_remque(struct ip6q *p6, uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(); + IP6Q_LOCK_ASSERT(bucket); p6->ip6q_prev->ip6q_next = p6->ip6q_next; p6->ip6q_next->ip6q_prev = p6->ip6q_prev; @@ -744,37 +777,42 @@ void frag6_slowtimo(void) { VNET_ITERATOR_DECL(vnet_iter); - struct ip6q *q6; + struct ip6q *head, *q6; + int i; VNET_LIST_RLOCK_NOSLEEP(); - IP6Q_LOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - q6 = V_ip6q.ip6q_next; - if (q6) - while (q6 != &V_ip6q) { - --q6->ip6q_ttl; - q6 = q6->ip6q_next; - if (q6->ip6q_prev->ip6q_ttl == 0) { - IP6STAT_INC(ip6s_fragtimeout); - /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(q6->ip6q_prev); + for (i = 0; i < IP6REASS_NHASH; i++) { + IP6Q_LOCK(i); + head = IP6Q_HEAD(i); + q6 = head->ip6q_next; + if (q6) + while (q6 != head) { + --q6->ip6q_ttl; + q6 = q6->ip6q_next; + if (q6->ip6q_prev->ip6q_ttl == 0) { + IP6STAT_INC(ip6s_fragtimeout); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(q6->ip6q_prev, i); + } } + /* + * If we are over the maximum number of fragments + * (due to the limit being lowered), drain off + * enough to get down to the new limit. + */ + while (V_frag6_nfragpackets > + (u_int)V_ip6_maxfragpackets && + head->ip6q_prev != head) { + IP6STAT_INC(ip6s_fragoverflow); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(head->ip6q_prev, i); } - /* - * If we are over the maximum number of fragments - * (due to the limit being lowered), drain off - * enough to get down to the new limit. - */ - while (V_frag6_nfragpackets > (u_int)V_ip6_maxfragpackets && - V_ip6q.ip6q_prev) { - IP6STAT_INC(ip6s_fragoverflow); - /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(V_ip6q.ip6q_prev); + IP6Q_UNLOCK(i); } CURVNET_RESTORE(); } - IP6Q_UNLOCK(); VNET_LIST_RUNLOCK_NOSLEEP(); } @@ -785,22 +823,25 @@ void frag6_drain(void) { VNET_ITERATOR_DECL(vnet_iter); + struct ip6q *head; + int i; VNET_LIST_RLOCK_NOSLEEP(); - if (IP6Q_TRYLOCK() == 0) { - VNET_LIST_RUNLOCK_NOSLEEP(); - return; - } VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - while (V_ip6q.ip6q_next != &V_ip6q) { - IP6STAT_INC(ip6s_fragdropped); - /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(V_ip6q.ip6q_next); + for (i = 0; i < IP6REASS_NHASH; i++) { + if (IP6Q_TRYLOCK(i) == 0) + continue; + head = IP6Q_HEAD(i); + while (head->ip6q_next != head) { + IP6STAT_INC(ip6s_fragdropped); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(head->ip6q_next, i); + } + IP6Q_UNLOCK(i); } CURVNET_RESTORE(); } - IP6Q_UNLOCK(); VNET_LIST_RUNLOCK_NOSLEEP(); } From owner-svn-src-all@freebsd.org Tue Aug 14 17:48:09 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 26943107FB49; Tue, 14 Aug 2018 17:48:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD9227E159; Tue, 14 Aug 2018 17:48:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE7A91ED51; Tue, 14 Aug 2018 17:48:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHm8sF027252; Tue, 14 Aug 2018 17:48:08 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHm3wI027223; Tue, 14 Aug 2018 17:48:03 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201808141748.w7EHm3wI027223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 14 Aug 2018 17:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm crypto/openssl/crypto/conf ... X-SVN-Commit-Revision: 337791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:48:09 -0000 Author: jkim Date: Tue Aug 14 17:48:02 2018 New Revision: 337791 URL: https://svnweb.freebsd.org/changeset/base/337791 Log: Merge OpenSSL 1.0.2p. Added: head/crypto/openssl/crypto/bn_int.h - copied unchanged from r337764, vendor-crypto/openssl/dist-1.0.2/crypto/bn_int.h head/crypto/openssl/doc/man3/ - copied from r337764, vendor-crypto/openssl/dist-1.0.2/doc/man3/ head/secure/lib/libcrypto/man/X509_cmp_time.3 (contents, props changed) Modified: head/crypto/openssl/CHANGES head/crypto/openssl/CONTRIBUTING head/crypto/openssl/Configure head/crypto/openssl/Makefile head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/asn1pars.c head/crypto/openssl/apps/ca.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/passwd.c head/crypto/openssl/apps/s_apps.h head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/s_socket.c head/crypto/openssl/apps/verify.c head/crypto/openssl/crypto/Makefile head/crypto/openssl/crypto/asn1/a_bool.c head/crypto/openssl/crypto/asn1/a_object.c head/crypto/openssl/crypto/asn1/a_strex.c head/crypto/openssl/crypto/asn1/ameth_lib.c head/crypto/openssl/crypto/asn1/asn1.h head/crypto/openssl/crypto/asn1/asn1_err.c head/crypto/openssl/crypto/asn1/tasn_enc.c head/crypto/openssl/crypto/bio/bss_log.c head/crypto/openssl/crypto/bio/bss_mem.c head/crypto/openssl/crypto/bn/Makefile head/crypto/openssl/crypto/bn/asm/armv4-mont.pl head/crypto/openssl/crypto/bn/asm/ia64-mont.pl head/crypto/openssl/crypto/bn/asm/mips-mont.pl head/crypto/openssl/crypto/bn/asm/parisc-mont.pl head/crypto/openssl/crypto/bn/asm/ppc-mont.pl head/crypto/openssl/crypto/bn/asm/ppc64-mont.pl head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl head/crypto/openssl/crypto/bn/asm/s390x-mont.pl head/crypto/openssl/crypto/bn/asm/sparct4-mont.pl head/crypto/openssl/crypto/bn/asm/sparcv9-mont.pl head/crypto/openssl/crypto/bn/asm/via-mont.pl head/crypto/openssl/crypto/bn/asm/vis3-mont.pl head/crypto/openssl/crypto/bn/asm/x86-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl head/crypto/openssl/crypto/bn/bn.h head/crypto/openssl/crypto/bn/bn_div.c head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/bn_gf2m.c head/crypto/openssl/crypto/bn/bn_lcl.h head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/bn/bn_mod.c head/crypto/openssl/crypto/bn/bn_mont.c head/crypto/openssl/crypto/bn/bn_sqr.c head/crypto/openssl/crypto/conf/conf_api.c head/crypto/openssl/crypto/dh/dh_key.c head/crypto/openssl/crypto/dh/dh_pmeth.c head/crypto/openssl/crypto/dsa/dsa.h head/crypto/openssl/crypto/dsa/dsa_err.c head/crypto/openssl/crypto/dsa/dsa_gen.c head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/dsa/dsa_pmeth.c head/crypto/openssl/crypto/ec/ec_ameth.c head/crypto/openssl/crypto/ec/ec_lib.c head/crypto/openssl/crypto/ec/ecp_nistz256.c head/crypto/openssl/crypto/ecdsa/Makefile head/crypto/openssl/crypto/ecdsa/ecdsatest.c head/crypto/openssl/crypto/ecdsa/ecs_ossl.c head/crypto/openssl/crypto/engine/eng_lib.c head/crypto/openssl/crypto/engine/tb_asnmth.c head/crypto/openssl/crypto/o_time.c head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/pem/pem.h head/crypto/openssl/crypto/pem/pem_lib.c head/crypto/openssl/crypto/pem/pem_pk8.c head/crypto/openssl/crypto/pem/pem_pkey.c head/crypto/openssl/crypto/pem/pvkfmt.c head/crypto/openssl/crypto/pkcs12/p12_asn.c head/crypto/openssl/crypto/rsa/Makefile head/crypto/openssl/crypto/rsa/rsa_eay.c head/crypto/openssl/crypto/rsa/rsa_gen.c head/crypto/openssl/crypto/rsa/rsa_oaep.c head/crypto/openssl/crypto/rsa/rsa_pk1.c head/crypto/openssl/crypto/rsa/rsa_sign.c head/crypto/openssl/crypto/rsa/rsa_ssl.c head/crypto/openssl/crypto/sha/asm/sha1-586.pl head/crypto/openssl/crypto/sha/asm/sha256-586.pl head/crypto/openssl/crypto/ui/ui_openssl.c head/crypto/openssl/crypto/x509/x509_cmp.c head/crypto/openssl/crypto/x509/x509_lu.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/crypto/x509v3/v3_purp.c head/crypto/openssl/doc/apps/cms.pod head/crypto/openssl/doc/apps/config.pod head/crypto/openssl/doc/apps/genpkey.pod head/crypto/openssl/doc/apps/s_client.pod head/crypto/openssl/doc/crypto/BIO_s_fd.pod head/crypto/openssl/doc/crypto/BN_add.pod head/crypto/openssl/doc/crypto/BN_bn2bin.pod head/crypto/openssl/doc/crypto/BN_generate_prime.pod head/crypto/openssl/doc/crypto/CMS_encrypt.pod head/crypto/openssl/doc/crypto/CMS_get0_SignerInfos.pod head/crypto/openssl/doc/crypto/CMS_get1_ReceiptRequest.pod head/crypto/openssl/doc/crypto/DSA_do_sign.pod head/crypto/openssl/doc/crypto/DSA_sign.pod head/crypto/openssl/doc/crypto/OBJ_nid2obj.pod head/crypto/openssl/doc/crypto/SMIME_read_PKCS7.pod head/crypto/openssl/doc/crypto/ecdsa.pod head/crypto/openssl/doc/crypto/pem.pod head/crypto/openssl/doc/fingerprints.txt head/crypto/openssl/doc/ssl/SSL_CTX_use_certificate.pod head/crypto/openssl/doc/ssl/SSL_get_ciphers.pod head/crypto/openssl/doc/ssl/SSL_get_session.pod head/crypto/openssl/doc/ssl/SSL_get_version.pod head/crypto/openssl/doc/ssl/ssl.pod head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/t1_trce.c head/crypto/openssl/util/domd head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/amd64/x86_64-mont.S head/secure/lib/libcrypto/amd64/x86_64-mont5.S head/secure/lib/libcrypto/arm/armv4-mont.S head/secure/lib/libcrypto/i386/x86-mont.S head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_TIME_set.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 head/secure/lib/libcrypto/man/EC_GROUP_copy.3 head/secure/lib/libcrypto/man/EC_GROUP_new.3 head/secure/lib/libcrypto/man/EC_KEY_new.3 head/secure/lib/libcrypto/man/EC_POINT_add.3 head/secure/lib/libcrypto/man/EC_POINT_new.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncodeInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_check_host.3 head/secure/lib/libcrypto/man/X509_check_private_key.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_ECPKParameters.3 head/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ec.3 head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libssl/Makefile.man head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CONF_CTX_new.3 head/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 head/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 head/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 head/secure/lib/libssl/man/SSL_CONF_cmd.3 head/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 head/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get0_param.3 head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set1_curves.3 head/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_check_chain.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_export_keying_material.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_psk_identity.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/CHANGES Tue Aug 14 17:48:02 2018 (r337791) @@ -7,6 +7,64 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.0.2o and 1.0.2p [14 Aug 2018] + + *) Client DoS due to large DH parameter + + During key agreement in a TLS handshake using a DH(E) based ciphersuite a + malicious server can send a very large prime value to the client. This will + cause the client to spend an unreasonably long period of time generating a + key for this prime resulting in a hang until the client has finished. This + could be exploited in a Denial Of Service attack. + + This issue was reported to OpenSSL on 5th June 2018 by Guido Vranken + (CVE-2018-0732) + [Guido Vranken] + + *) Cache timing vulnerability in RSA Key Generation + + The OpenSSL RSA Key generation algorithm has been shown to be vulnerable to + a cache timing side channel attack. An attacker with sufficient access to + mount cache timing attacks during the RSA key generation process could + recover the private key. + + This issue was reported to OpenSSL on 4th April 2018 by Alejandro Cabrera + Aldaya, Billy Brumley, Cesar Pereida Garcia and Luis Manuel Alvarez Tapia. + (CVE-2018-0737) + [Billy Brumley] + + *) Make EVP_PKEY_asn1_new() a bit stricter about its input. A NULL pem_str + parameter is no longer accepted, as it leads to a corrupt table. NULL + pem_str is reserved for alias entries only. + [Richard Levitte] + + *) Revert blinding in ECDSA sign and instead make problematic addition + length-invariant. Switch even to fixed-length Montgomery multiplication. + [Andy Polyakov] + + *) Change generating and checking of primes so that the error rate of not + being prime depends on the intended use based on the size of the input. + For larger primes this will result in more rounds of Miller-Rabin. + The maximal error rate for primes with more than 1080 bits is lowered + to 2^-128. + [Kurt Roeckx, Annie Yousar] + + *) Increase the number of Miller-Rabin rounds for DSA key generating to 64. + [Kurt Roeckx] + + *) Add blinding to ECDSA and DSA signatures to protect against side channel + attacks discovered by Keegan Ryan (NCC Group). + [Matt Caswell] + + *) When unlocking a pass phrase protected PEM file or PKCS#8 container, we + now allow empty (zero character) pass phrases. + [Richard Levitte] + + *) Certificate time validation (X509_cmp_time) enforces stricter + compliance with RFC 5280. Fractional seconds and timezone offsets + are no longer allowed. + [Emilia Käsper] + Changes between 1.0.2n and 1.0.2o [27 Mar 2018] *) Constructed ASN.1 types with a recursive definition could exceed the stack Modified: head/crypto/openssl/CONTRIBUTING ============================================================================== --- head/crypto/openssl/CONTRIBUTING Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/CONTRIBUTING Tue Aug 14 17:48:02 2018 (r337791) @@ -1,27 +1,27 @@ -HOW TO CONTRIBUTE PATCHES TO OpenSSL ------------------------------------- +HOW TO CONTRIBUTE TO OpenSSL +---------------------------- (Please visit https://www.openssl.org/community/getting-started.html for other ideas about how to contribute.) -Development is coordinated on the openssl-dev mailing list (see the -above link or https://mta.openssl.org for information on subscribing). -If you are unsure as to whether a feature will be useful for the general -OpenSSL community you might want to discuss it on the openssl-dev mailing -list first. Someone may be already working on the same thing or there -may be a good reason as to why that feature isn't implemented. +Development is done on GitHub, https://github.com/openssl/openssl. -To submit a patch, make a pull request on GitHub. If you think the patch -could use feedback from the community, please start a thread on openssl-dev -to discuss it. +To request new features or report bugs, please open an issue on GitHub -Having addressed the following items before the PR will help make the -acceptance and review process faster: +To submit a patch, please open a pull request on GitHub. If you are thinking +of making a large contribution, open an issue for it before starting work, +to get comments from the community. Someone may be already working on +the same thing or there may be reasons why that feature isn't implemented. - 1. Anything other than trivial contributions will require a contributor - licensing agreement, giving us permission to use your code. See - https://www.openssl.org/policies/cla.html for details. +To make it easier to review and accept your pull request, please follow these +guidelines: + 1. Anything other than a trivial contribution requires a Contributor + License Agreement (CLA), giving us permission to use your code. See + https://www.openssl.org/policies/cla.html for details. If your + contribution is too small to require a CLA, put "CLA: trivial" on a + line by itself in your commit message body. + 2. All source files should start with the following text (with appropriate comment characters at the start of each line and the year(s) updated): @@ -34,21 +34,21 @@ acceptance and review process faster: https://www.openssl.org/source/license.html 3. Patches should be as current as possible; expect to have to rebase - often. We do not accept merge commits; You will be asked to remove - them before a patch is considered acceptable. + often. We do not accept merge commits, you will have to remove them + (usually by rebasing) before it will be acceptable. 4. Patches should follow our coding style (see - https://www.openssl.org/policies/codingstyle.html) and compile without - warnings. Where gcc or clang is availble you should use the + https://www.openssl.org/policies/codingstyle.html) and compile + without warnings. Where gcc or clang is available you should use the --strict-warnings Configure option. OpenSSL compiles on many varied - platforms: try to ensure you only use portable features. - Clean builds via Travis and AppVeyor are expected, and done whenever - a PR is created or updated. + platforms: try to ensure you only use portable features. Clean builds + via Travis and AppVeyor are required, and they are started automatically + whenever a PR is created or updated. 5. When at all possible, patches should include tests. These can either be added to an existing test, or completely new. Please see test/README for information on the test framework. 6. New features or changed functionality must include - documentation. Please look at the "pod" files in doc/apps, doc/crypto - and doc/ssl for examples of our style. + documentation. Please look at the "pod" files in doc for + examples of our style. Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/Configure Tue Aug 14 17:48:02 2018 (r337791) @@ -1173,6 +1173,7 @@ foreach (sort (keys %disabled)) $depflags .= " -DOPENSSL_NO_$ALGO"; } } + if (/^comp$/) { $zlib = 0; } } print "\n"; @@ -1671,6 +1672,13 @@ while () { } close(PIPE); +# Xcode did not handle $cc -M before clang support +my $cc_as_makedepend = 0; +if ($predefined{__GNUC__} >= 3 && !(defined($predefined{__APPLE_CC__}) + && !defined($predefined{__clang__}))) { + $cc_as_makedepend = 1; +} + if ($strict_warnings) { my $wopt; @@ -1730,14 +1738,14 @@ while () s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/; s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/; s/^RC=\s*/RC= \$\(CROSS_COMPILE\)/; - s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $predefined{__GNUC__} >= 3; + s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc_as_makedepend; } else { s/^CC=.*$/CC= $cc/; s/^AR=\s*ar/AR= $ar/; s/^RANLIB=.*/RANLIB= $ranlib/; s/^RC=.*/RC= $windres/; - s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $predefined{__GNUC__} >= 3; + s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc_as_makedepend; } s/^CFLAG=.*$/CFLAG= $cflags/; s/^DEPFLAG=.*$/DEPFLAG=$depflags/; Modified: head/crypto/openssl/Makefile ============================================================================== --- head/crypto/openssl/Makefile Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/Makefile Tue Aug 14 17:48:02 2018 (r337791) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2o +VERSION=1.0.2p MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/NEWS Tue Aug 14 17:48:02 2018 (r337791) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2o and OpenSSL 1.0.2p [14 Aug 2018] + + o Client DoS due to large DH parameter (CVE-2018-0732) + o Cache timing vulnerability in RSA Key Generation (CVE-2018-0737) + Major changes between OpenSSL 1.0.2n and OpenSSL 1.0.2o [27 Mar 2018] o Constructed ASN.1 types with a recursive definition could exceed the Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/README Tue Aug 14 17:48:02 2018 (r337791) @@ -1,7 +1,7 @@ - OpenSSL 1.0.2o 27 Mar 2018 + OpenSSL 1.0.2p 14 Aug 2018 - Copyright (c) 1998-2015 The OpenSSL Project + Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson All rights reserved. Modified: head/crypto/openssl/apps/apps.c ============================================================================== --- head/crypto/openssl/apps/apps.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/apps.c Tue Aug 14 17:48:02 2018 (r337791) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1359,7 +1359,8 @@ int set_name_ex(unsigned long *flags, const char *arg) }; if (set_multi_opts(flags, arg, ex_tbl) == 0) return 0; - if ((*flags & XN_FLAG_SEP_MASK) == 0) + if (*flags != XN_FLAG_COMPAT + && (*flags & XN_FLAG_SEP_MASK) == 0) *flags |= XN_FLAG_SEP_CPLUS_SPC; return 1; } Modified: head/crypto/openssl/apps/asn1pars.c ============================================================================== --- head/crypto/openssl/apps/asn1pars.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/asn1pars.c Tue Aug 14 17:48:02 2018 (r337791) @@ -295,7 +295,7 @@ int MAIN(int argc, char **argv) ASN1_TYPE *atmp; int typ; j = atoi(sk_OPENSSL_STRING_value(osk, i)); - if (j == 0) { + if (j <= 0 || j >= tmplen) { BIO_printf(bio_err, "'%s' is an invalid number\n", sk_OPENSSL_STRING_value(osk, i)); continue; @@ -327,14 +327,14 @@ int MAIN(int argc, char **argv) num = tmplen; } - if (offset >= num) { - BIO_printf(bio_err, "Error: offset too large\n"); + if (offset < 0 || offset >= num) { + BIO_printf(bio_err, "Error: offset out of range\n"); goto end; } num -= offset; - if ((length == 0) || ((long)length > num)) + if (length == 0 || length > (unsigned int)num) length = (unsigned int)num; if (derout) { if (BIO_write(derout, str + offset, length) != (int)length) { Modified: head/crypto/openssl/apps/ca.c ============================================================================== --- head/crypto/openssl/apps/ca.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/ca.c Tue Aug 14 17:48:02 2018 (r337791) @@ -1176,10 +1176,13 @@ int MAIN(int argc, char **argv) if (j > 0) { total_done++; BIO_printf(bio_err, "\n"); - if (!BN_add_word(serial, 1)) + if (!BN_add_word(serial, 1)) { + X509_free(x); goto err; + } if (!sk_X509_push(cert_sk, x)) { BIO_printf(bio_err, "Memory allocation failure\n"); + X509_free(x); goto err; } } Modified: head/crypto/openssl/apps/ocsp.c ============================================================================== --- head/crypto/openssl/apps/ocsp.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/ocsp.c Tue Aug 14 17:48:02 2018 (r337791) @@ -4,7 +4,7 @@ * 2000. */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -787,7 +787,6 @@ int MAIN(int argc, char **argv) OCSP_response_status_str(i), i); if (ignore_err) goto redo_accept; - ret = 0; goto end; } Modified: head/crypto/openssl/apps/passwd.c ============================================================================== --- head/crypto/openssl/apps/passwd.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/passwd.c Tue Aug 14 17:48:02 2018 (r337791) @@ -306,9 +306,9 @@ static char *md5crypt(const char *passwd, const char * out_buf[0] = '$'; out_buf[1] = 0; assert(strlen(magic) <= 4); /* "1" or "apr1" */ - strncat(out_buf, magic, 4); - strncat(out_buf, "$", 1); - strncat(out_buf, salt, 8); + BUF_strlcat(out_buf, magic, sizeof(out_buf)); + BUF_strlcat(out_buf, "$", sizeof(out_buf)); + BUF_strlcat(out_buf, salt, sizeof(out_buf)); assert(strlen(out_buf) <= 6 + 8); /* "$apr1$..salt.." */ salt_out = out_buf + 2 + strlen(magic); salt_len = strlen(salt_out); Modified: head/crypto/openssl/apps/s_apps.h ============================================================================== --- head/crypto/openssl/apps/s_apps.h Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/s_apps.h Tue Aug 14 17:48:02 2018 (r337791) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -152,9 +152,8 @@ typedef fd_mask fd_set; #define PROTOCOL "tcp" int do_server(int port, int type, int *ret, - int (*cb) (char *hostname, int s, int stype, - unsigned char *context), unsigned char *context, - int naccept); + int (*cb) (int s, int stype, unsigned char *context), + unsigned char *context, int naccept); #ifdef HEADER_X509_H int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx); #endif Modified: head/crypto/openssl/apps/s_client.c ============================================================================== --- head/crypto/openssl/apps/s_client.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/s_client.c Tue Aug 14 17:48:02 2018 (r337791) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -337,7 +337,7 @@ static void sc_usage(void) BIO_printf(bio_err, " -prexit - print session information even on connection failure\n"); BIO_printf(bio_err, - " -showcerts - show all certificates in the chain\n"); + " -showcerts - Show all certificates sent by the server\n"); BIO_printf(bio_err, " -debug - extra output\n"); #ifdef WATT32 BIO_printf(bio_err, " -wdebug - WATT-32 tcp debugging\n"); Modified: head/crypto/openssl/apps/s_server.c ============================================================================== --- head/crypto/openssl/apps/s_server.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/s_server.c Tue Aug 14 17:48:02 2018 (r337791) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -209,9 +209,9 @@ typedef unsigned int u_int; #ifndef OPENSSL_NO_RSA static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength); #endif -static int sv_body(char *hostname, int s, int stype, unsigned char *context); -static int www_body(char *hostname, int s, int stype, unsigned char *context); -static int rev_body(char *hostname, int s, int stype, unsigned char *context); +static int sv_body(int s, int stype, unsigned char *context); +static int www_body(int s, int stype, unsigned char *context); +static int rev_body(int s, int stype, unsigned char *context); static void close_accept_socket(void); static void sv_usage(void); static int init_ssl_connection(SSL *s); @@ -1087,11 +1087,14 @@ int MAIN(int argc, char *argv[]) char *chCApath = NULL, *chCAfile = NULL; char *vfyCApath = NULL, *vfyCAfile = NULL; unsigned char *context = NULL; +#ifndef OPENSSL_NO_DH char *dhfile = NULL; + int no_dhe = 0; +#endif int badop = 0; int ret = 1; int build_chain = 0; - int no_tmp_rsa = 0, no_dhe = 0, no_ecdhe = 0, nocert = 0; + int no_tmp_rsa = 0, no_ecdhe = 0, nocert = 0; int state = 0; const SSL_METHOD *meth = NULL; int socket_type = SOCK_STREAM; @@ -1239,11 +1242,15 @@ int MAIN(int argc, char *argv[]) if (--argc < 1) goto bad; s_chain_file = *(++argv); - } else if (strcmp(*argv, "-dhparam") == 0) { + } +#ifndef OPENSSL_NO_DH + else if (strcmp(*argv, "-dhparam") == 0) { if (--argc < 1) goto bad; dhfile = *(++argv); - } else if (strcmp(*argv, "-dcertform") == 0) { + } +#endif + else if (strcmp(*argv, "-dcertform") == 0) { if (--argc < 1) goto bad; s_dcert_format = str2fmt(*(++argv)); @@ -1390,9 +1397,13 @@ int MAIN(int argc, char *argv[]) verify_quiet = 1; } else if (strcmp(*argv, "-no_tmp_rsa") == 0) { no_tmp_rsa = 1; - } else if (strcmp(*argv, "-no_dhe") == 0) { + } +#ifndef OPENSSL_NO_DH + else if (strcmp(*argv, "-no_dhe") == 0) { no_dhe = 1; - } else if (strcmp(*argv, "-no_ecdhe") == 0) { + } +#endif + else if (strcmp(*argv, "-no_ecdhe") == 0) { no_ecdhe = 1; } else if (strcmp(*argv, "-no_resume_ephemeral") == 0) { no_resume_ephemeral = 1; @@ -2165,7 +2176,7 @@ static void print_stats(BIO *bio, SSL_CTX *ssl_ctx) SSL_CTX_sess_get_cache_size(ssl_ctx)); } -static int sv_body(char *hostname, int s, int stype, unsigned char *context) +static int sv_body(int s, int stype, unsigned char *context) { char *buf = NULL; fd_set readfds; @@ -2780,7 +2791,7 @@ static int load_CA(SSL_CTX *ctx, char *file) } #endif -static int www_body(char *hostname, int s, int stype, unsigned char *context) +static int www_body(int s, int stype, unsigned char *context) { char *buf = NULL; int ret = 1; @@ -3183,7 +3194,7 @@ static int www_body(char *hostname, int s, int stype, return (ret); } -static int rev_body(char *hostname, int s, int stype, unsigned char *context) +static int rev_body(int s, int stype, unsigned char *context) { char *buf = NULL; int i; Modified: head/crypto/openssl/apps/s_socket.c ============================================================================== --- head/crypto/openssl/apps/s_socket.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/s_socket.c Tue Aug 14 17:48:02 2018 (r337791) @@ -109,7 +109,7 @@ static int ssl_sock_init(void); static int init_client_ip(int *sock, unsigned char ip[4], int port, int type); static int init_server(int *sock, int port, int type); static int init_server_long(int *sock, int port, char *ip, int type); -static int do_accept(int acc_sock, int *sock, char **host); +static int do_accept(int acc_sock, int *sock); static int host_ip(char *str, unsigned char ip[4]); # ifdef OPENSSL_SYS_WIN16 @@ -290,12 +290,10 @@ static int init_client_ip(int *sock, unsigned char ip[ } int do_server(int port, int type, int *ret, - int (*cb) (char *hostname, int s, int stype, - unsigned char *context), unsigned char *context, - int naccept) + int (*cb) (int s, int stype, unsigned char *context), + unsigned char *context, int naccept) { int sock; - char *name = NULL; int accept_socket = 0; int i; @@ -308,15 +306,13 @@ int do_server(int port, int type, int *ret, } for (;;) { if (type == SOCK_STREAM) { - if (do_accept(accept_socket, &sock, &name) == 0) { + if (do_accept(accept_socket, &sock) == 0) { SHUTDOWN(accept_socket); return (0); } } else sock = accept_socket; - i = (*cb) (name, sock, type, context); - if (name != NULL) - OPENSSL_free(name); + i = (*cb) (sock, type, context); if (type == SOCK_STREAM) SHUTDOWN2(sock); if (naccept != -1) @@ -386,30 +382,24 @@ static int init_server(int *sock, int port, int type) return (init_server_long(sock, port, NULL, type)); } -static int do_accept(int acc_sock, int *sock, char **host) +static int do_accept(int acc_sock, int *sock) { int ret; - struct hostent *h1, *h2; - static struct sockaddr_in from; - int len; -/* struct linger ling; */ if (!ssl_sock_init()) - return (0); + return 0; # ifndef OPENSSL_SYS_WINDOWS redoit: # endif - memset((char *)&from, 0, sizeof(from)); - len = sizeof(from); /* * Note: under VMS with SOCKETSHR the fourth parameter is currently of * type (int *) whereas under other systems it is (void *) if you don't * have a cast it will choke the compiler: if you do have a cast then you * can either go for (int *) or (void *). */ - ret = accept(acc_sock, (struct sockaddr *)&from, (void *)&len); + ret = accept(acc_sock, NULL, NULL); if (ret == INVALID_SOCKET) { # if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)) int i; @@ -425,56 +415,11 @@ static int do_accept(int acc_sock, int *sock, char **h fprintf(stderr, "errno=%d ", errno); perror("accept"); # endif - return (0); + return 0; } -/*- - ling.l_onoff=1; - ling.l_linger=0; - i=setsockopt(ret,SOL_SOCKET,SO_LINGER,(char *)&ling,sizeof(ling)); - if (i < 0) { perror("linger"); return(0); } - i=0; - i=setsockopt(ret,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); - if (i < 0) { perror("keepalive"); return(0); } -*/ - - if (host == NULL) - goto end; -# ifndef BIT_FIELD_LIMITS - /* I should use WSAAsyncGetHostByName() under windows */ - h1 = gethostbyaddr((char *)&from.sin_addr.s_addr, - sizeof(from.sin_addr.s_addr), AF_INET); -# else - h1 = gethostbyaddr((char *)&from.sin_addr, - sizeof(struct in_addr), AF_INET); -# endif - if (h1 == NULL) { - BIO_printf(bio_err, "bad gethostbyaddr\n"); - *host = NULL; - /* return(0); */ - } else { - if ((*host = (char *)OPENSSL_malloc(strlen(h1->h_name) + 1)) == NULL) { - perror("OPENSSL_malloc"); - closesocket(ret); - return (0); - } - BUF_strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1); - - h2 = GetHostByName(*host); - if (h2 == NULL) { - BIO_printf(bio_err, "gethostbyname failure\n"); - closesocket(ret); - return (0); - } - if (h2->h_addrtype != AF_INET) { - BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n"); - closesocket(ret); - return (0); - } - } - end: *sock = ret; - return (1); + return 1; } int extract_host_port(char *str, char **host_ptr, unsigned char *ip, Modified: head/crypto/openssl/apps/verify.c ============================================================================== --- head/crypto/openssl/apps/verify.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/apps/verify.c Tue Aug 14 17:48:02 2018 (r337791) @@ -277,6 +277,7 @@ static int check(X509_STORE *ctx, char *file, X509_STORE_set_flags(ctx, vflags); if (!X509_STORE_CTX_init(csc, ctx, x, uchain)) { ERR_print_errors(bio_err); + X509_STORE_CTX_free(csc); goto end; } if (tchain) Modified: head/crypto/openssl/crypto/Makefile ============================================================================== --- head/crypto/openssl/crypto/Makefile Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/Makefile Tue Aug 14 17:48:02 2018 (r337791) @@ -46,7 +46,7 @@ SRC= $(LIBSRC) EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \ ossl_typ.h HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \ - constant_time_locl.h $(EXHEADER) + constant_time_locl.h bn_int.h $(EXHEADER) ALL= $(GENERAL) $(SRC) $(HEADER) Modified: head/crypto/openssl/crypto/asn1/a_bool.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_bool.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/asn1/a_bool.c Tue Aug 14 17:48:02 2018 (r337791) @@ -63,17 +63,31 @@ int i2d_ASN1_BOOLEAN(int a, unsigned char **pp) { int r; - unsigned char *p; + unsigned char *p, *allocated = NULL; r = ASN1_object_size(0, 1, V_ASN1_BOOLEAN); if (pp == NULL) return (r); - p = *pp; + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(r)) == NULL) { + ASN1err(ASN1_F_I2D_ASN1_BOOLEAN, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } + ASN1_put_object(&p, 0, 1, V_ASN1_BOOLEAN, V_ASN1_UNIVERSAL); - *(p++) = (unsigned char)a; - *pp = p; - return (r); + *p = (unsigned char)a; + + + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + 1; + return r; } int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length) Modified: head/crypto/openssl/crypto/asn1/a_object.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_object.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/asn1/a_object.c Tue Aug 14 17:48:02 2018 (r337791) @@ -66,7 +66,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) { - unsigned char *p; + unsigned char *p, *allocated = NULL; int objsize; if ((a == NULL) || (a->data == NULL)) @@ -76,13 +76,24 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp if (pp == NULL || objsize == -1) return objsize; - p = *pp; + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(objsize)) == NULL) { + ASN1err(ASN1_F_I2D_ASN1_OBJECT, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } + ASN1_put_object(&p, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL); memcpy(p, a->data, a->length); - p += a->length; - *pp = p; - return (objsize); + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + a->length; + return objsize; } int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) Modified: head/crypto/openssl/crypto/asn1/a_strex.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_strex.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/asn1/a_strex.c Tue Aug 14 17:48:02 2018 (r337791) @@ -4,7 +4,7 @@ * 2000. */ /* ==================================================================== - * Copyright (c) 2000 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -194,18 +194,38 @@ static int do_buf(unsigned char *buf, int buflen, int type, unsigned char flags, char *quotes, char_io *io_ch, void *arg) { - int i, outlen, len; + int i, outlen, len, charwidth; unsigned char orflags, *p, *q; unsigned long c; p = buf; q = buf + buflen; outlen = 0; + charwidth = type & BUF_TYPE_WIDTH_MASK; + + switch (charwidth) { + case 4: + if (buflen & 3) { + ASN1err(ASN1_F_DO_BUF, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH); + return -1; + } + break; + case 2: + if (buflen & 1) { + ASN1err(ASN1_F_DO_BUF, ASN1_R_INVALID_BMPSTRING_LENGTH); + return -1; + } + break; + default: + break; + } + while (p != q) { if (p == buf && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_FIRST_ESC_2253; else orflags = 0; - switch (type & BUF_TYPE_WIDTH_MASK) { + + switch (charwidth) { case 4: c = ((unsigned long)*p++) << 24; c |= ((unsigned long)*p++) << 16; @@ -226,6 +246,7 @@ static int do_buf(unsigned char *buf, int buflen, i = UTF8_getc(p, buflen, &c); if (i < 0) return -1; /* Invalid UTF8String */ + buflen -= i; p += i; break; default: Modified: head/crypto/openssl/crypto/asn1/ameth_lib.c ============================================================================== --- head/crypto/openssl/crypto/asn1/ameth_lib.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/asn1/ameth_lib.c Tue Aug 14 17:48:02 2018 (r337791) @@ -3,7 +3,7 @@ * 2006. */ /* ==================================================================== - * Copyright (c) 2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 2006-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -304,6 +304,18 @@ EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int fl goto err; } else ameth->info = NULL; + + /* + * One of the following must be true: + * + * pem_str == NULL AND ASN1_PKEY_ALIAS is set + * pem_str != NULL AND ASN1_PKEY_ALIAS is clear + * + * Anything else is an error and may lead to a corrupt ASN1 method table + */ + if (!((pem_str == NULL && (flags & ASN1_PKEY_ALIAS) != 0) + || (pem_str != NULL && (flags & ASN1_PKEY_ALIAS) == 0))) + goto err; if (pem_str) { ameth->pem_str = BUF_strdup(pem_str); Modified: head/crypto/openssl/crypto/asn1/asn1.h ============================================================================== --- head/crypto/openssl/crypto/asn1/asn1.h Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/asn1/asn1.h Tue Aug 14 17:48:02 2018 (r337791) @@ -1164,6 +1164,7 @@ int SMIME_text(BIO *in, BIO *out); * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + void ERR_load_ASN1_strings(void); /* Error codes for the ASN1 functions. */ @@ -1264,7 +1265,10 @@ void ERR_load_ASN1_strings(void); # define ASN1_F_D2I_X509 156 # define ASN1_F_D2I_X509_CINF 157 # define ASN1_F_D2I_X509_PKEY 159 +# define ASN1_F_DO_BUF 221 # define ASN1_F_I2D_ASN1_BIO_STREAM 211 +# define ASN1_F_I2D_ASN1_BOOLEAN 223 +# define ASN1_F_I2D_ASN1_OBJECT 222 # define ASN1_F_I2D_ASN1_SET 188 # define ASN1_F_I2D_ASN1_TIME 160 # define ASN1_F_I2D_DSA_PUBKEY 161 @@ -1414,7 +1418,7 @@ void ERR_load_ASN1_strings(void); # define ASN1_R_WRONG_TAG 168 # define ASN1_R_WRONG_TYPE 169 -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif Modified: head/crypto/openssl/crypto/asn1/asn1_err.c ============================================================================== --- head/crypto/openssl/crypto/asn1/asn1_err.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/asn1/asn1_err.c Tue Aug 14 17:48:02 2018 (r337791) @@ -166,7 +166,10 @@ static ERR_STRING_DATA ASN1_str_functs[] = { {ERR_FUNC(ASN1_F_D2I_X509), "D2I_X509"}, {ERR_FUNC(ASN1_F_D2I_X509_CINF), "D2I_X509_CINF"}, {ERR_FUNC(ASN1_F_D2I_X509_PKEY), "d2i_X509_PKEY"}, + {ERR_FUNC(ASN1_F_DO_BUF), "DO_BUF"}, {ERR_FUNC(ASN1_F_I2D_ASN1_BIO_STREAM), "i2d_ASN1_bio_stream"}, + {ERR_FUNC(ASN1_F_I2D_ASN1_BOOLEAN), "i2d_ASN1_BOOLEAN"}, + {ERR_FUNC(ASN1_F_I2D_ASN1_OBJECT), "i2d_ASN1_OBJECT"}, {ERR_FUNC(ASN1_F_I2D_ASN1_SET), "i2d_ASN1_SET"}, {ERR_FUNC(ASN1_F_I2D_ASN1_TIME), "I2D_ASN1_TIME"}, {ERR_FUNC(ASN1_F_I2D_DSA_PUBKEY), "i2d_DSA_PUBKEY"}, Modified: head/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- head/crypto/openssl/crypto/asn1/tasn_enc.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/asn1/tasn_enc.c Tue Aug 14 17:48:02 2018 (r337791) @@ -4,7 +4,7 @@ * 2000. */ /* ==================================================================== - * Copyright (c) 2000-2004 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -588,6 +588,8 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout otmp = (ASN1_OBJECT *)*pval; cont = otmp->data; len = otmp->length; + if (cont == NULL || len == 0) + return -1; break; case V_ASN1_NULL: Modified: head/crypto/openssl/crypto/bio/bss_log.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_log.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/bio/bss_log.c Tue Aug 14 17:48:02 2018 (r337791) @@ -1,6 +1,6 @@ /* crypto/bio/bss_log.c */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -242,7 +242,7 @@ static int MS_CALLBACK slg_write(BIO *b, const char *i if ((buf = (char *)OPENSSL_malloc(inl + 1)) == NULL) { return (0); } - strncpy(buf, in, inl); + memcpy(buf, in, inl); buf[inl] = '\0'; i = 0; Modified: head/crypto/openssl/crypto/bio/bss_mem.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_mem.c Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/bio/bss_mem.c Tue Aug 14 17:48:02 2018 (r337791) @@ -188,6 +188,8 @@ static int mem_write(BIO *b, const char *in, int inl) } BIO_clear_retry_flags(b); + if (inl == 0) + return 0; blen = bm->length; if (BUF_MEM_grow_clean(bm, blen + inl) != (blen + inl)) goto end; Modified: head/crypto/openssl/crypto/bn/Makefile ============================================================================== --- head/crypto/openssl/crypto/bn/Makefile Tue Aug 14 17:46:54 2018 (r337790) +++ head/crypto/openssl/crypto/bn/Makefile Tue Aug 14 17:48:02 2018 (r337791) @@ -197,21 +197,24 @@ bn_add.o: ../../include/openssl/e_os2.h ../../include/ bn_add.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_add.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_add.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_add.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_add.c bn_lcl.h +bn_add.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_add.c +bn_add.o: bn_lcl.h bn_asm.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_asm.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_asm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_asm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_asm.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_asm.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_asm.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_asm.c bn_lcl.h +bn_asm.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_asm.c +bn_asm.o: bn_lcl.h bn_blind.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_blind.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_blind.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_blind.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_blind.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_blind.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_blind.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_blind.c bn_lcl.h +bn_blind.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h +bn_blind.o: bn_blind.c bn_lcl.h bn_const.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h bn_const.o: ../../include/openssl/opensslconf.h bn_const.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h @@ -223,7 +226,8 @@ bn_ctx.o: ../../include/openssl/e_os2.h ../../include/ bn_ctx.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_ctx.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_ctx.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_ctx.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_ctx.c bn_lcl.h +bn_ctx.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_ctx.c +bn_ctx.o: bn_lcl.h bn_depr.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_depr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h @@ -231,14 +235,15 @@ bn_depr.o: ../../include/openssl/lhash.h ../../include bn_depr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_depr.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h bn_depr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -bn_depr.o: ../cryptlib.h bn_depr.c bn_lcl.h +bn_depr.o: ../bn_int.h ../cryptlib.h bn_depr.c bn_lcl.h bn_div.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_div.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_div.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_div.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_div.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_div.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_div.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_div.c bn_lcl.h +bn_div.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_div.c +bn_div.o: bn_lcl.h bn_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h bn_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h bn_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h @@ -252,7 +257,7 @@ bn_exp.o: ../../include/openssl/e_os2.h ../../include/ bn_exp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_exp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_exp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_exp.o: ../../include/openssl/symhacks.h ../constant_time_locl.h +bn_exp.o: ../../include/openssl/symhacks.h ../bn_int.h ../constant_time_locl.h bn_exp.o: ../cryptlib.h bn_exp.c bn_lcl.h rsaz_exp.h bn_exp2.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_exp2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h @@ -260,70 +265,80 @@ bn_exp2.o: ../../include/openssl/e_os2.h ../../include bn_exp2.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_exp2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_exp2.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_exp2.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_exp2.c bn_lcl.h +bn_exp2.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_exp2.c +bn_exp2.o: bn_lcl.h bn_gcd.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_gcd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_gcd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_gcd.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_gcd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_gcd.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_gcd.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_gcd.c bn_lcl.h +bn_gcd.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_gcd.c +bn_gcd.o: bn_lcl.h bn_gf2m.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_gf2m.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_gf2m.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_gf2m.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_gf2m.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_gf2m.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_gf2m.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_gf2m.c bn_lcl.h +bn_gf2m.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_gf2m.c +bn_gf2m.o: bn_lcl.h bn_kron.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_kron.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_kron.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_kron.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_kron.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_kron.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_kron.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_kron.c bn_lcl.h +bn_kron.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_kron.c +bn_kron.o: bn_lcl.h bn_lib.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_lib.c +bn_lib.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_lcl.h +bn_lib.o: bn_lib.c bn_mod.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_mod.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Aug 14 17:48: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 9DB65107FB87; Tue, 14 Aug 2018 17:48:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 536367E28A; Tue, 14 Aug 2018 17:48: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 3422C1ED52; Tue, 14 Aug 2018 17:48:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHmTAT027325; Tue, 14 Aug 2018 17:48:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHmTI3027324; Tue, 14 Aug 2018 17:48:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808141748.w7EHmTI3027324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Aug 2018 17:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337792 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 337792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:48:29 -0000 Author: kib Date: Tue Aug 14 17:48:28 2018 New Revision: 337792 URL: https://svnweb.freebsd.org/changeset/base/337792 Log: MFC r337774: Reserve page at the physical address zero on amd64. Approved by: so (insta-MFC) Modified: stable/11/sys/amd64/amd64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Tue Aug 14 17:48:02 2018 (r337791) +++ stable/11/sys/amd64/amd64/pmap.c Tue Aug 14 17:48:28 2018 (r337792) @@ -1220,6 +1220,9 @@ pmap_init(void) vm_size_t s; int error, i, pv_npg, ret, skz63; + /* L1TF, reserve page @0 unconditionally */ + vm_page_blacklist_add(0, bootverbose); + /* Detect bare-metal Skylake Server and Skylake-X. */ if (vm_guest == VM_GUEST_NO && cpu_vendor_id == CPU_VENDOR_INTEL && CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) == 0x55) { From owner-svn-src-all@freebsd.org Tue Aug 14 17:49: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 96082107FC3E; Tue, 14 Aug 2018 17:49:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC077E435; Tue, 14 Aug 2018 17:49:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CE351ED53; Tue, 14 Aug 2018 17:49:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHnqPj027447; Tue, 14 Aug 2018 17:49:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHnq1f027446; Tue, 14 Aug 2018 17:49:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808141749.w7EHnq1f027446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Aug 2018 17:49: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: r337793 - stable/11/sys/x86/include X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/x86/include X-SVN-Commit-Revision: 337793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:49:53 -0000 Author: kib Date: Tue Aug 14 17:49:52 2018 New Revision: 337793 URL: https://svnweb.freebsd.org/changeset/base/337793 Log: MFC r337777: Add definitions related to the L1D flush operation capability and MSR. Approved by: so (insta-MFC) Modified: stable/11/sys/x86/include/specialreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/include/specialreg.h ============================================================================== --- stable/11/sys/x86/include/specialreg.h Tue Aug 14 17:48:28 2018 (r337792) +++ stable/11/sys/x86/include/specialreg.h Tue Aug 14 17:49:52 2018 (r337793) @@ -387,6 +387,7 @@ */ #define CPUID_STDEXT3_IBPB 0x04000000 #define CPUID_STDEXT3_STIBP 0x08000000 +#define CPUID_STDEXT3_L1D_FLUSH 0x10000000 #define CPUID_STDEXT3_ARCH_CAP 0x20000000 #define CPUID_STDEXT3_SSBD 0x80000000 @@ -438,6 +439,7 @@ #define MSR_IA32_EXT_CONFIG 0x0ee /* Undocumented. Core Solo/Duo only */ #define MSR_MTRRcap 0x0fe #define MSR_IA32_ARCH_CAP 0x10a +#define MSR_IA32_FLUSH_CMD 0x10b #define MSR_BBL_CR_ADDR 0x116 #define MSR_BBL_CR_DECC 0x118 #define MSR_BBL_CR_CTL 0x119 @@ -591,6 +593,9 @@ /* MSR IA32_PRED_CMD */ #define IA32_PRED_CMD_IBPB_BARRIER 0x0000000000000001ULL + +/* MSR IA32_FLUSH_CMD */ +#define IA32_FLUSH_CMD_L1D 0x00000001 /* * PAT modes. From owner-svn-src-all@freebsd.org Tue Aug 14 17:51: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 49CFC107FCFC; Tue, 14 Aug 2018 17:51:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EED7F7E6A0; Tue, 14 Aug 2018 17:51:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D10791ED98; Tue, 14 Aug 2018 17:51:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHpDZJ029092; Tue, 14 Aug 2018 17:51:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHpDM9029089; Tue, 14 Aug 2018 17:51:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808141751.w7EHpDM9029089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Aug 2018 17:51:13 +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: r337794 - stable/11/sys/amd64/vmm/intel X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/intel X-SVN-Commit-Revision: 337794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:51:14 -0000 Author: kib Date: Tue Aug 14 17:51:12 2018 New Revision: 337794 URL: https://svnweb.freebsd.org/changeset/base/337794 Log: MFC r337785: Provide part of the mitigation for L1TF-VMM. Security: CVE-2018-3646 Approved by: so (insta-MFC) Modified: stable/11/sys/amd64/vmm/intel/vmx.c stable/11/sys/amd64/vmm/intel/vmx_genassym.c stable/11/sys/amd64/vmm/intel/vmx_support.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Tue Aug 14 17:49:52 2018 (r337793) +++ stable/11/sys/amd64/vmm/intel/vmx.c Tue Aug 14 17:51:12 2018 (r337794) @@ -185,6 +185,12 @@ static u_int vpid_alloc_failed; SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_alloc_failed, CTLFLAG_RD, &vpid_alloc_failed, 0, NULL); +static int guest_l1d_flush; +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush, CTLFLAG_RD, + &guest_l1d_flush, 0, NULL); + +uint64_t vmx_msr_flush_cmd; + /* * Use the last page below 4GB as the APIC access address. This address is * occupied by the boot firmware so it is guaranteed that it will not conflict @@ -719,6 +725,12 @@ vmx_init(int ipinum) printf("vmx_init: ept initialization failed (%d)\n", error); return (error); } + + guest_l1d_flush = (cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) == 0; + TUNABLE_INT_FETCH("hw.vmm.l1d_flush", &guest_l1d_flush); + if (guest_l1d_flush && + (cpu_stdext_feature3 & CPUID_STDEXT3_L1D_FLUSH) != 0) + vmx_msr_flush_cmd = IA32_FLUSH_CMD_L1D; /* * Stash the cr0 and cr4 bits that must be fixed to 0 or 1 Modified: stable/11/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx_genassym.c Tue Aug 14 17:49:52 2018 (r337793) +++ stable/11/sys/amd64/vmm/intel/vmx_genassym.c Tue Aug 14 17:51:12 2018 (r337794) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "vmx_cpufunc.h" @@ -86,3 +87,6 @@ ASSYM(PM_EPTGEN, offsetof(struct pmap, pm_eptgen)); ASSYM(KERNEL_SS, GSEL(GDATA_SEL, SEL_KPL)); ASSYM(KERNEL_CS, GSEL(GCODE_SEL, SEL_KPL)); + +ASSYM(PAGE_SIZE, PAGE_SIZE); +ASSYM(KERNBASE, KERNBASE); Modified: stable/11/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx_support.S Tue Aug 14 17:49:52 2018 (r337793) +++ stable/11/sys/amd64/vmm/intel/vmx_support.S Tue Aug 14 17:51:12 2018 (r337794) @@ -30,6 +30,7 @@ */ #include +#include #include "vmx_assym.h" @@ -175,9 +176,47 @@ ENTRY(vmx_enter_guest) jbe invept_error /* Check invept instruction error */ guest_restore: - cmpl $0, %edx - je do_launch + /* + * Flush L1D cache if requested. Use IA32_FLUSH_CMD MSR if available, + * otherwise load enough of the data from the zero_region to flush + * existing L1D content. + */ +#define L1D_FLUSH_SIZE (64 * 1024) + movl %edx, %r8d + cmpb $0, guest_l1d_flush(%rip) + je after_l1d + movq vmx_msr_flush_cmd(%rip), %rax + testq %rax, %rax + jz 1f + movq %rax, %rdx + shrq $32, %rdx + movl $MSR_IA32_FLUSH_CMD, %ecx + wrmsr + jmp after_l1d +1: movq $KERNBASE, %r9 + movq $-L1D_FLUSH_SIZE, %rcx + /* + * pass 1: Preload TLB. + * Kernel text is mapped using superpages. TLB preload is + * done for the benefit of older CPUs which split 2M page + * into 4k TLB entries. + */ +2: movb L1D_FLUSH_SIZE(%r9, %rcx), %al + addq $PAGE_SIZE, %rcx + jne 2b + xorl %eax, %eax + cpuid + movq $-L1D_FLUSH_SIZE, %rcx + /* pass 2: Read each cache line */ +3: movb L1D_FLUSH_SIZE(%r9, %rcx), %al + addq $64, %rcx + jne 3b + lfence +#undef L1D_FLUSH_SIZE +after_l1d: + cmpl $0, %r8d + je do_launch VMX_GUEST_RESTORE vmresume /* From owner-svn-src-all@freebsd.org Tue Aug 14 17:52: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 F0CFE107FE93; Tue, 14 Aug 2018 17:52:06 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 970F17E977; Tue, 14 Aug 2018 17:52:06 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 784BE1EDD4; Tue, 14 Aug 2018 17:52:06 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHq62X031390; Tue, 14 Aug 2018 17:52:06 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHq63A031389; Tue, 14 Aug 2018 17:52:06 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141752.w7EHq63A031389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337795 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 337795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:52:07 -0000 Author: jtl Date: Tue Aug 14 17:52:06 2018 New Revision: 337795 URL: https://svnweb.freebsd.org/changeset/base/337795 Log: MFC r337778: Add a global limit on the number of IPv4 fragments. The IP reassembly fragment limit is based on the number of mbuf clusters, which are a global resource. However, the limit is currently applied on a per-VNET basis. Given enough VNETs (or given sufficient customization of enough VNETs), it is possible that the sum of all the VNET limits will exceed the number of mbuf clusters available in the system. Given the fact that the fragment limit is intended (at least in part) to regulate access to a global resource, the fragment limit should be applied on a global basis. VNET-specific limits can be adjusted by modifying the net.inet.ip.maxfragpackets and net.inet.ip.maxfragsperpacket sysctls. To disable fragment reassembly globally, set net.inet.ip.maxfrags to 0. To disable fragment reassembly for a particular VNET, set net.inet.ip.maxfragpackets to 0. Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet/ip_reass.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_reass.c ============================================================================== --- stable/11/sys/netinet/ip_reass.c Tue Aug 14 17:51:12 2018 (r337794) +++ stable/11/sys/netinet/ip_reass.c Tue Aug 14 17:52:06 2018 (r337795) @@ -110,6 +110,15 @@ ipq_drop(struct ipqhead *head, struct ipq *fp) ipq_free(head, fp); } +static int maxfrags; +static volatile u_int nfrags; +SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfrags, CTLFLAG_RW, + &maxfrags, 0, + "Maximum number of IPv4 fragments allowed across all reassembly queues"); +SYSCTL_UINT(_net_inet_ip, OID_AUTO, curfrags, CTLFLAG_RD, + __DEVOLATILE(u_int *, &nfrags), 0, + "Current number of IPv4 fragments across all reassembly queues"); + static VNET_DEFINE(uma_zone_t, ipq_zone); #define V_ipq_zone VNET(ipq_zone) SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragpackets, CTLFLAG_VNET | @@ -146,7 +155,7 @@ ip_reass(struct mbuf *m) struct mbuf *p, *q, *nq, *t; struct ipq *fp; struct ipqhead *head; - int i, hlen, next; + int i, hlen, next, tmpmax; u_int8_t ecn, ecn0; uint32_t hash, hashkey[3]; #ifdef RSS @@ -156,8 +165,12 @@ ip_reass(struct mbuf *m) /* * If no reassembling or maxfragsperpacket are 0, * never accept fragments. + * Also, drop packet if it would exceed the maximum + * number of fragments. */ - if (V_noreass == 1 || V_maxfragsperpacket == 0) { + tmpmax = maxfrags; + if (V_noreass == 1 || V_maxfragsperpacket == 0 || + (tmpmax >= 0 && nfrags >= (u_int)tmpmax)) { IPSTAT_INC(ips_fragments); IPSTAT_INC(ips_fragdropped); m_freem(m); @@ -241,6 +254,7 @@ ip_reass(struct mbuf *m) #endif TAILQ_INSERT_HEAD(head, fp, ipq_list); fp->ipq_nfrags = 1; + atomic_add_int(&nfrags, 1); fp->ipq_ttl = IPFRAGTTL; fp->ipq_p = ip->ip_p; fp->ipq_id = ip->ip_id; @@ -251,6 +265,7 @@ ip_reass(struct mbuf *m) goto done; } else { fp->ipq_nfrags++; + atomic_add_int(&nfrags, 1); #ifdef MAC mac_ipq_update(m, fp); #endif @@ -327,6 +342,7 @@ ip_reass(struct mbuf *m) m->m_nextpkt = nq; IPSTAT_INC(ips_fragdropped); fp->ipq_nfrags--; + atomic_subtract_int(&nfrags, 1); m_freem(q); } @@ -392,6 +408,7 @@ ip_reass(struct mbuf *m) while (m->m_pkthdr.csum_data & 0xffff0000) m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16); + atomic_subtract_int(&nfrags, fp->ipq_nfrags); #ifdef MAC mac_ipq_reassemble(fp, m); mac_ipq_destroy(fp); @@ -451,8 +468,10 @@ ip_reass(struct mbuf *m) dropfrag: IPSTAT_INC(ips_fragdropped); - if (fp != NULL) + if (fp != NULL) { fp->ipq_nfrags--; + atomic_subtract_int(&nfrags, 1); + } m_freem(m); done: IPQ_UNLOCK(hash); @@ -479,9 +498,11 @@ ipreass_init(void) NULL, UMA_ALIGN_PTR, 0); uma_zone_set_max(V_ipq_zone, nmbclusters / 32); - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { + maxfrags = nmbclusters / 32; EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change, NULL, EVENTHANDLER_PRI_ANY); + } } /* @@ -564,9 +585,19 @@ ipreass_drain_tomax(void) static void ipreass_zone_change(void *tag) { + VNET_ITERATOR_DECL(vnet_iter); + int max; - uma_zone_set_max(V_ipq_zone, nmbclusters / 32); - ipreass_drain_tomax(); + maxfrags = nmbclusters / 32; + max = nmbclusters / 32; + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + uma_zone_set_max(V_ipq_zone, max); + ipreass_drain_tomax(); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK_NOSLEEP(); } /* @@ -629,6 +660,7 @@ ipq_reuse(int start) struct mbuf *m; IPSTAT_ADD(ips_fragtimeout, fp->ipq_nfrags); + atomic_subtract_int(&nfrags, fp->ipq_nfrags); while (fp->ipq_frags) { m = fp->ipq_frags; fp->ipq_frags = m->m_nextpkt; @@ -653,6 +685,7 @@ ipq_free(struct ipqhead *fhp, struct ipq *fp) { struct mbuf *q; + atomic_subtract_int(&nfrags, fp->ipq_nfrags); while (fp->ipq_frags) { q = fp->ipq_frags; fp->ipq_frags = q->m_nextpkt; From owner-svn-src-all@freebsd.org Tue Aug 14 17:54:40 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 CEE5C107FF61; Tue, 14 Aug 2018 17:54:40 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80C8A7F0EC; Tue, 14 Aug 2018 17:54:40 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E10E1EEF0; Tue, 14 Aug 2018 17:54:40 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHsenw032466; Tue, 14 Aug 2018 17:54:40 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHsejC032465; Tue, 14 Aug 2018 17:54:40 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141754.w7EHsejC032465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:54:40 +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: r337796 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 337796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:54:41 -0000 Author: jtl Date: Tue Aug 14 17:54:39 2018 New Revision: 337796 URL: https://svnweb.freebsd.org/changeset/base/337796 Log: MFC r337780: Implement a limit on on the number of IPv4 reassembly queues per bucket. There is a hashing algorithm which should distribute IPv4 reassembly queues across the available buckets in a relatively even way. However, if there is a flaw in the hashing algorithm which allows a large number of IPv4 fragment reassembly queues to end up in a single bucket, a per- bucket limit could help mitigate the performance impact of this flaw. Implement such a limit, with a default of twice the maximum number of reassembly queues divided by the number of buckets. Recalculate the limit any time the maximum number of reassembly queues changes. However, allow the user to override the value using a sysctl (net.inet.ip.maxfragbucketsize). Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet/ip_reass.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_reass.c ============================================================================== --- stable/11/sys/netinet/ip_reass.c Tue Aug 14 17:52:06 2018 (r337795) +++ stable/11/sys/netinet/ip_reass.c Tue Aug 14 17:54:39 2018 (r337796) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ SYSCTL_DECL(_net_inet_ip); struct ipqbucket { TAILQ_HEAD(ipqhead, ipq) head; struct mtx lock; + int count; }; static VNET_DEFINE(struct ipqbucket, ipq[IPREASS_NHASH]); @@ -82,6 +84,9 @@ static VNET_DEFINE(uint32_t, ipq_hashseed); #define IPQ_UNLOCK(i) mtx_unlock(&V_ipq[i].lock) #define IPQ_LOCK_ASSERT(i) mtx_assert(&V_ipq[i].lock, MA_OWNED) +static VNET_DEFINE(int, ipreass_maxbucketsize); +#define V_ipreass_maxbucketsize VNET(ipreass_maxbucketsize) + void ipreass_init(void); void ipreass_drain(void); void ipreass_slowtimo(void); @@ -89,25 +94,26 @@ void ipreass_slowtimo(void); void ipreass_destroy(void); #endif static int sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS); +static int sysctl_maxfragbucketsize(SYSCTL_HANDLER_ARGS); static void ipreass_zone_change(void *); static void ipreass_drain_tomax(void); -static void ipq_free(struct ipqhead *, struct ipq *); +static void ipq_free(struct ipqbucket *, struct ipq *); static struct ipq * ipq_reuse(int); static inline void -ipq_timeout(struct ipqhead *head, struct ipq *fp) +ipq_timeout(struct ipqbucket *bucket, struct ipq *fp) { IPSTAT_ADD(ips_fragtimeout, fp->ipq_nfrags); - ipq_free(head, fp); + ipq_free(bucket, fp); } static inline void -ipq_drop(struct ipqhead *head, struct ipq *fp) +ipq_drop(struct ipqbucket *bucket, struct ipq *fp) { IPSTAT_ADD(ips_fragdropped, fp->ipq_nfrags); - ipq_free(head, fp); + ipq_free(bucket, fp); } static int maxfrags; @@ -136,6 +142,10 @@ static VNET_DEFINE(int, maxfragsperpacket); SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(maxfragsperpacket), 0, "Maximum number of IPv4 fragments allowed per packet"); +SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragbucketsize, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, + sysctl_maxfragbucketsize, "I", + "Maximum number of IPv4 fragment reassembly queue entries per bucket"); /* * Take incoming datagram fragment and try to reassemble it into @@ -241,9 +251,12 @@ ip_reass(struct mbuf *m) * If first fragment to arrive, create a reassembly queue. */ if (fp == NULL) { - fp = uma_zalloc(V_ipq_zone, M_NOWAIT); + if (V_ipq[hash].count < V_ipreass_maxbucketsize) + fp = uma_zalloc(V_ipq_zone, M_NOWAIT); if (fp == NULL) fp = ipq_reuse(hash); + if (fp == NULL) + goto dropfrag; #ifdef MAC if (mac_ipq_init(fp, M_NOWAIT) != 0) { uma_zfree(V_ipq_zone, fp); @@ -253,6 +266,7 @@ ip_reass(struct mbuf *m) mac_ipq_create(m, fp); #endif TAILQ_INSERT_HEAD(head, fp, ipq_list); + V_ipq[hash].count++; fp->ipq_nfrags = 1; atomic_add_int(&nfrags, 1); fp->ipq_ttl = IPFRAGTTL; @@ -360,7 +374,7 @@ ip_reass(struct mbuf *m) for (p = NULL, q = fp->ipq_frags; q; p = q, q = q->m_nextpkt) { if (ntohs(GETIP(q)->ip_off) != next) { if (fp->ipq_nfrags > V_maxfragsperpacket) - ipq_drop(head, fp); + ipq_drop(&V_ipq[hash], fp); goto done; } next += ntohs(GETIP(q)->ip_len); @@ -368,7 +382,7 @@ ip_reass(struct mbuf *m) /* Make sure the last packet didn't have the IP_MF flag */ if (p->m_flags & M_IP_FRAG) { if (fp->ipq_nfrags > V_maxfragsperpacket) - ipq_drop(head, fp); + ipq_drop(&V_ipq[hash], fp); goto done; } @@ -379,7 +393,7 @@ ip_reass(struct mbuf *m) ip = GETIP(q); if (next + (ip->ip_hl << 2) > IP_MAXPACKET) { IPSTAT_INC(ips_toolong); - ipq_drop(head, fp); + ipq_drop(&V_ipq[hash], fp); goto done; } @@ -423,6 +437,7 @@ ip_reass(struct mbuf *m) ip->ip_src = fp->ipq_src; ip->ip_dst = fp->ipq_dst; TAILQ_REMOVE(head, fp, ipq_list); + V_ipq[hash].count--; uma_zfree(V_ipq_zone, fp); m->m_len += (ip->ip_hl << 2); m->m_data -= (ip->ip_hl << 2); @@ -486,17 +501,21 @@ done: void ipreass_init(void) { + int max; for (int i = 0; i < IPREASS_NHASH; i++) { TAILQ_INIT(&V_ipq[i].head); mtx_init(&V_ipq[i].lock, "IP reassembly", NULL, MTX_DEF | MTX_DUPOK); + V_ipq[i].count = 0; } V_ipq_hashseed = arc4random(); V_maxfragsperpacket = 16; V_ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - uma_zone_set_max(V_ipq_zone, nmbclusters / 32); + max = nmbclusters / 32; + max = uma_zone_set_max(V_ipq_zone, max); + V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); if (IS_DEFAULT_VNET(curvnet)) { maxfrags = nmbclusters / 32; @@ -517,7 +536,7 @@ ipreass_slowtimo(void) IPQ_LOCK(i); TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, tmp) if (--fp->ipq_ttl == 0) - ipq_timeout(&V_ipq[i].head, fp); + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } } @@ -532,7 +551,10 @@ ipreass_drain(void) for (int i = 0; i < IPREASS_NHASH; i++) { IPQ_LOCK(i); while(!TAILQ_EMPTY(&V_ipq[i].head)) - ipq_drop(&V_ipq[i].head, TAILQ_FIRST(&V_ipq[i].head)); + ipq_drop(&V_ipq[i], TAILQ_FIRST(&V_ipq[i].head)); + KASSERT(V_ipq[i].count == 0, + ("%s: V_ipq[%d] count %d (V_ipq=%p)", __func__, i, + V_ipq[i].count, V_ipq)); IPQ_UNLOCK(i); } } @@ -560,9 +582,23 @@ ipreass_destroy(void) static void ipreass_drain_tomax(void) { + struct ipq *fp; int target; /* + * Make sure each bucket is under the new limit. If + * necessary, drop enough of the oldest elements from + * each bucket to get under the new limit. + */ + for (int i = 0; i < IPREASS_NHASH; i++) { + IPQ_LOCK(i); + while (V_ipq[i].count > V_ipreass_maxbucketsize && + (fp = TAILQ_LAST(&V_ipq[i].head, ipqhead)) != NULL) + ipq_timeout(&V_ipq[i], fp); + IPQ_UNLOCK(i); + } + + /* * If we are over the maximum number of fragments, * drain off enough to get down to the new limit, * stripping off last elements on queues. Every @@ -570,13 +606,11 @@ ipreass_drain_tomax(void) */ target = uma_zone_get_max(V_ipq_zone); while (uma_zone_get_cur(V_ipq_zone) > target) { - struct ipq *fp; - for (int i = 0; i < IPREASS_NHASH; i++) { IPQ_LOCK(i); fp = TAILQ_LAST(&V_ipq[i].head, ipqhead); if (fp != NULL) - ipq_timeout(&V_ipq[i].head, fp); + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } } @@ -593,7 +627,8 @@ ipreass_zone_change(void *tag) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - uma_zone_set_max(V_ipq_zone, max); + max = uma_zone_set_max(V_ipq_zone, max); + V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); ipreass_drain_tomax(); CURVNET_RESTORE(); } @@ -625,6 +660,7 @@ sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS) * and place an extreme upper bound. */ max = uma_zone_set_max(V_ipq_zone, max); + V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); ipreass_drain_tomax(); V_noreass = 0; } else if (max == 0) { @@ -633,6 +669,7 @@ sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS) } else if (max == -1) { V_noreass = 0; uma_zone_set_max(V_ipq_zone, 0); + V_ipreass_maxbucketsize = INT_MAX; } else return (EINVAL); return (0); @@ -646,16 +683,15 @@ static struct ipq * ipq_reuse(int start) { struct ipq *fp; - int i; + int bucket, i; IPQ_LOCK_ASSERT(start); - for (i = start;; i++) { - if (i == IPREASS_NHASH) - i = 0; - if (i != start && IPQ_TRYLOCK(i) == 0) + for (i = 0; i < IPREASS_NHASH; i++) { + bucket = (start + i) % IPREASS_NHASH; + if (bucket != start && IPQ_TRYLOCK(bucket) == 0) continue; - fp = TAILQ_LAST(&V_ipq[i].head, ipqhead); + fp = TAILQ_LAST(&V_ipq[bucket].head, ipqhead); if (fp) { struct mbuf *m; @@ -666,22 +702,24 @@ ipq_reuse(int start) fp->ipq_frags = m->m_nextpkt; m_freem(m); } - TAILQ_REMOVE(&V_ipq[i].head, fp, ipq_list); - if (i != start) - IPQ_UNLOCK(i); - IPQ_LOCK_ASSERT(start); - return (fp); + TAILQ_REMOVE(&V_ipq[bucket].head, fp, ipq_list); + V_ipq[bucket].count--; + if (bucket != start) + IPQ_UNLOCK(bucket); + break; } - if (i != start) - IPQ_UNLOCK(i); + if (bucket != start) + IPQ_UNLOCK(bucket); } + IPQ_LOCK_ASSERT(start); + return (fp); } /* * Free a fragment reassembly header and all associated datagrams. */ static void -ipq_free(struct ipqhead *fhp, struct ipq *fp) +ipq_free(struct ipqbucket *bucket, struct ipq *fp) { struct mbuf *q; @@ -691,6 +729,26 @@ ipq_free(struct ipqhead *fhp, struct ipq *fp) fp->ipq_frags = q->m_nextpkt; m_freem(q); } - TAILQ_REMOVE(fhp, fp, ipq_list); + TAILQ_REMOVE(&bucket->head, fp, ipq_list); + bucket->count--; uma_zfree(V_ipq_zone, fp); +} + +/* + * Get or set the maximum number of reassembly queues per bucket. + */ +static int +sysctl_maxfragbucketsize(SYSCTL_HANDLER_ARGS) +{ + int error, max; + + max = V_ipreass_maxbucketsize; + error = sysctl_handle_int(oidp, &max, 0, req); + if (error || !req->newptr) + return (error); + if (max <= 0) + return (EINVAL); + V_ipreass_maxbucketsize = max; + ipreass_drain_tomax(); + return (0); } From owner-svn-src-all@freebsd.org Tue Aug 14 17:59: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 627DC10800E7; Tue, 14 Aug 2018 17:59:43 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14D0B7F377; Tue, 14 Aug 2018 17:59:43 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA9711EEF3; Tue, 14 Aug 2018 17:59:42 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EHxgB4032733; Tue, 14 Aug 2018 17:59:42 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EHxgfa032730; Tue, 14 Aug 2018 17:59:42 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141759.w7EHxgfa032730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 17:59: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: r337797 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 337797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 17:59:43 -0000 Author: jtl Date: Tue Aug 14 17:59:42 2018 New Revision: 337797 URL: https://svnweb.freebsd.org/changeset/base/337797 Log: MFC r337781: Make the IPv6 fragment limits be global, rather than per-VNET, limits. The IPv6 reassembly fragment limit is based on the number of mbuf clusters, which are a global resource. However, the limit is currently applied on a per-VNET basis. Given enough VNETs (or given sufficient customization on enough VNETs), it is possible that the sum of all the VNET fragment limits will exceed the number of mbuf clusters available in the system. Given the fact that the fragment limits are intended (at least in part) to regulate access to a global resource, the IPv6 fragment limit should be applied on a global basis. Note that it is still possible to disable fragmentation for a particular VNET by setting the net.inet6.ip6.maxfragpackets sysctl to 0 for that VNET. In addition, it is now possible to disable fragmentation globally by setting the net.inet6.ip6.maxfrags sysctl to 0. Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet6/frag6.c stable/11/sys/netinet6/in6_proto.c stable/11/sys/netinet6/ip6_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Tue Aug 14 17:54:39 2018 (r337796) +++ stable/11/sys/netinet6/frag6.c Tue Aug 14 17:59:42 2018 (r337797) @@ -87,12 +87,11 @@ struct ip6qbucket { }; static VNET_DEFINE(volatile u_int, frag6_nfragpackets); -static VNET_DEFINE(volatile u_int, frag6_nfrags); +volatile u_int frag6_nfrags = 0; static VNET_DEFINE(struct ip6qbucket, ip6q[IP6REASS_NHASH]); static VNET_DEFINE(uint32_t, ip6q_hashseed); #define V_frag6_nfragpackets VNET(frag6_nfragpackets) -#define V_frag6_nfrags VNET(frag6_nfrags) #define V_ip6q VNET(ip6q) #define V_ip6q_hashseed VNET(ip6q_hashseed) @@ -110,9 +109,16 @@ static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment r static void frag6_change(void *tag) { + VNET_ITERATOR_DECL(vnet_iter); - V_ip6_maxfragpackets = nmbclusters / 4; - V_ip6_maxfrags = nmbclusters / 4; + ip6_maxfrags = nmbclusters / 4; + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_ip6_maxfragpackets = nmbclusters / 4; + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK_NOSLEEP(); } void @@ -122,7 +128,6 @@ frag6_init(void) int i; V_ip6_maxfragpackets = nmbclusters / 4; - V_ip6_maxfrags = nmbclusters / 4; for (i = 0; i < IP6REASS_NHASH; i++) { q6 = IP6Q_HEAD(i); q6->ip6q_next = q6->ip6q_prev = q6; @@ -132,6 +137,7 @@ frag6_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + ip6_maxfrags = nmbclusters / 4; EVENTHANDLER_REGISTER(nmbclusters_change, frag6_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -265,9 +271,9 @@ frag6_input(struct mbuf **mp, int *offp, int proto) * If maxfrag is 0, never accept fragments. * If maxfrag is -1, accept all fragments without limitation. */ - if (V_ip6_maxfrags < 0) + if (ip6_maxfrags < 0) ; - else if (V_frag6_nfrags >= (u_int)V_ip6_maxfrags) + else if (frag6_nfrags >= (u_int)ip6_maxfrags) goto dropfrag; for (q6 = head->ip6q_next; q6 != head; q6 = q6->ip6q_next) @@ -528,7 +534,7 @@ insert: * the most recently active fragmented packet. */ frag6_enq(ip6af, af6->ip6af_up, hash); - atomic_add_int(&V_frag6_nfrags, 1); + atomic_add_int(&frag6_nfrags, 1); q6->ip6q_nfrag++; #if 0 /* xxx */ if (q6 != head->ip6q_next) { @@ -592,7 +598,7 @@ insert: if (ip6_deletefraghdr(m, offset, M_NOWAIT) != 0) { frag6_remque(q6, hash); - atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); + atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_destroy(q6); #endif @@ -609,7 +615,7 @@ insert: (caddr_t)&nxt); frag6_remque(q6, hash); - atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); + atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_reassemble(q6, m); mac_ip6q_destroy(q6); @@ -705,7 +711,7 @@ frag6_freef(struct ip6q *q6, uint32_t bucket) free(af6, M_FTABLE); } frag6_remque(q6, bucket); - atomic_subtract_int(&V_frag6_nfrags, q6->ip6q_nfrag); + atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_destroy(q6); #endif Modified: stable/11/sys/netinet6/in6_proto.c ============================================================================== --- stable/11/sys/netinet6/in6_proto.c Tue Aug 14 17:54:39 2018 (r337796) +++ stable/11/sys/netinet6/in6_proto.c Tue Aug 14 17:59:42 2018 (r337797) @@ -383,7 +383,7 @@ VNET_DEFINE(int, ip6_no_radr) = 0; VNET_DEFINE(int, ip6_norbit_raif) = 0; VNET_DEFINE(int, ip6_rfc6204w3) = 0; VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ -VNET_DEFINE(int, ip6_maxfrags); /* initialized in frag6.c:frag6_init() */ +int ip6_maxfrags; /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_log_interval) = 5; VNET_DEFINE(int, ip6_hdrnestlimit) = 15;/* How many header options will we * process? */ @@ -557,8 +557,10 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEFAULTZONE, us CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_use_defzone), 0, "Use the default scope zone when none is specified"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS, maxfrags, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfrags), 0, - "Maximum allowed number of outstanding IPv6 packet fragments"); + CTLFLAG_RW, &ip6_maxfrags, 0, + "Maximum allowed number of outstanding IPv6 packet fragments. " + "A value of 0 means no fragmented packets will be accepted, while a " + "a value of -1 means no limit"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MCAST_PMTU, mcast_pmtu, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_mcast_pmtu), 0, "Enable path MTU discovery for multicast packets"); Modified: stable/11/sys/netinet6/ip6_var.h ============================================================================== --- stable/11/sys/netinet6/ip6_var.h Tue Aug 14 17:54:39 2018 (r337796) +++ stable/11/sys/netinet6/ip6_var.h Tue Aug 14 17:59:42 2018 (r337797) @@ -296,7 +296,7 @@ VNET_DECLARE(struct socket *, ip6_mrouter); /* multica VNET_DECLARE(int, ip6_sendredirects); /* send IP redirects when forwarding? */ VNET_DECLARE(int, ip6_maxfragpackets); /* Maximum packets in reassembly * queue */ -VNET_DECLARE(int, ip6_maxfrags); /* Maximum fragments in reassembly +extern int ip6_maxfrags; /* Maximum fragments in reassembly * queue */ VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */ VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */ @@ -312,7 +312,6 @@ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionT #define V_ip6_mrouter VNET(ip6_mrouter) #define V_ip6_sendredirects VNET(ip6_sendredirects) #define V_ip6_maxfragpackets VNET(ip6_maxfragpackets) -#define V_ip6_maxfrags VNET(ip6_maxfrags) #define V_ip6_accept_rtadv VNET(ip6_accept_rtadv) #define V_ip6_no_radr VNET(ip6_no_radr) #define V_ip6_norbit_raif VNET(ip6_norbit_raif) From owner-svn-src-all@freebsd.org Tue Aug 14 18:07: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 BE56B1080379; Tue, 14 Aug 2018 18:07:00 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 723CD7F8D0; Tue, 14 Aug 2018 18:07:00 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 391761F084; Tue, 14 Aug 2018 18:07:00 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EI70Gv038089; Tue, 14 Aug 2018 18:07:00 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EI6xqm038081; Tue, 14 Aug 2018 18:06:59 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141806.w7EI6xqm038081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 18:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337798 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 337798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:07:01 -0000 Author: jtl Date: Tue Aug 14 18:06:59 2018 New Revision: 337798 URL: https://svnweb.freebsd.org/changeset/base/337798 Log: MFC r337782: Add a limit of the number of fragments per IPv6 packet. The IPv4 fragment reassembly code supports a limit on the number of fragments per packet. The default limit is currently 17 fragments. Among other things, this limit serves to limit the number of fragments the code must parse when trying to reassembly a packet. Add a limit to the IPv6 reassembly code. By default, limit a packet to 65 fragments (64 on the queue, plus one final fragment to complete the packet). This allows an average fragment size of 1,008 bytes, which should be sufficient to hold a fragment. (Recall that the IPv6 minimum MTU is 1280 bytes. Therefore, this configuration allows a full-size IPv6 packet to be fragmented on a link with the minimum MTU and still carry approximately 272 bytes of headers before the fragmented portion of the packet.) Users can adjust this limit using the net.inet6.ip6.maxfragsperpacket sysctl. Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet6/frag6.c stable/11/sys/netinet6/in6.h stable/11/sys/netinet6/in6_proto.c stable/11/sys/netinet6/ip6_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Tue Aug 14 17:59:42 2018 (r337797) +++ stable/11/sys/netinet6/frag6.c Tue Aug 14 18:06:59 2018 (r337798) @@ -134,6 +134,7 @@ frag6_init(void) mtx_init(&V_ip6q[i].lock, "ip6qlock", NULL, MTX_DEF); } V_ip6q_hashseed = arc4random(); + V_ip6_maxfragsperpacket = 64; if (!IS_DEFAULT_VNET(curvnet)) return; @@ -530,6 +531,7 @@ insert: /* * Stick new segment in its place; * check for complete reassembly. + * If not complete, check fragment limit. * Move to front of packet queue, as we are * the most recently active fragmented packet. */ @@ -546,12 +548,20 @@ insert: for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = af6->ip6af_down) { if (af6->ip6af_off != next) { + if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { + IP6STAT_INC(ip6s_fragdropped); + frag6_freef(q6, hash); + } IP6Q_UNLOCK(hash); return IPPROTO_DONE; } next += af6->ip6af_frglen; } if (af6->ip6af_up->ip6af_mff) { + if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { + IP6STAT_INC(ip6s_fragdropped); + frag6_freef(q6, hash); + } IP6Q_UNLOCK(hash); return IPPROTO_DONE; } Modified: stable/11/sys/netinet6/in6.h ============================================================================== --- stable/11/sys/netinet6/in6.h Tue Aug 14 17:59:42 2018 (r337797) +++ stable/11/sys/netinet6/in6.h Tue Aug 14 18:06:59 2018 (r337798) @@ -637,7 +637,8 @@ struct ip6_mtuinfo { #define IPV6CTL_INTRQMAXLEN 51 /* max length of IPv6 netisr queue */ #define IPV6CTL_INTRDQMAXLEN 52 /* max length of direct IPv6 netisr * queue */ -#define IPV6CTL_MAXID 53 +#define IPV6CTL_MAXFRAGSPERPACKET 53 /* Max fragments per packet */ +#define IPV6CTL_MAXID 54 #endif /* __BSD_VISIBLE */ /* Modified: stable/11/sys/netinet6/in6_proto.c ============================================================================== --- stable/11/sys/netinet6/in6_proto.c Tue Aug 14 17:59:42 2018 (r337797) +++ stable/11/sys/netinet6/in6_proto.c Tue Aug 14 18:06:59 2018 (r337798) @@ -384,6 +384,7 @@ VNET_DEFINE(int, ip6_norbit_raif) = 0; VNET_DEFINE(int, ip6_rfc6204w3) = 0; VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ int ip6_maxfrags; /* initialized in frag6.c:frag6_init() */ +VNET_DEFINE(int, ip6_maxfragsperpacket); /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_log_interval) = 5; VNET_DEFINE(int, ip6_hdrnestlimit) = 15;/* How many header options will we * process? */ @@ -561,6 +562,9 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS, maxfrags, "Maximum allowed number of outstanding IPv6 packet fragments. " "A value of 0 means no fragmented packets will be accepted, while a " "a value of -1 means no limit"); +SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGSPERPACKET, maxfragsperpacket, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragsperpacket), 0, + "Maximum allowed number of fragments per packet"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MCAST_PMTU, mcast_pmtu, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_mcast_pmtu), 0, "Enable path MTU discovery for multicast packets"); Modified: stable/11/sys/netinet6/ip6_var.h ============================================================================== --- stable/11/sys/netinet6/ip6_var.h Tue Aug 14 17:59:42 2018 (r337797) +++ stable/11/sys/netinet6/ip6_var.h Tue Aug 14 18:06:59 2018 (r337798) @@ -298,6 +298,7 @@ VNET_DECLARE(int, ip6_maxfragpackets); /* Maximum pack * queue */ extern int ip6_maxfrags; /* Maximum fragments in reassembly * queue */ +VNET_DECLARE(int, ip6_maxfragsperpacket); /* Maximum fragments per packet */ VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */ VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */ VNET_DECLARE(int, ip6_norbit_raif); /* Disable R-bit in NA on RA @@ -312,6 +313,7 @@ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionT #define V_ip6_mrouter VNET(ip6_mrouter) #define V_ip6_sendredirects VNET(ip6_sendredirects) #define V_ip6_maxfragpackets VNET(ip6_maxfragpackets) +#define V_ip6_maxfragsperpacket VNET(ip6_maxfragsperpacket) #define V_ip6_accept_rtadv VNET(ip6_accept_rtadv) #define V_ip6_no_radr VNET(ip6_no_radr) #define V_ip6_norbit_raif VNET(ip6_norbit_raif) From owner-svn-src-all@freebsd.org Tue Aug 14 18:10: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 E51741080581; Tue, 14 Aug 2018 18:10:26 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B19C7FBF0; Tue, 14 Aug 2018 18:10:26 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7879D1F088; Tue, 14 Aug 2018 18:10:26 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EIAQFV038297; Tue, 14 Aug 2018 18:10:26 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIAPgd038294; Tue, 14 Aug 2018 18:10:25 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141810.w7EIAPgd038294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 18:10: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: r337799 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 337799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:10:27 -0000 Author: jtl Date: Tue Aug 14 18:10:25 2018 New Revision: 337799 URL: https://svnweb.freebsd.org/changeset/base/337799 Log: MFC r337783: Implement a limit on on the number of IPv6 reassembly queues per bucket. There is a hashing algorithm which should distribute IPv6 reassembly queues across the available buckets in a relatively even way. However, if there is a flaw in the hashing algorithm which allows a large number of IPv6 fragment reassembly queues to end up in a single bucket, a per- bucket limit could help mitigate the performance impact of this flaw. Implement such a limit, with a default of twice the maximum number of reassembly queues divided by the number of buckets. Recalculate the limit any time the maximum number of reassembly queues changes. However, allow the user to override the value using a sysctl (net.inet6.ip6.maxfragbucketsize). Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet6/frag6.c stable/11/sys/netinet6/in6.h stable/11/sys/netinet6/in6_proto.c stable/11/sys/netinet6/ip6_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Tue Aug 14 18:06:59 2018 (r337798) +++ stable/11/sys/netinet6/frag6.c Tue Aug 14 18:10:25 2018 (r337799) @@ -77,13 +77,14 @@ static void frag6_enq(struct ip6asfrag *, struct ip6as uint32_t bucket __unused); static void frag6_deq(struct ip6asfrag *, uint32_t bucket __unused); static void frag6_insque_head(struct ip6q *, struct ip6q *, - uint32_t bucket __unused); -static void frag6_remque(struct ip6q *, uint32_t bucket __unused); + uint32_t bucket); +static void frag6_remque(struct ip6q *, uint32_t bucket); static void frag6_freef(struct ip6q *, uint32_t bucket); struct ip6qbucket { struct ip6q ip6q; struct mtx lock; + int count; }; static VNET_DEFINE(volatile u_int, frag6_nfragpackets); @@ -106,6 +107,15 @@ static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment r /* * Initialise reassembly queue and fragment identifier. */ +void +frag6_set_bucketsize() +{ + int i; + + if ((i = V_ip6_maxfragpackets) > 0) + V_ip6_maxfragbucketsize = imax(i / (IP6REASS_NHASH / 2), 1); +} + static void frag6_change(void *tag) { @@ -116,6 +126,7 @@ frag6_change(void *tag) VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); V_ip6_maxfragpackets = nmbclusters / 4; + frag6_set_bucketsize(); CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); @@ -128,10 +139,12 @@ frag6_init(void) int i; V_ip6_maxfragpackets = nmbclusters / 4; + frag6_set_bucketsize(); for (i = 0; i < IP6REASS_NHASH; i++) { q6 = IP6Q_HEAD(i); q6->ip6q_next = q6->ip6q_prev = q6; mtx_init(&V_ip6q[i].lock, "ip6qlock", NULL, MTX_DEF); + V_ip6q[i].count = 0; } V_ip6q_hashseed = arc4random(); V_ip6_maxfragsperpacket = 64; @@ -302,7 +315,8 @@ frag6_input(struct mbuf **mp, int *offp, int proto) */ if (V_ip6_maxfragpackets < 0) ; - else if (V_frag6_nfragpackets >= (u_int)V_ip6_maxfragpackets) + else if (V_ip6q[hash].count >= V_ip6_maxfragbucketsize || + V_frag6_nfragpackets >= (u_int)V_ip6_maxfragpackets) goto dropfrag; atomic_add_int(&V_frag6_nfragpackets, 1); q6 = (struct ip6q *)malloc(sizeof(struct ip6q), M_FTABLE, @@ -760,7 +774,7 @@ frag6_deq(struct ip6asfrag *af6, uint32_t bucket __unu } static void -frag6_insque_head(struct ip6q *new, struct ip6q *old, uint32_t bucket __unused) +frag6_insque_head(struct ip6q *new, struct ip6q *old, uint32_t bucket) { IP6Q_LOCK_ASSERT(bucket); @@ -772,16 +786,18 @@ frag6_insque_head(struct ip6q *new, struct ip6q *old, new->ip6q_next = old->ip6q_next; old->ip6q_next->ip6q_prev= new; old->ip6q_next = new; + V_ip6q[bucket].count++; } static void -frag6_remque(struct ip6q *p6, uint32_t bucket __unused) +frag6_remque(struct ip6q *p6, uint32_t bucket) { IP6Q_LOCK_ASSERT(bucket); p6->ip6q_prev->ip6q_next = p6->ip6q_next; p6->ip6q_next->ip6q_prev = p6->ip6q_prev; + V_ip6q[bucket].count--; } /* @@ -803,29 +819,58 @@ frag6_slowtimo(void) IP6Q_LOCK(i); head = IP6Q_HEAD(i); q6 = head->ip6q_next; - if (q6) - while (q6 != head) { - --q6->ip6q_ttl; - q6 = q6->ip6q_next; - if (q6->ip6q_prev->ip6q_ttl == 0) { - IP6STAT_INC(ip6s_fragtimeout); - /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(q6->ip6q_prev, i); - } + if (q6 == NULL) { + /* + * XXXJTL: This should never happen. This + * should turn into an assertion. + */ + IP6Q_UNLOCK(i); + continue; + } + while (q6 != head) { + --q6->ip6q_ttl; + q6 = q6->ip6q_next; + if (q6->ip6q_prev->ip6q_ttl == 0) { + IP6STAT_INC(ip6s_fragtimeout); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(q6->ip6q_prev, i); } + } /* * If we are over the maximum number of fragments * (due to the limit being lowered), drain off * enough to get down to the new limit. + * Note that we drain all reassembly queues if + * maxfragpackets is 0 (fragmentation is disabled), + * and don't enforce a limit when maxfragpackets + * is negative. */ - while (V_frag6_nfragpackets > - (u_int)V_ip6_maxfragpackets && + while ((V_ip6_maxfragpackets == 0 || + (V_ip6_maxfragpackets > 0 && + V_ip6q[i].count > V_ip6_maxfragbucketsize)) && head->ip6q_prev != head) { IP6STAT_INC(ip6s_fragoverflow); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ frag6_freef(head->ip6q_prev, i); } IP6Q_UNLOCK(i); + } + /* + * If we are still over the maximum number of fragmented + * packets, drain off enough to get down to the new limit. + */ + i = 0; + while (V_ip6_maxfragpackets >= 0 && + V_frag6_nfragpackets > (u_int)V_ip6_maxfragpackets) { + IP6Q_LOCK(i); + head = IP6Q_HEAD(i); + if (head->ip6q_prev != head) { + IP6STAT_INC(ip6s_fragoverflow); + /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ + frag6_freef(head->ip6q_prev, i); + } + IP6Q_UNLOCK(i); + i = (i + 1) % IP6REASS_NHASH; } CURVNET_RESTORE(); } Modified: stable/11/sys/netinet6/in6.h ============================================================================== --- stable/11/sys/netinet6/in6.h Tue Aug 14 18:06:59 2018 (r337798) +++ stable/11/sys/netinet6/in6.h Tue Aug 14 18:10:25 2018 (r337799) @@ -638,7 +638,8 @@ struct ip6_mtuinfo { #define IPV6CTL_INTRDQMAXLEN 52 /* max length of direct IPv6 netisr * queue */ #define IPV6CTL_MAXFRAGSPERPACKET 53 /* Max fragments per packet */ -#define IPV6CTL_MAXID 54 +#define IPV6CTL_MAXFRAGBUCKETSIZE 54 /* Max reassembly queues per bucket */ +#define IPV6CTL_MAXID 55 #endif /* __BSD_VISIBLE */ /* Modified: stable/11/sys/netinet6/in6_proto.c ============================================================================== --- stable/11/sys/netinet6/in6_proto.c Tue Aug 14 18:06:59 2018 (r337798) +++ stable/11/sys/netinet6/in6_proto.c Tue Aug 14 18:10:25 2018 (r337799) @@ -384,6 +384,7 @@ VNET_DEFINE(int, ip6_norbit_raif) = 0; VNET_DEFINE(int, ip6_rfc6204w3) = 0; VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ int ip6_maxfrags; /* initialized in frag6.c:frag6_init() */ +VNET_DEFINE(int, ip6_maxfragbucketsize);/* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_maxfragsperpacket); /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_log_interval) = 5; VNET_DEFINE(int, ip6_hdrnestlimit) = 15;/* How many header options will we @@ -471,6 +472,20 @@ sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARGS) return (0); } +static int +sysctl_ip6_maxfragpackets(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = V_ip6_maxfragpackets; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || !req->newptr) + return (error); + V_ip6_maxfragpackets = val; + frag6_set_bucketsize(); + return (0); +} + SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_forwarding), 0, "Enable forwarding of IPv6 packets between interfaces"); @@ -483,8 +498,9 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_STATS, stats, struct ip6stat, ip6stat, "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)"); -SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragpackets), 0, +SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, NULL, 0, + sysctl_ip6_maxfragpackets, "I", "Default maximum number of outstanding fragmented IPv6 packets. " "A value of 0 means no fragmented packets will be accepted, while a " "a value of -1 means no limit"); @@ -562,6 +578,9 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS, maxfrags, "Maximum allowed number of outstanding IPv6 packet fragments. " "A value of 0 means no fragmented packets will be accepted, while a " "a value of -1 means no limit"); +SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGBUCKETSIZE, maxfragbucketsize, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragbucketsize), 0, + "Maximum number of reassembly queues per hash bucket"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGSPERPACKET, maxfragsperpacket, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragsperpacket), 0, "Maximum allowed number of fragments per packet"); Modified: stable/11/sys/netinet6/ip6_var.h ============================================================================== --- stable/11/sys/netinet6/ip6_var.h Tue Aug 14 18:06:59 2018 (r337798) +++ stable/11/sys/netinet6/ip6_var.h Tue Aug 14 18:10:25 2018 (r337799) @@ -298,6 +298,7 @@ VNET_DECLARE(int, ip6_maxfragpackets); /* Maximum pack * queue */ extern int ip6_maxfrags; /* Maximum fragments in reassembly * queue */ +VNET_DECLARE(int, ip6_maxfragbucketsize); /* Maximum reassembly queues per bucket */ VNET_DECLARE(int, ip6_maxfragsperpacket); /* Maximum fragments per packet */ VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */ VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */ @@ -313,6 +314,7 @@ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionT #define V_ip6_mrouter VNET(ip6_mrouter) #define V_ip6_sendredirects VNET(ip6_sendredirects) #define V_ip6_maxfragpackets VNET(ip6_maxfragpackets) +#define V_ip6_maxfragbucketsize VNET(ip6_maxfragbucketsize) #define V_ip6_maxfragsperpacket VNET(ip6_maxfragsperpacket) #define V_ip6_accept_rtadv VNET(ip6_accept_rtadv) #define V_ip6_no_radr VNET(ip6_no_radr) @@ -400,6 +402,7 @@ int ip6_fragment(struct ifnet *, struct mbuf *, int, u int route6_input(struct mbuf **, int *, int); +void frag6_set_bucketsize(void); void frag6_init(void); int frag6_input(struct mbuf **, int *, int); void frag6_slowtimo(void); From owner-svn-src-all@freebsd.org Tue Aug 14 18:11: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 8524610805EC; Tue, 14 Aug 2018 18:11:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ABE87FD98; Tue, 14 Aug 2018 18:11:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CA7A1F0AD; Tue, 14 Aug 2018 18:11:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EIB6xE039098; Tue, 14 Aug 2018 18:11:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIB67Y039096; Tue, 14 Aug 2018 18:11:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808141811.w7EIB67Y039096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 14 Aug 2018 18:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337800 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 337800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:11:07 -0000 Author: kevans Date: Tue Aug 14 18:11:06 2018 New Revision: 337800 URL: https://svnweb.freebsd.org/changeset/base/337800 Log: libbe(3): Fix leaky faucets Amongst them: - Resource leaks - Logically dead code - Unused values - Null termination issues Reported by: asomers (pointer to Coverity), Coverity CID: 1394777, 1394791, 1394830, 1394844, 1394872, 1394894, CID: 1394900, 1394907, 1394950, 1394965 Modified: head/lib/libbe/be.c head/lib/libbe/be_access.c head/lib/libbe/be_impl.h Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Tue Aug 14 18:10:25 2018 (r337799) +++ head/lib/libbe/be.c Tue Aug 14 18:11:06 2018 (r337800) @@ -64,10 +64,13 @@ be_locate_rootfs(zfs_handle_t *chkds, void *data) if (lbh == NULL) return (1); + mntpoint = NULL; if (zfs_is_mounted(chkds, &mntpoint) && strcmp(mntpoint, "/") == 0) { - strncpy(lbh->rootfs, zfs_get_name(chkds), BE_MAXPATHLEN); + strlcpy(lbh->rootfs, zfs_get_name(chkds), BE_MAXPATHLEN + 1); + free(mntpoint); return (1); - } + } else if(mntpoint != NULL) + free(mntpoint); return (0); } @@ -120,8 +123,8 @@ libbe_init(void) /* Remove leading 'zfs:' if present, otherwise use value as-is */ if (strcmp(lbh->root, "zfs:") == 0) - strncpy(lbh->root, strchr(lbh->root, ':') + sizeof(char), - BE_MAXPATHLEN); + strlcpy(lbh->root, strchr(lbh->root, ':') + sizeof(char), + BE_MAXPATHLEN + 1); if ((pos = strchr(lbh->root, '/')) == NULL) goto err; @@ -160,8 +163,6 @@ err: libzfs_fini(lbh->lzh); free(lbh); } - if (rootds != NULL) - zfs_close(rootds); free(poolname); return (NULL); } @@ -397,20 +398,16 @@ be_deep_clone(zfs_handle_t *ds, void *data) ZFS_TYPE_FILESYSTEM) == ZPROP_INVAL) return (-1); - if ((err = zfs_clone(snap_hdl, be_path, props)) != 0) { - switch (err) { - case EZFS_SUCCESS: - err = BE_ERR_SUCCESS; - break; - default: - err = BE_ERR_ZFSCLONE; - break; - } - } + if ((err = zfs_clone(snap_hdl, be_path, props)) != 0) + err = BE_ERR_ZFSCLONE; nvlist_free(props); zfs_close(snap_hdl); + /* Failed to clone */ + if (err != BE_ERR_SUCCESS) + return (set_error(isdc->lbh, err)); + sdc.lbh = isdc->lbh; sdc.bename = NULL; sdc.snapname = isdc->snapname; @@ -451,14 +448,13 @@ be_create_from_existing_snap(libbe_handle_t *lbh, cons else bename++; - if ((parentname = strdup(snap_path)) == NULL) { - err = BE_ERR_UNKNOWN; - return (set_error(lbh, err)); - } + if ((parentname = strdup(snap_path)) == NULL) + return (set_error(lbh, BE_ERR_UNKNOWN)); + snapname = strchr(parentname, '@'); if (snapname == NULL) { - err = BE_ERR_UNKNOWN; - return (set_error(lbh, err)); + free(parentname); + return (set_error(lbh, BE_ERR_UNKNOWN)); } *snapname = '\0'; snapname++; @@ -471,6 +467,7 @@ be_create_from_existing_snap(libbe_handle_t *lbh, cons parent_hdl = zfs_open(lbh->lzh, parentname, ZFS_TYPE_DATASET); err = be_deep_clone(parent_hdl, &sdc); + free(parentname); return (set_error(lbh, err)); } @@ -502,7 +499,7 @@ int be_validate_snap(libbe_handle_t *lbh, const char *snap_name) { zfs_handle_t *zfs_hdl; - char buf[BE_MAXPATHLEN]; + char buf[BE_MAXPATHLEN + 1]; char *delim_pos; int err = BE_ERR_SUCCESS; @@ -513,7 +510,7 @@ be_validate_snap(libbe_handle_t *lbh, const char *snap ZFS_TYPE_SNAPSHOT)) return (BE_ERR_NOENT); - strncpy(buf, snap_name, BE_MAXPATHLEN); + strlcpy(buf, snap_name, BE_MAXPATHLEN + 1); /* Find the base filesystem of the snapshot */ if ((delim_pos = strchr(buf, '@')) == NULL) Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Tue Aug 14 18:10:25 2018 (r337799) +++ head/lib/libbe/be_access.c Tue Aug 14 18:11:06 2018 (r337800) @@ -51,8 +51,10 @@ be_mountcheck_cb(zfs_handle_t *zfs_hdl, void *data) return (0); if (strcmp(mountpoint, info->path) == 0) { info->name = strdup(zfs_get_name(zfs_hdl)); + free(mountpoint); return (1); } + free(mountpoint); return (0); } @@ -106,7 +108,6 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou { char be[BE_MAXPATHLEN]; char mnt_temp[BE_MAXPATHLEN]; - char *path; int mntflags; int err; @@ -116,7 +117,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou if (!be_exists(lbh, bootenv)) return (set_error(lbh, BE_ERR_NOENT)); - if (is_mounted(lbh->lzh, be, &path)) + if (is_mounted(lbh->lzh, be, NULL)) return (set_error(lbh, BE_ERR_MOUNTED)); mntflags = (flags & BE_MNT_FORCE) ? MNT_FORCE : 0; Modified: head/lib/libbe/be_impl.h ============================================================================== --- head/lib/libbe/be_impl.h Tue Aug 14 18:10:25 2018 (r337799) +++ head/lib/libbe/be_impl.h Tue Aug 14 18:11:06 2018 (r337800) @@ -38,9 +38,9 @@ struct libbe_handle { libzfs_handle_t *lzh; zpool_handle_t *active_phandle; - char root[BE_MAXPATHLEN]; - char rootfs[BE_MAXPATHLEN]; - char bootfs[BE_MAXPATHLEN]; + char root[BE_MAXPATHLEN + 1]; + char rootfs[BE_MAXPATHLEN + 1]; + char bootfs[BE_MAXPATHLEN + 1]; be_error_t error; bool print_on_err; }; From owner-svn-src-all@freebsd.org Tue Aug 14 18:12: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 F3955108077F; Tue, 14 Aug 2018 18:12:02 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A92BF800B3; Tue, 14 Aug 2018 18:12:02 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A6071F0FE; Tue, 14 Aug 2018 18:12:02 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EIC2MC042900; Tue, 14 Aug 2018 18:12:02 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIC2i1042899; Tue, 14 Aug 2018 18:12:02 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141812.w7EIC2i1042899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 18:12: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: r337801 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 337801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:12:03 -0000 Author: jtl Date: Tue Aug 14 18:12:02 2018 New Revision: 337801 URL: https://svnweb.freebsd.org/changeset/base/337801 Log: MFC r337784: Drop 0-byte IPv6 fragments. Currently, we process IPv6 fragments with 0 bytes of payload, add them to the reassembly queue, and do not recognize them as duplicating or overlapping with adjacent 0-byte fragments. An attacker can exploit this to create long fragment queues. There is no legitimate reason for a fragment with no payload. However, because IPv6 packets with an empty payload are acceptable, allow an "atomic" fragment with no payload. Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet6/frag6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Tue Aug 14 18:11:06 2018 (r337800) +++ stable/11/sys/netinet6/frag6.c Tue Aug 14 18:12:02 2018 (r337801) @@ -269,6 +269,16 @@ frag6_input(struct mbuf **mp, int *offp, int proto) return (ip6f->ip6f_nxt); } + /* Get fragment length and discard 0-byte fragments. */ + frgpartlen = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) - offset; + if (frgpartlen == 0) { + icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, + offsetof(struct ip6_hdr, ip6_plen)); + in6_ifstat_inc(dstifp, ifs6_reass_fail); + IP6STAT_INC(ip6s_fragdropped); + return IPPROTO_DONE; + } + hashkeyp = hashkey; memcpy(hashkeyp, &ip6->ip6_src, sizeof(struct in6_addr)); hashkeyp += sizeof(struct in6_addr) / sizeof(*hashkeyp); @@ -365,7 +375,6 @@ frag6_input(struct mbuf **mp, int *offp, int proto) * in size. * If it would exceed, discard the fragment and return an ICMP error. */ - frgpartlen = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) - offset; if (q6->ip6q_unfrglen >= 0) { /* The 1st fragment has already arrived. */ if (q6->ip6q_unfrglen + fragoff + frgpartlen > IPV6_MAXPACKET) { From owner-svn-src-all@freebsd.org Tue Aug 14 18:13: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 E9915108083B; Tue, 14 Aug 2018 18:13:37 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E21F80274; Tue, 14 Aug 2018 18:13:37 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 513A71F22C; Tue, 14 Aug 2018 18:13:37 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EIDbKv043017; Tue, 14 Aug 2018 18:13:37 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIDbDL043016; Tue, 14 Aug 2018 18:13:37 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141813.w7EIDbDL043016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 18:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337802 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 337802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:13:38 -0000 Author: jtl Date: Tue Aug 14 18:13:36 2018 New Revision: 337802 URL: https://svnweb.freebsd.org/changeset/base/337802 Log: MFC r337786: Lower the default limits on the IPv4 reassembly queue. In particular, try to ensure that no bucket will have a reassembly queue larger than approximately 100 items. This limits the cost to find the correct reassembly queue when processing an incoming fragment. Due to the low limits on each bucket's length, increase the size of the hash table from 64 to 1024. Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet/ip_reass.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_reass.c ============================================================================== --- stable/11/sys/netinet/ip_reass.c Tue Aug 14 18:12:02 2018 (r337801) +++ stable/11/sys/netinet/ip_reass.c Tue Aug 14 18:13:36 2018 (r337802) @@ -64,7 +64,7 @@ SYSCTL_DECL(_net_inet_ip); /* * Reassembly headers are stored in hash buckets. */ -#define IPREASS_NHASH_LOG2 6 +#define IPREASS_NHASH_LOG2 10 #define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2) #define IPREASS_HMASK (IPREASS_NHASH - 1) @@ -116,6 +116,22 @@ ipq_drop(struct ipqbucket *bucket, struct ipq *fp) ipq_free(bucket, fp); } +/* + * By default, limit the number of IP fragments across all reassembly + * queues to 1/32 of the total number of mbuf clusters. + * + * Limit the total number of reassembly queues per VNET to the + * IP fragment limit, but ensure the limit will not allow any bucket + * to grow above 100 items. (The bucket limit is + * IP_MAXFRAGPACKETS / (IPREASS_NHASH / 2), so the 50 is the correct + * multiplier to reach a 100-item limit.) + * The 100-item limit was chosen as brief testing seems to show that + * this produces "reasonable" performance on some subset of systems + * under DoS attack. + */ +#define IP_MAXFRAGS (nmbclusters / 32) +#define IP_MAXFRAGPACKETS (imin(IP_MAXFRAGS, IPREASS_NHASH * 50)) + static int maxfrags; static volatile u_int nfrags; SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfrags, CTLFLAG_RW, @@ -513,12 +529,12 @@ ipreass_init(void) V_maxfragsperpacket = 16; V_ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - max = nmbclusters / 32; + max = IP_MAXFRAGPACKETS; max = uma_zone_set_max(V_ipq_zone, max); V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); if (IS_DEFAULT_VNET(curvnet)) { - maxfrags = nmbclusters / 32; + maxfrags = IP_MAXFRAGS; EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -622,8 +638,8 @@ ipreass_zone_change(void *tag) VNET_ITERATOR_DECL(vnet_iter); int max; - maxfrags = nmbclusters / 32; - max = nmbclusters / 32; + maxfrags = IP_MAXFRAGS; + max = IP_MAXFRAGPACKETS; VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); From owner-svn-src-all@freebsd.org Tue Aug 14 18:15: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 3D92610808D2; Tue, 14 Aug 2018 18:15:11 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5716803EC; Tue, 14 Aug 2018 18:15:10 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C68FF1F22D; Tue, 14 Aug 2018 18:15:10 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EIFAYd043146; Tue, 14 Aug 2018 18:15:10 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIFAeF043145; Tue, 14 Aug 2018 18:15:10 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141815.w7EIFAeF043145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 18:15: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: r337803 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 337803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:15:11 -0000 Author: jtl Date: Tue Aug 14 18:15:10 2018 New Revision: 337803 URL: https://svnweb.freebsd.org/changeset/base/337803 Log: MFC r337787: Lower the default limits on the IPv6 reassembly queue. Currently, the limits are quite high. On machines with millions of mbuf clusters, the reassembly queue limits can also run into the millions. Lower these values. Also, try to ensure that no bucket will have a reassembly queue larger than approximately 100 items. This limits the cost to find the correct reassembly queue when processing an incoming fragment. Due to the low limits on each bucket's length, increase the size of the hash table from 64 to 1024. Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/sys/netinet6/frag6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Tue Aug 14 18:13:36 2018 (r337802) +++ stable/11/sys/netinet6/frag6.c Tue Aug 14 18:15:10 2018 (r337803) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); /* * Reassembly headers are stored in hash buckets. */ -#define IP6REASS_NHASH_LOG2 6 +#define IP6REASS_NHASH_LOG2 10 #define IP6REASS_NHASH (1 << IP6REASS_NHASH_LOG2) #define IP6REASS_HMASK (IP6REASS_NHASH - 1) @@ -105,6 +105,22 @@ static VNET_DEFINE(uint32_t, ip6q_hashseed); static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment reassembly header"); /* + * By default, limit the number of IP6 fragments across all reassembly + * queues to 1/32 of the total number of mbuf clusters. + * + * Limit the total number of reassembly queues per VNET to the + * IP6 fragment limit, but ensure the limit will not allow any bucket + * to grow above 100 items. (The bucket limit is + * IP_MAXFRAGPACKETS / (IPREASS_NHASH / 2), so the 50 is the correct + * multiplier to reach a 100-item limit.) + * The 100-item limit was chosen as brief testing seems to show that + * this produces "reasonable" performance on some subset of systems + * under DoS attack. + */ +#define IP6_MAXFRAGS (nmbclusters / 32) +#define IP6_MAXFRAGPACKETS (imin(IP6_MAXFRAGS, IP6REASS_NHASH * 50)) + +/* * Initialise reassembly queue and fragment identifier. */ void @@ -121,11 +137,11 @@ frag6_change(void *tag) { VNET_ITERATOR_DECL(vnet_iter); - ip6_maxfrags = nmbclusters / 4; + ip6_maxfrags = IP6_MAXFRAGS; VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - V_ip6_maxfragpackets = nmbclusters / 4; + V_ip6_maxfragpackets = IP6_MAXFRAGPACKETS; frag6_set_bucketsize(); CURVNET_RESTORE(); } @@ -138,7 +154,7 @@ frag6_init(void) struct ip6q *q6; int i; - V_ip6_maxfragpackets = nmbclusters / 4; + V_ip6_maxfragpackets = IP6_MAXFRAGPACKETS; frag6_set_bucketsize(); for (i = 0; i < IP6REASS_NHASH; i++) { q6 = IP6Q_HEAD(i); @@ -151,7 +167,7 @@ frag6_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; - ip6_maxfrags = nmbclusters / 4; + ip6_maxfrags = IP6_MAXFRAGS; EVENTHANDLER_REGISTER(nmbclusters_change, frag6_change, NULL, EVENTHANDLER_PRI_ANY); } From owner-svn-src-all@freebsd.org Tue Aug 14 18:17: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 6FF5F10809B2; Tue, 14 Aug 2018 18:17:06 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23C95806E9; Tue, 14 Aug 2018 18:17:06 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00C081F22F; Tue, 14 Aug 2018 18:17:05 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EIH5o7043400; Tue, 14 Aug 2018 18:17:05 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIH5de043398; Tue, 14 Aug 2018 18:17:05 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808141817.w7EIH5de043398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 14 Aug 2018 18:17:05 +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: r337804 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 337804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:17:06 -0000 Author: jtl Date: Tue Aug 14 18:17:05 2018 New Revision: 337804 URL: https://svnweb.freebsd.org/changeset/base/337804 Log: MFC r337788: Update the inet(4) and inet6(4) man pages to reflect the changes made to the reassembly code in r337778, r337780, r337781, r337782, and r337783. Approved by: so Security: FreeBSD-SA-18:10.ip Security: CVE-2018-6923 Modified: stable/11/share/man/man4/inet.4 stable/11/share/man/man4/inet6.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/inet.4 ============================================================================== --- stable/11/share/man/man4/inet.4 Tue Aug 14 18:15:10 2018 (r337803) +++ stable/11/share/man/man4/inet.4 Tue Aug 14 18:17:05 2018 (r337804) @@ -28,7 +28,7 @@ .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd Feb 4, 2016 +.Dd August 14, 2018 .Dt INET 4 .Os .Sh NAME @@ -229,15 +229,38 @@ At the same time, on high-speed links, it can decrease cycle greatly. Default is 0 (sequential IP IDs). IPv6 flow IDs and fragment IDs are always random. +.It Va ip.maxfrags +Integer: maximum number of fragments the host will accept and simultaneously +hold across all reassembly queues in all VNETs. +If set to 0, reassembly is disabled. +If set to -1, this limit is not applied. +This limit is recalculated when the number of mbuf clusters is changed. +This is a global limit. .It Va ip.maxfragpackets -Integer: maximum number of fragmented packets the host will accept and hold -in the reassembling queue simultaneously. -0 means that the host will not accept any fragmented packets. -\-1 means that the host will accept as many fragmented packets as it receives. +Integer: maximum number of fragmented packets the host will accept and +simultaneously hold in the reassembly queue for a particular VNET. +0 means that the host will not accept any fragmented packets for that VNET. +\-1 means that the host will not apply this limit for that VNET. +This limit is recalculated when the number of mbuf clusters is changed. +This is a per-VNET limit. +.It Va ip.maxfragbucketsize +Integer: maximum number of reassembly queues per bucket. +Fragmented packets are hashed to buckets. +Each bucket has a list of reassembly queues. +The system must compare the incoming packets to the existing reassembly queues +in the bucket to find a matching reassembly queue. +To preserve system resources, the system limits the number of reassembly +queues allowed in each bucket. +This limit is recalculated when the number of mbuf clusters is changed or +when the value of +.Va ip.maxfragpackets +changes. +This is a per-VNET limit. .It Va ip.maxfragsperpacket Integer: maximum number of fragments the host will accept and hold -in the reassembling queue for a packet. -0 means that the host will not accept any fragmented packets. +in the reassembly queue for a packet. +0 means that the host will not accept any fragmented packets for the VNET. +This is a per-VNET limit. .El .Sh SEE ALSO .Xr ioctl 2 , Modified: stable/11/share/man/man4/inet6.4 ============================================================================== --- stable/11/share/man/man4/inet6.4 Tue Aug 14 18:15:10 2018 (r337803) +++ stable/11/share/man/man4/inet6.4 Tue Aug 14 18:17:05 2018 (r337804) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2009 +.Dd August 14, 2018 .Dt INET6 4 .Os .Sh NAME @@ -219,12 +219,41 @@ packets. This value applies to all the transport protocols on top of .Tn IPv6 . There are APIs to override the value. +.It Dv IPV6CTL_MAXFRAGS +.Pq ip6.maxfrags +Integer: maximum number of fragments the host will accept and simultaneously +hold across all reassembly queues in all VNETs. +If set to 0, fragment reassembly is disabled. +If set to -1, this limit is not applied. +This limit is recalculated when the number of mbuf clusters is changed. +This is a global limit. .It Dv IPV6CTL_MAXFRAGPACKETS .Pq ip6.maxfragpackets -Integer: default maximum number of fragmented packets the node will accept. -0 means that the node will not accept any fragmented packets. --1 means that the node will accept as many fragmented packets as it receives. -The flag is provided basically for avoiding possible DoS attacks. +Integer: maximum number of fragmented packets the node will accept and +simultaneously hold in the reassembly queue for a particular VNET. +0 means that the node will not accept any fragmented packets for that VNET. +-1 means that the node will not apply this limit for that VNET. +This limit is recalculated when the number of mbuf clusters is changed. +This is a per-VNET limit. +.It Dv IPV6CTL_MAXFRAGBUCKETSIZE +.Pq ip6.maxfragbucketsize +Integer: maximum number of reassembly queues per bucket. +Fragmented packets are hashed to buckets. +Each bucket has a list of reassembly queues. +The system must compare the incoming packets to the existing reassembly queues +in the bucket to find a matching reassembly queue. +To preserve system resources, the system limits the number of reassembly +queues allowed in each bucket. +This limit is recalculated when the number of mbuf clusters is changed or +when the value of +.Va ip6.maxfragpackets +changes. +This is a per-VNET limit. +.It Dv IPV6CTL_MAXFRAGSPERPACKET +.Pq ip6.maxfragsperpacket +Integer: maximum number of fragments the host will accept and hold in the +ressembly queue for a packet. +This is a per-VNET limit. .It Dv IPV6CTL_ACCEPT_RTADV .Pq ip6.accept_rtadv Boolean: the default value of a per-interface flag to From owner-svn-src-all@freebsd.org Tue Aug 14 18:35: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 0BDEF1080F11; Tue, 14 Aug 2018 18:35:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B368781037; Tue, 14 Aug 2018 18:35:33 +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 949411F54E; Tue, 14 Aug 2018 18:35:33 +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 w7EIZXoo053465; Tue, 14 Aug 2018 18:35:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIZX68053464; Tue, 14 Aug 2018 18:35:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808141835.w7EIZX68053464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 14 Aug 2018 18:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337805 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 337805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:35:34 -0000 Author: kevans Date: Tue Aug 14 18:35:33 2018 New Revision: 337805 URL: https://svnweb.freebsd.org/changeset/base/337805 Log: bectl(8): Check jailparam_* return values Previous iteration of this assumed that these won't fail because we've already setup the jail param to this point, but the allocations could still fail in pretty bad conditions. Admit that it's possible and return (ENOENT, EINVAL, ENOMEM, or 0) when deleting arguments. EINVAL shouldn't happen since we're passing optarg; which may satisfy *optarg == '\0' but never optarg == NULL. CID: 1394885, 1394901 Modified: head/sbin/bectl/bectl_jail.c Modified: head/sbin/bectl/bectl_jail.c ============================================================================== --- head/sbin/bectl/bectl_jail.c Tue Aug 14 18:17:05 2018 (r337804) +++ head/sbin/bectl/bectl_jail.c Tue Aug 14 18:35:33 2018 (r337805) @@ -44,9 +44,9 @@ __FBSDID("$FreeBSD$"); static void jailparam_grow(void); static void jailparam_add(const char *name, const char *val); -static void jailparam_del(const char *name); +static int jailparam_del(const char *name); static bool jailparam_addarg(char *arg); -static bool jailparam_delarg(char *arg); +static int jailparam_delarg(char *arg); static int bectl_search_jail_paths(const char *mnt); static int bectl_locate_jail(const char *ident); @@ -92,7 +92,7 @@ jailparam_add(const char *name, const char *val) ++jpused; } -static void +static int jailparam_del(const char *name) { int i; @@ -103,21 +103,32 @@ jailparam_del(const char *name) break; } - /* Not found... technically successful */ if (i == jpused) - return; + return (ENOENT); for (; i < jpused - 1; ++i) { val = jailparam_export(&jp[i + 1]); jailparam_free(&jp[i], 1); - jailparam_init(&jp[i], jp[i + 1].jp_name); - jailparam_import(&jp[i], val); + /* + * Given the context, the following will really only fail if + * they can't allocate the copy of the name or value. + */ + if (jailparam_init(&jp[i], jp[i + 1].jp_name) != 0) { + free(val); + return (ENOMEM); + } + if (jailparam_import(&jp[i], val) != 0) { + jailparam_free(&jp[i], 1); + free(val); + return (ENOMEM); + } free(val); } jailparam_free(&jp[i], 1); --jpused; + return (0); } static bool @@ -148,28 +159,27 @@ jailparam_addarg(char *arg) return (true); } -static bool +static int jailparam_delarg(char *arg) { char *name, *val; if (arg == NULL) - return (false); + return (EINVAL); name = arg; if ((val = strchr(name, '=')) != NULL) *val++ = '\0'; if (strcmp(name, "path") == 0) *mnt_loc = '\0'; - jailparam_del(name); - return (true); + return (jailparam_del(name)); } int bectl_cmd_jail(int argc, char *argv[]) { char *bootenv, *mountpoint; - int jid, opt; + int jid, opt, ret; bool default_hostname, default_name; default_hostname = default_name = true; @@ -198,11 +208,16 @@ bectl_cmd_jail(int argc, char *argv[]) } break; case 'u': - if (jailparam_delarg(optarg)) { + 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) { + fprintf(stderr, + "bectl jail: error unsetting \"%s\"\n", + optarg); + return (ret); } break; default: From owner-svn-src-all@freebsd.org Tue Aug 14 18:44:45 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 236C510814FD; Tue, 14 Aug 2018 18:44:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7FF58179A; Tue, 14 Aug 2018 18:44:44 +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 A6C7C1F6E1; Tue, 14 Aug 2018 18:44:44 +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 w7EIiiZe058771; Tue, 14 Aug 2018 18:44:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIigHv058758; Tue, 14 Aug 2018 18:44:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808141844.w7EIigHv058758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 14 Aug 2018 18:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337806 - in head: share/mk stand stand/efi stand/efi/loader stand/efi/loader_4th stand/efi/loader_lua stand/efi/loader_simp stand/i386 stand/i386/loader stand/i386/loader_4th stand/i38... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/mk stand stand/efi stand/efi/loader stand/efi/loader_4th stand/efi/loader_lua stand/efi/loader_simp stand/i386 stand/i386/loader stand/i386/loader_4th stand/i386/loader_lua stand/i386/l... X-SVN-Commit-Revision: 337806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:44:45 -0000 Author: imp Date: Tue Aug 14 18:44:41 2018 New Revision: 337806 URL: https://svnweb.freebsd.org/changeset/base/337806 Log: Create a loader for each interpreter for x86 BIOS and all EFI Create loader_{4th,lua,simp}{,.efi}. All of these are installed by default. Create LOADER_DEFAULT_INTERP to specify the default interpreter when no other is specified. LOADER_INTERP is the current interpreter language building. Turn building of lua on by default to match 4th. simploader is a simplified loader build w/o any interpreter language (but with a simple loader). This is the historic behavir you got with WITHOUT_FORTH. Make a hard link to the default loader. This has to be a hard link rather than the more desirable soft link because older zfsboot blocks don't support symlinks. RelNotes: Yes Differential Revision: https://reviews.freebsd.org/D16705 Added: head/stand/efi/loader_4th/ head/stand/efi/loader_4th/Makefile (contents, props changed) head/stand/efi/loader_lua/ head/stand/efi/loader_lua/Makefile (contents, props changed) head/stand/efi/loader_simp/ head/stand/efi/loader_simp/Makefile (contents, props changed) head/stand/i386/loader_4th/ head/stand/i386/loader_4th/Makefile (contents, props changed) head/stand/i386/loader_lua/ head/stand/i386/loader_lua/Makefile (contents, props changed) head/stand/i386/loader_simp/ head/stand/i386/loader_simp/Makefile (contents, props changed) Modified: head/share/mk/src.opts.mk head/stand/defs.mk head/stand/efi/Makefile head/stand/efi/loader/Makefile head/stand/i386/Makefile head/stand/i386/loader/Makefile head/stand/i386/pxeldr/Makefile head/stand/loader.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Aug 14 18:35:33 2018 (r337805) +++ head/share/mk/src.opts.mk Tue Aug 14 18:44:41 2018 (r337806) @@ -130,6 +130,7 @@ __DEFAULT_YES_OPTIONS = \ LIBTHR \ LLVM_COV \ LOADER_GELI \ + LOADER_LUA \ LOADER_OFW \ LOADER_UBOOT \ LOCALES \ @@ -197,7 +198,6 @@ __DEFAULT_NO_OPTIONS = \ LIBSOFT \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ - LOADER_LUA \ NAND \ OFED_EXTRA \ OPENLDAP \ Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Tue Aug 14 18:35:33 2018 (r337805) +++ head/stand/defs.mk Tue Aug 14 18:44:41 2018 (r337806) @@ -146,6 +146,18 @@ CFLAGS+= -mlittle-endian .endif .endif +# +# Have a sensible default +# +.if ${MK_FORTH} == "yes" +LOADER_DEFAULT_INTERP?=4th +.elif ${MK_LOADER_LUA} == "yes" +LOADER_DEFAULT_INTERP?=lua +.else +LOADER_DEFAULT_INTERP?=simp +.endif +LOADER_INTERP?=${LOADER_DEFAULT_INTERP} + # Make sure we use the machine link we're about to create CFLAGS+=-I. Modified: head/stand/efi/Makefile ============================================================================== --- head/stand/efi/Makefile Tue Aug 14 18:35:33 2018 (r337805) +++ head/stand/efi/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -9,7 +9,10 @@ NO_OBJ=t .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 SUBDIR.${MK_FDT}+= fdt -SUBDIR.yes+= libefi loader boot1 +SUBDIR.yes+= libefi boot1 +SUBDIR.${MK_FORTH}+= loader_4th +SUBDIR.${MK_LOADER_LUA}+= loader_lua +SUBDIR.yes+= loader_simp .endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Tue Aug 14 18:35:33 2018 (r337805) +++ head/stand/efi/loader/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -8,7 +8,8 @@ LOADER_EXT2FS_SUPPORT?= no .include -PROG= loader.sym +LOADER?= loader_${LOADER_INTERP} +PROG= ${LOADER}.sym INTERNALPROG= WARNS?= 3 @@ -24,6 +25,7 @@ SRCS= autoload.c \ smbios.c \ vers.c +CFLAGS+= -I${.CURDIR}/../loader .if ${MK_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT @@ -41,10 +43,11 @@ CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitializ # warnings for now. CWARNFLAGS.main.c+= -Wno-format -.PATH: ${.CURDIR}/arch/${MACHINE} -# For smbios.c +.PATH: ${.CURDIR}/../loader +.PATH: ${.CURDIR}/../loader/arch/${MACHINE} +# For smbios.c XXX need to abstract properly .PATH: ${BOOTSRC}/i386/libi386 -.include "${.CURDIR}/arch/${MACHINE}/Makefile.inc" +.include "${.CURDIR}/../loader/arch/${MACHINE}/Makefile.inc" CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/arch/${MACHINE} @@ -78,20 +81,21 @@ HAVE_BCACHE= yes CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif +NEWVERSWHAT= "EFI loader" ${MACHINE} +VERSION_FILE= ${.CURDIR}/../loader/version + # Always add MI sources .include "${BOOTSRC}/loader.mk" -FILES+= loader.efi -FILESMODE_loader.efi= ${BINMODE} +FILES+= ${LOADER}.efi +FILESMODE_${LOADER}.efi= ${BINMODE} -LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE} +LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared CLEANFILES+= loader.efi -NEWVERSWHAT= "EFI loader" ${MACHINE} - -loader.efi: ${PROG} +${LOADER}.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ Added: head/stand/efi/loader_4th/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/loader_4th/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +LOADER_INTERP=4th + +.include "../loader/Makefile" + Added: head/stand/efi/loader_lua/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/loader_lua/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +LOADER_INTERP=lua + +.include "../loader/Makefile" + Added: head/stand/efi/loader_simp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/loader_simp/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +LOADER_INTERP=simp + +.include "../loader/Makefile" + Modified: head/stand/i386/Makefile ============================================================================== --- head/stand/i386/Makefile Tue Aug 14 18:35:33 2018 (r337805) +++ head/stand/i386/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -9,7 +9,9 @@ SUBDIR.yes= mbr pmbr boot0 boot0sio btx boot2 cdboot g SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire -SUBDIR.yes+= loader +SUBDIR.${MK_FORTH}+= loader_4th +SUBDIR.${MK_LOADER_LUA}+= loader_lua +SUBDIR.yes+= loader_simp # special boot programs, 'self-extracting boot2+loader' SUBDIR.yes+= pxeldr Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Tue Aug 14 18:35:33 2018 (r337805) +++ head/stand/i386/loader/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -14,7 +14,7 @@ LOADER_BZIP2_SUPPORT?= yes .include -LOADER?= loader +LOADER?= loader_${LOADER_INTERP} PROG= ${LOADER}.sym INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 @@ -64,11 +64,13 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} -.if ${MK_ZFS} == "yes" -LINKS= ${BINDIR}/${LOADER} ${BINDIR}/zfs${LOADER} +.if ${MK_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/zfsloader .endif +.if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/loader +.endif FILES+= ${LOADER} -# XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b # XXX crt0.o needs to be first for pxeboot(8) to work Added: head/stand/i386/loader_4th/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/loader_4th/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +LOADER_INTERP=4th + +.include "../loader/Makefile" + Added: head/stand/i386/loader_lua/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/loader_lua/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +LOADER_INTERP=lua + +.include "../loader/Makefile" + Added: head/stand/i386/loader_simp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/loader_simp/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +LOADER_INTERP=simp + +.include "../loader/Makefile" + Modified: head/stand/i386/pxeldr/Makefile ============================================================================== --- head/stand/i386/pxeldr/Makefile Tue Aug 14 18:35:33 2018 (r337805) +++ head/stand/i386/pxeldr/Makefile Tue Aug 14 18:44:41 2018 (r337806) @@ -24,7 +24,8 @@ CFLAGS+=-DALWAYS_SERIAL CFLAGS+=-I${BOOTSRC}/i386/common -LOADERBIN= ${BOOTOBJ}/i386/loader/loader.bin +L=${LOADER_DEFAULT_INTERP} +LOADERBIN= ${BOOTOBJ}/i386/loader_${L}/loader_${L}.bin CLEANFILES+= ${BOOT}.tmp Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Tue Aug 14 18:35:33 2018 (r337805) +++ head/stand/loader.mk Tue Aug 14 18:44:41 2018 (r337806) @@ -57,19 +57,20 @@ SRCS+= isapnp.c SRCS+= pnp.c .endif -# Forth interpreter -.if ${MK_LOADER_LUA} != "no" +.if ${LOADER_INTERP} == "lua" SRCS+= interp_lua.c .include "${BOOTSRC}/lua.mk" LDR_INTERP= ${LIBLUA} LDR_INTERP32= ${LIBLUA32} -.elif ${MK_FORTH} != "no" +.elif ${LOADER_INTERP} == "4th" SRCS+= interp_forth.c .include "${BOOTSRC}/ficl.mk" LDR_INTERP= ${LIBFICL} LDR_INTERP32= ${LIBFICL32} -.else +.elif ${LOADER_INTERP} == "simp" SRCS+= interp_simple.c +.else +.error Unknown interpreter ${LOADER_INTERP} .endif .if defined(BOOT_PROMPT_123) From owner-svn-src-all@freebsd.org Tue Aug 14 18:45:17 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 1DBC1108154D; Tue, 14 Aug 2018 18:45:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C733D818F2; Tue, 14 Aug 2018 18:45:16 +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 A848B1F6E8; Tue, 14 Aug 2018 18:45:16 +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 w7EIjGbC058852; Tue, 14 Aug 2018 18:45:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIjGpM058851; Tue, 14 Aug 2018 18:45:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808141845.w7EIjGpM058851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 14 Aug 2018 18:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337807 - head/contrib/lua/src X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/lua/src X-SVN-Commit-Revision: 337807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:45:17 -0000 Author: imp Date: Tue Aug 14 18:45:16 2018 New Revision: 337807 URL: https://svnweb.freebsd.org/changeset/base/337807 Log: Prevent a wanring about checkdp being unused. It's not needed when we have INT64 floats and somehow snuck through unused until now. Reviewed by: kevans@ Modified: head/contrib/lua/src/lstrlib.c Modified: head/contrib/lua/src/lstrlib.c ============================================================================== --- head/contrib/lua/src/lstrlib.c Tue Aug 14 18:44:41 2018 (r337806) +++ head/contrib/lua/src/lstrlib.c Tue Aug 14 18:45:16 2018 (r337807) @@ -928,6 +928,7 @@ static void addquoted (luaL_Buffer *b, const char *s, } +#if LUA_FLOAT_TYPE != LUA_FLOAT_INT64 /* ** Ensures the 'buff' string uses a dot as the radix character. */ @@ -938,7 +939,7 @@ static void checkdp (char *buff, int nb) { if (ppoint) *ppoint = '.'; /* change it to a dot */ } } - +#endif static void addliteral (lua_State *L, luaL_Buffer *b, int arg) { switch (lua_type(L, arg)) { From owner-svn-src-all@freebsd.org Tue Aug 14 18:45:26 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 0FE751081596; Tue, 14 Aug 2018 18:45:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB9FE819E6; Tue, 14 Aug 2018 18:45:25 +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 9DC3A1F6EA; Tue, 14 Aug 2018 18:45:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EIjPOY058957; Tue, 14 Aug 2018 18:45:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIjPRt058956; Tue, 14 Aug 2018 18:45:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808141845.w7EIjPRt058956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 14 Aug 2018 18:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337809 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 337809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:45:26 -0000 Author: imp Date: Tue Aug 14 18:45:25 2018 New Revision: 337809 URL: https://svnweb.freebsd.org/changeset/base/337809 Log: For our INT64 implementation, we can compare integers and numbers directly because they are the same thing. Reviewed by: kevans@ Modified: head/stand/liblua/luaconf.h Modified: head/stand/liblua/luaconf.h ============================================================================== --- head/stand/liblua/luaconf.h Tue Aug 14 18:45:20 2018 (r337808) +++ head/stand/liblua/luaconf.h Tue Aug 14 18:45:25 2018 (r337809) @@ -450,9 +450,7 @@ ** and therefore its conversion to float may have an ill-defined value.) */ #define lua_numbertointeger(n,p) \ - ((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \ - (n) < -(LUA_NUMBER)(LUA_MININTEGER) && \ - (*(p) = (LUA_INTEGER)(n), 1)) + (*(p) = (LUA_INTEGER)(n), 1) /* now the variable definitions */ From owner-svn-src-all@freebsd.org Tue Aug 14 18:45: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 0F84B1081583; Tue, 14 Aug 2018 18:45:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0271B8198B; Tue, 14 Aug 2018 18:45:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50B361F6E9; Tue, 14 Aug 2018 18:45:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EIjLk9058906; Tue, 14 Aug 2018 18:45:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIjLRk058905; Tue, 14 Aug 2018 18:45:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808141845.w7EIjLRk058905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 14 Aug 2018 18:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337808 - head/contrib/lua/src X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/lua/src X-SVN-Commit-Revision: 337808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:45:24 -0000 Author: imp Date: Tue Aug 14 18:45:20 2018 New Revision: 337808 URL: https://svnweb.freebsd.org/changeset/base/337808 Log: When the LUA floating point model is INT64, we don't need to do the overflow dance. This avoids compile errors on latter-day gcc compilers as well as simplifies the generated code. Reviewed by: kevans@ Modified: head/contrib/lua/src/lvm.c Modified: head/contrib/lua/src/lvm.c ============================================================================== --- head/contrib/lua/src/lvm.c Tue Aug 14 18:45:16 2018 (r337807) +++ head/contrib/lua/src/lvm.c Tue Aug 14 18:45:20 2018 (r337808) @@ -41,7 +41,7 @@ ** float without rounding. Used in comparisons. Left undefined if ** all integers fit in a float precisely. */ -#if !defined(l_intfitsf) +#if !defined(l_intfitsf) && LUA_FLOAT_TYPE != LUA_FLOAT_INT64 /* number of bits in the mantissa of a float */ #define NBM (l_mathlim(MANT_DIG)) From owner-svn-src-all@freebsd.org Tue Aug 14 18:58: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 1C3AE1081A09; Tue, 14 Aug 2018 18:58:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0CAB82373; Tue, 14 Aug 2018 18:58:13 +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 9CB7F1F894; Tue, 14 Aug 2018 18:58:13 +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 w7EIwDFr064331; Tue, 14 Aug 2018 18:58:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIw2ha064272; Tue, 14 Aug 2018 18:58:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808141858.w7EIw2ha064272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 14 Aug 2018 18:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337810 - in head: contrib/lua contrib/lua/doc contrib/lua/src stand/liblua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: contrib/lua contrib/lua/doc contrib/lua/src stand/liblua X-SVN-Commit-Revision: 337810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:58:14 -0000 Author: kevans Date: Tue Aug 14 18:58:01 2018 New Revision: 337810 URL: https://svnweb.freebsd.org/changeset/base/337810 Log: MFV r337586: lua: Update to 5.3.5 Bugfix release, nothing too major. Tested with: lualoader via userboot, lualoader live Differential Revision: https://reviews.freebsd.org/D16665 Modified: head/contrib/lua/README head/contrib/lua/doc/contents.html head/contrib/lua/doc/lua.css head/contrib/lua/doc/manual.html head/contrib/lua/doc/readme.html head/contrib/lua/src/Makefile head/contrib/lua/src/lapi.c head/contrib/lua/src/lapi.h head/contrib/lua/src/lauxlib.c head/contrib/lua/src/lauxlib.h head/contrib/lua/src/lbaselib.c head/contrib/lua/src/lbitlib.c head/contrib/lua/src/lcode.c head/contrib/lua/src/lcode.h head/contrib/lua/src/lcorolib.c head/contrib/lua/src/lctype.c head/contrib/lua/src/lctype.h head/contrib/lua/src/ldblib.c head/contrib/lua/src/ldebug.c head/contrib/lua/src/ldebug.h head/contrib/lua/src/ldo.c head/contrib/lua/src/ldo.h head/contrib/lua/src/ldump.c head/contrib/lua/src/lfunc.c head/contrib/lua/src/lfunc.h head/contrib/lua/src/lgc.c head/contrib/lua/src/lgc.h head/contrib/lua/src/linit.c head/contrib/lua/src/liolib.c head/contrib/lua/src/llex.c head/contrib/lua/src/llex.h head/contrib/lua/src/llimits.h head/contrib/lua/src/lmathlib.c head/contrib/lua/src/lmem.c head/contrib/lua/src/lmem.h head/contrib/lua/src/loadlib.c head/contrib/lua/src/lobject.c head/contrib/lua/src/lobject.h head/contrib/lua/src/lopcodes.c head/contrib/lua/src/lopcodes.h head/contrib/lua/src/loslib.c head/contrib/lua/src/lparser.c head/contrib/lua/src/lparser.h head/contrib/lua/src/lprefix.h head/contrib/lua/src/lstate.c head/contrib/lua/src/lstate.h head/contrib/lua/src/lstring.c head/contrib/lua/src/lstring.h head/contrib/lua/src/lstrlib.c head/contrib/lua/src/ltable.c head/contrib/lua/src/ltable.h head/contrib/lua/src/ltablib.c head/contrib/lua/src/ltm.c head/contrib/lua/src/ltm.h head/contrib/lua/src/lua.c head/contrib/lua/src/lua.h head/contrib/lua/src/luac.c head/contrib/lua/src/lualib.h head/contrib/lua/src/lundump.c head/contrib/lua/src/lundump.h head/contrib/lua/src/lutf8lib.c head/contrib/lua/src/lvm.c head/contrib/lua/src/lvm.h head/contrib/lua/src/lzio.c head/contrib/lua/src/lzio.h head/stand/liblua/luaconf.h Directory Properties: head/contrib/lua/ (props changed) Modified: head/contrib/lua/README ============================================================================== --- head/contrib/lua/README Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/README Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ -This is Lua 5.3.4, released on 12 Jan 2017. +This is Lua 5.3.5, released on 26 Jun 2018. For installation instructions, license details, and further information about Lua, see doc/readme.html. Modified: head/contrib/lua/doc/contents.html ============================================================================== --- head/contrib/lua/doc/contents.html Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/doc/contents.html Tue Aug 14 18:58:01 2018 (r337810) @@ -32,7 +32,7 @@ For a complete introduction to Lua programming, see th

-Copyright © 2015–2017 Lua.org, PUC-Rio. +Copyright © 2015–2018 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -609,10 +609,10 @@ Freely available under the terms of the

Modified: head/contrib/lua/doc/lua.css ============================================================================== --- head/contrib/lua/doc/lua.css Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/doc/lua.css Tue Aug 14 18:58:01 2018 (r337810) @@ -10,7 +10,7 @@ body { line-height: 1.25 ; margin: 16px auto ; padding: 32px ; - border: solid #a0a0a0 1px ; + border: solid #ccc 1px ; border-radius: 20px ; max-width: 70em ; width: 90% ; @@ -111,36 +111,29 @@ pre.session { border-radius: 8px ; } -td.gutter { - width: 4% ; -} - -table.columns { +table { border: none ; border-spacing: 0 ; border-collapse: collapse ; } +td { + padding: 0 ; + margin: 0 ; +} + +td.gutter { + width: 4% ; +} + table.columns td { vertical-align: top ; - padding: 0 ; padding-bottom: 1em ; text-align: justify ; line-height: 1.25 ; } -p.logos a:link:hover, p.logos a:visited:hover { - background-color: inherit ; -} - -table.book { - border: none ; - border-spacing: 0 ; - border-collapse: collapse ; -} - table.book td { - padding: 0 ; vertical-align: top ; } @@ -157,6 +150,10 @@ table.book span { text-align: left ; display: block ; margin-top: 0.25em ; +} + +p.logos a:link:hover, p.logos a:visited:hover { + background-color: inherit ; } img { Modified: head/contrib/lua/doc/manual.html ============================================================================== --- head/contrib/lua/doc/manual.html Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/doc/manual.html Tue Aug 14 18:58:01 2018 (r337810) @@ -19,7 +19,7 @@ by Roberto Ierusalimschy, Luiz Henrique de Figueiredo,

-Copyright © 2015–2017 Lua.org, PUC-Rio. +Copyright © 2015–2018 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -35,7 +35,7 @@ Freely available under the terms of the

- + @@ -203,8 +203,8 @@ even those that do not support threads natively.

The type table implements associative arrays, -that is, arrays that can be indexed not only with numbers, -but with any Lua value except nil and NaN. +that is, arrays that can have as indices not only numbers, +but any Lua value except nil and NaN. (Not a Number is a special value used to represent undefined or unrepresentable numerical results, such as 0/0.) Tables can be heterogeneous; @@ -400,6 +400,8 @@ with the event name prefixed by two underscores; the corresponding values are called metamethods. In the previous example, the key is "__add" and the metamethod is the function that performs the addition. +Unless stated otherwise, +metamethods should be function values.

@@ -597,7 +599,7 @@ it is also slower than a real __le metame

  • __index: -The indexing access table[key]. +The indexing access operation table[key]. This event happens when table is not a table or when key is not present in table. The metamethod is looked up in table. @@ -1276,13 +1278,8 @@ Square brackets are used to index a table:
     	var ::= prefixexp ‘[’ exp ‘]

    -The meaning of accesses to table fields can be changed via metatables. -An access to an indexed variable t[i] is equivalent to -a call gettable_event(t,i). -(See §2.4 for a complete description of the -gettable_event function. -This function is not defined or callable in Lua. -We use it here only for explanatory purposes.) +The meaning of accesses to table fields can be changed via metatables +(see §2.4).

    @@ -1477,25 +1474,20 @@ cyclically permutes the values of x, -The meaning of assignments to global variables -and table fields can be changed via metatables. -An assignment to an indexed variable t[i] = val is equivalent to -settable_event(t,i,val). -(See §2.4 for a complete description of the -settable_event function. -This function is not defined or callable in Lua. -We use it here only for explanatory purposes.) - - -

    An assignment to a global name x = val is equivalent to the assignment _ENV.x = val (see §2.2). +

    +The meaning of assignments to table fields and +global variables (which are actually table fields, too) +can be changed via metatables (see §2.4). + +

    3.3.4 – Control Structures

    The control structures if, while, and repeat have the usual meaning and @@ -1831,17 +1823,17 @@ Here are some examples: g(f(), x) -- f() is adjusted to 1 result g(x, f()) -- g gets x plus all results from f() a,b,c = f(), x -- f() is adjusted to 1 result (c gets nil) - a,b = ... -- a gets the first vararg parameter, b gets + a,b = ... -- a gets the first vararg argument, b gets -- the second (both a and b can get nil if there - -- is no corresponding vararg parameter) + -- is no corresponding vararg argument) a,b,c = x, f() -- f() is adjusted to 2 results a,b,c = f() -- f() is adjusted to 3 results return f() -- returns all results from f() - return ... -- returns all received vararg parameters + return ... -- returns all received vararg arguments return x,y,f() -- returns x, y, and all results from f() {f()} -- creates a list with all results from f() - {...} -- creates a list with all vararg parameters + {...} -- creates a list with all vararg arguments {f(), nil} -- f() is adjusted to 1 result @@ -2039,9 +2031,12 @@ two objects are considered equal only if they are the Every time you create a new object (a table, userdata, or thread), this new object is different from any previously existing object. -Closures with the same reference are always equal. +A closure is always equal to itself. Closures with any detectable difference (different behavior, different definition) are always different. +Closures created at different times but with no detectable differences +may be classified as equal or not +(depending on internal caching details).

    @@ -2303,7 +2298,7 @@ If the value of prefixexp has type function, then this function is called with the given arguments. Otherwise, the prefixexp "call" metamethod is called, -having as first parameter the value of prefixexp, +having as first argument the value of prefixexp, followed by the original call arguments (see §2.4). @@ -2881,7 +2876,7 @@ it can do whatever it wants on that Lua state, as it should be already protected. However, when C code operates on other Lua states -(e.g., a Lua parameter to the function, +(e.g., a Lua argument to the function, a Lua state stored in the registry, or the result of lua_newthread), it should use them only in API calls that cannot raise errors. @@ -3370,7 +3365,7 @@ it is left unchanged. Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state. -On several platforms, you may not need to call this function, +In several platforms, you may not need to call this function, because all resources are naturally released when the host program ends. On the other hand, long-running programs that create multiple states, such as daemons or web servers, @@ -5584,7 +5579,7 @@ given as argument to a hook (see <

    -To get information about a function you push it onto the stack +To get information about a function, you push it onto the stack and start the what string with the character '>'. (In that case, lua_getinfo pops the function from the top of the stack.) @@ -6462,7 +6457,7 @@ file-related functions in the standard library

    Pushes onto the stack the field e from the metatable -of the object at index obj and returns the type of pushed value. +of the object at index obj and returns the type of the pushed value. If the object does not have a metatable, or if the metatable does not have this field, pushes nothing and returns LUA_TNIL. @@ -6749,7 +6744,7 @@ In words, if the argument arg is nil or a the macro results in the default dflt. Otherwise, it results in the result of calling func with the state L and the argument index arg as -parameters. +arguments. Note that it evaluates the expression dflt only if needed. @@ -8680,7 +8675,7 @@ the lowercase letters plus the '-' charac

    You can put a closing square bracket in a set by positioning it as the first character in the set. -You can put an hyphen in a set +You can put a hyphen in a set by positioning it as the first or the last character in the set. (You can also use an escape for both cases.) @@ -9082,8 +9077,8 @@ Returns the destination table a2.

    -Returns a new table with all parameters stored into keys 1, 2, etc. -and with a field "n" with the total number of parameters. +Returns a new table with all arguments stored into keys 1, 2, etc. +and with a field "n" with the total number of arguments. Note that the resulting table may not be a sequence. @@ -9215,7 +9210,7 @@ Returns the arc sine of x (in radians).

    Returns the arc tangent of y/x (in radians), -but uses the signs of both parameters to find the +but uses the signs of both arguments to find the quadrant of the result. (It also handles correctly the case of x being zero.) @@ -9516,7 +9511,7 @@ all I/O functions return nil on failure (plus an error message as a second result and a system-dependent error code as a third result) and some value different from nil on success. -On non-POSIX systems, +In non-POSIX systems, the computation of the error message and error code in case of errors may be not thread safe, @@ -9553,7 +9548,7 @@ When called with a file name, it opens the named file and sets its handle as the default input file. When called with a file handle, it simply sets this file handle as the default input file. -When called without parameters, +When called without arguments, it returns the current default input file. @@ -9580,7 +9575,7 @@ it returns no values (to finish the loop) and automati The call io.lines() (with no file name) is equivalent to io.input():lines("*l"); that is, it iterates over the lines of the default input file. -In this case it does not close the file when the loop ends. +In this case, the iterator does not close the file when the loop ends.

    @@ -9963,7 +9958,7 @@ the host system and on the current locale.

    -On non-POSIX systems, +In non-POSIX systems, this function may be not thread safe because of its reliance on C function gmtime and C function localtime. @@ -10163,7 +10158,7 @@ and explicitly removed when no longer needed.

    -On POSIX systems, +In POSIX systems, this function also creates a file with that name, to avoid security risks. (Someone else might create the file with wrong permissions @@ -10301,8 +10296,8 @@ The first parameter or local variable has index 1 following the order that they are declared in the code, counting only the variables that are active in the current scope of the function. -Negative indices refer to vararg parameters; --1 is the first vararg parameter. +Negative indices refer to vararg arguments; +-1 is the first vararg argument. The function returns nil if there is no variable with the given index, and raises an error when called with a level out of range. (You can call debug.getinfo to check whether the level is valid.) @@ -10400,7 +10395,7 @@ When called without arguments,

    -When the hook is called, its first parameter is a string +When the hook is called, its first argument is a string describing the event that has triggered its call: "call" (or "tail call"), "return", @@ -10551,7 +10546,8 @@ The options are:

    • -e stat: executes string stat;
    • -
    • -l mod: "requires" mod;
    • +
    • -l mod: "requires" mod and assigns the + result to global @mod;
    • -i: enters interactive mode after running script;
    • -v: prints version information;
    • -E: ignores environment variables;
    • @@ -10629,7 +10625,7 @@ For instance, the call

      will print "-e". If there is a script, -the script is called with parameters +the script is called with arguments arg[1], ···, arg[#arg]. (Like all chunks in Lua, the script is compiled as a vararg function.) @@ -10815,7 +10811,7 @@ The following functions were deprecated in the mathema frexp, and ldexp. You can replace math.pow(x,y) with x^y; you can replace math.atan2 with math.atan, -which now accepts one or two parameters; +which now accepts one or two arguments; you can replace math.ldexp(x,exp) with x * 2.0^exp. For the other operations, you can either use an external library or @@ -10850,7 +10846,7 @@ of the first result.)

      • -Continuation functions now receive as parameters what they needed +Continuation functions now receive as arguments what they needed to get through lua_getctx, so lua_getctx has been removed. Adapt your code accordingly. @@ -10973,12 +10969,13 @@ and LiteralString, see §3.1.) + Modified: head/contrib/lua/doc/readme.html ============================================================================== --- head/contrib/lua/doc/readme.html Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/doc/readme.html Tue Aug 14 18:58:01 2018 (r337810) @@ -107,7 +107,7 @@ Here are the details.
        1. Open a terminal window and move to -the top-level directory, which is named lua-5.3.x. +the top-level directory, which is named lua-5.3.5. The Makefile there controls both the build process and the installation process.

        2. @@ -355,10 +355,10 @@ THE SOFTWARE. Modified: head/contrib/lua/src/Makefile ============================================================================== --- head/contrib/lua/src/Makefile Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/Makefile Tue Aug 14 18:58:01 2018 (r337810) @@ -102,7 +102,7 @@ c89: freebsd: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc" generic: $(ALL) @@ -110,7 +110,7 @@ linux: $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" macosx: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" mingw: $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \ Modified: head/contrib/lua/src/lapi.c ============================================================================== --- head/contrib/lua/src/lapi.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lapi.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.259 2016/02/29 14:27:14 roberto Exp $ +** $Id: lapi.c,v 2.259.1.2 2017/12/06 18:35:12 roberto Exp $ ** Lua API ** See Copyright Notice in lua.h */ @@ -533,6 +533,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunc lua_lock(L); if (n == 0) { setfvalue(L->top, fn); + api_incr_top(L); } else { CClosure *cl; @@ -546,9 +547,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunc /* does not need barrier because closure is white */ } setclCvalue(L, L->top, cl); + api_incr_top(L); + luaC_checkGC(L); } - api_incr_top(L); - luaC_checkGC(L); lua_unlock(L); } Modified: head/contrib/lua/src/lapi.h ============================================================================== --- head/contrib/lua/src/lapi.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lapi.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp $ +** $Id: lapi.h,v 2.9.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions from Lua API ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lauxlib.c ============================================================================== --- head/contrib/lua/src/lauxlib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lauxlib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.289 2016/12/20 18:37:00 roberto Exp $ +** $Id: lauxlib.c,v 1.289.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lauxlib.h ============================================================================== --- head/contrib/lua/src/lauxlib.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lauxlib.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.131 2016/12/06 14:54:31 roberto Exp $ +** $Id: lauxlib.h,v 1.131.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lbaselib.c ============================================================================== --- head/contrib/lua/src/lbaselib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lbaselib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.314 2016/09/05 19:06:34 roberto Exp $ +** $Id: lbaselib.c,v 1.314.1.1 2017/04/19 17:39:34 roberto Exp $ ** Basic library ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lbitlib.c ============================================================================== --- head/contrib/lua/src/lbitlib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lbitlib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lbitlib.c,v 1.30 2015/11/11 19:08:09 roberto Exp $ +** $Id: lbitlib.c,v 1.30.1.1 2017/04/19 17:20:42 roberto Exp $ ** Standard library for bitwise operations ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lcode.c ============================================================================== --- head/contrib/lua/src/lcode.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lcode.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.112 2016/12/22 13:08:50 roberto Exp $ +** $Id: lcode.c,v 2.112.1.1 2017/04/19 17:20:42 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lcode.h ============================================================================== --- head/contrib/lua/src/lcode.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lcode.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lcode.h,v 1.64 2016/01/05 16:22:37 roberto Exp $ +** $Id: lcode.h,v 1.64.1.1 2017/04/19 17:20:42 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lcorolib.c ============================================================================== --- head/contrib/lua/src/lcorolib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lcorolib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lcorolib.c,v 1.10 2016/04/11 19:19:55 roberto Exp $ +** $Id: lcorolib.c,v 1.10.1.1 2017/04/19 17:20:42 roberto Exp $ ** Coroutine Library ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lctype.c ============================================================================== --- head/contrib/lua/src/lctype.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lctype.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lctype.c,v 1.12 2014/11/02 19:19:04 roberto Exp $ +** $Id: lctype.c,v 1.12.1.1 2017/04/19 17:20:42 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lctype.h ============================================================================== --- head/contrib/lua/src/lctype.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lctype.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lctype.h,v 1.12 2011/07/15 12:50:29 roberto Exp $ +** $Id: lctype.h,v 1.12.1.1 2013/04/12 18:48:47 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/ldblib.c ============================================================================== --- head/contrib/lua/src/ldblib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/ldblib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.151 2015/11/23 11:29:43 roberto Exp $ +** $Id: ldblib.c,v 1.151.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/ldebug.c ============================================================================== --- head/contrib/lua/src/ldebug.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/ldebug.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.121 2016/10/19 12:32:10 roberto Exp $ +** $Id: ldebug.c,v 2.121.1.2 2017/07/10 17:21:50 roberto Exp $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -653,6 +653,7 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, CallInfo *ci = L->ci; const char *msg; va_list argp; + luaC_checkGC(L); /* error message uses memory */ va_start(argp, fmt); msg = luaO_pushvfstring(L, fmt, argp); /* format message */ va_end(argp); Modified: head/contrib/lua/src/ldebug.h ============================================================================== --- head/contrib/lua/src/ldebug.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/ldebug.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp $ +** $Id: ldebug.h,v 2.14.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions from Debug Interface module ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/ldo.c ============================================================================== --- head/contrib/lua/src/ldo.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/ldo.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 2.157 2016/12/13 15:52:21 roberto Exp $ +** $Id: ldo.c,v 2.157.1.1 2017/04/19 17:20:42 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/ldo.h ============================================================================== --- head/contrib/lua/src/ldo.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/ldo.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: ldo.h,v 2.29 2015/12/21 13:02:14 roberto Exp $ +** $Id: ldo.h,v 2.29.1.1 2017/04/19 17:20:42 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/ldump.c ============================================================================== --- head/contrib/lua/src/ldump.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/ldump.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: ldump.c,v 2.37 2015/10/08 15:53:49 roberto Exp $ +** $Id: ldump.c,v 2.37.1.1 2017/04/19 17:20:42 roberto Exp $ ** save precompiled Lua chunks ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lfunc.c ============================================================================== --- head/contrib/lua/src/lfunc.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lfunc.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lfunc.c,v 2.45 2014/11/02 19:19:04 roberto Exp $ +** $Id: lfunc.c,v 2.45.1.1 2017/04/19 17:39:34 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lfunc.h ============================================================================== --- head/contrib/lua/src/lfunc.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lfunc.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lfunc.h,v 2.15 2015/01/13 15:49:11 roberto Exp $ +** $Id: lfunc.h,v 2.15.1.1 2017/04/19 17:39:34 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lgc.c ============================================================================== --- head/contrib/lua/src/lgc.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lgc.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 2.215 2016/12/22 13:08:50 roberto Exp $ +** $Id: lgc.c,v 2.215.1.2 2017/08/31 16:15:27 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -643,8 +643,9 @@ static void clearkeys (global_State *g, GCObject *l, G for (n = gnode(h, 0); n < limit; n++) { if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) { setnilvalue(gval(n)); /* remove value ... */ - removeentry(n); /* and remove entry from table */ } + if (ttisnil(gval(n))) /* is entry empty? */ + removeentry(n); /* remove entry from table */ } } } Modified: head/contrib/lua/src/lgc.h ============================================================================== --- head/contrib/lua/src/lgc.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lgc.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.91 2015/12/21 13:02:14 roberto Exp $ +** $Id: lgc.h,v 2.91.1.1 2017/04/19 17:39:34 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/linit.c ============================================================================== --- head/contrib/lua/src/linit.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/linit.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: linit.c,v 1.39 2016/12/04 20:17:24 roberto Exp $ +** $Id: linit.c,v 1.39.1.1 2017/04/19 17:20:42 roberto Exp $ ** Initialization of libraries for lua.c and other clients ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/liolib.c ============================================================================== --- head/contrib/lua/src/liolib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/liolib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.151 2016/12/20 18:37:00 roberto Exp $ +** $Id: liolib.c,v 2.151.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -206,11 +206,16 @@ static int aux_close (lua_State *L) { } +static int f_close (lua_State *L) { + tofile(L); /* make sure argument is an open stream */ + return aux_close(L); +} + + static int io_close (lua_State *L) { if (lua_isnone(L, 1)) /* no argument? */ lua_getfield(L, LUA_REGISTRYINDEX, IO_OUTPUT); /* use standard output */ - tofile(L); /* make sure argument is an open stream */ - return aux_close(L); + return f_close(L); } @@ -712,7 +717,7 @@ static const luaL_Reg iolib[] = { ** methods for file handles */ static const luaL_Reg flib[] = { - {"close", io_close}, + {"close", f_close}, {"flush", f_flush}, {"lines", f_lines}, {"read", f_read}, Modified: head/contrib/lua/src/llex.c ============================================================================== --- head/contrib/lua/src/llex.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/llex.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 2.96 2016/05/02 14:02:12 roberto Exp $ +** $Id: llex.c,v 2.96.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/llex.h ============================================================================== --- head/contrib/lua/src/llex.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/llex.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: llex.h,v 1.79 2016/05/02 14:02:12 roberto Exp $ +** $Id: llex.h,v 1.79.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/llimits.h ============================================================================== --- head/contrib/lua/src/llimits.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/llimits.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.141 2015/11/19 19:16:22 roberto Exp $ +** $Id: llimits.h,v 1.141.1.1 2017/04/19 17:20:42 roberto Exp $ ** Limits, basic types, and some other 'installation-dependent' definitions ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lmathlib.c ============================================================================== --- head/contrib/lua/src/lmathlib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lmathlib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.119 2016/12/22 13:08:50 roberto Exp $ +** $Id: lmathlib.c,v 1.119.1.1 2017/04/19 17:20:42 roberto Exp $ ** Standard mathematical library ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lmem.c ============================================================================== --- head/contrib/lua/src/lmem.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lmem.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lmem.c,v 1.91 2015/03/06 19:45:54 roberto Exp $ +** $Id: lmem.c,v 1.91.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lmem.h ============================================================================== --- head/contrib/lua/src/lmem.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lmem.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lmem.h,v 1.43 2014/12/19 17:26:14 roberto Exp $ +** $Id: lmem.h,v 1.43.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/loadlib.c ============================================================================== --- head/contrib/lua/src/loadlib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/loadlib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.130 2017/01/12 17:14:26 roberto Exp $ +** $Id: loadlib.c,v 1.130.1.1 2017/04/19 17:20:42 roberto Exp $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** Modified: head/contrib/lua/src/lobject.c ============================================================================== --- head/contrib/lua/src/lobject.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lobject.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 2.113 2016/12/22 13:08:50 roberto Exp $ +** $Id: lobject.c,v 2.113.1.1 2017/04/19 17:29:57 roberto Exp $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -435,7 +435,8 @@ const char *luaO_pushvfstring (lua_State *L, const cha } case 'p': { /* a pointer */ char buff[4*sizeof(void *) + 8]; /* should be enough space for a '%p' */ - int l = l_sprintf(buff, sizeof(buff), "%p", va_arg(argp, void *)); + void *p = va_arg(argp, void *); + int l = lua_pointer2str(buff, sizeof(buff), p); pushstr(L, buff, l); break; } Modified: head/contrib/lua/src/lobject.h ============================================================================== --- head/contrib/lua/src/lobject.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lobject.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.117 2016/08/01 19:51:24 roberto Exp $ +** $Id: lobject.h,v 2.117.1.1 2017/04/19 17:39:34 roberto Exp $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lopcodes.c ============================================================================== --- head/contrib/lua/src/lopcodes.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lopcodes.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.c,v 1.55 2015/01/05 13:48:33 roberto Exp $ +** $Id: lopcodes.c,v 1.55.1.1 2017/04/19 17:20:42 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lopcodes.h ============================================================================== --- head/contrib/lua/src/lopcodes.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lopcodes.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.149 2016/07/19 17:12:21 roberto Exp $ +** $Id: lopcodes.h,v 1.149.1.1 2017/04/19 17:20:42 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/loslib.c ============================================================================== --- head/contrib/lua/src/loslib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/loslib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.65 2016/07/18 17:58:58 roberto Exp $ +** $Id: loslib.c,v 1.65.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -293,7 +293,8 @@ static int os_date (lua_State *L) { else stm = l_localtime(&t, &tmr); if (stm == NULL) /* invalid date? */ - luaL_error(L, "time result cannot be represented in this installation"); + return luaL_error(L, + "time result cannot be represented in this installation"); if (strcmp(s, "*t") == 0) { lua_createtable(L, 0, 9); /* 9 = number of fields */ setallfields(L, stm); @@ -340,7 +341,8 @@ static int os_time (lua_State *L) { setallfields(L, &ts); /* update fields with normalized values */ } if (t != (time_t)(l_timet)t || t == (time_t)(-1)) - luaL_error(L, "time result cannot be represented in this installation"); + return luaL_error(L, + "time result cannot be represented in this installation"); l_pushtime(L, t); return 1; } Modified: head/contrib/lua/src/lparser.c ============================================================================== --- head/contrib/lua/src/lparser.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lparser.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 2.155 2016/08/01 19:51:24 roberto Exp $ +** $Id: lparser.c,v 2.155.1.2 2017/04/29 18:11:40 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -1392,7 +1392,7 @@ static void test_then_block (LexState *ls, int *escape luaK_goiffalse(ls->fs, &v); /* will jump to label if condition is true */ enterblock(fs, &bl, 0); /* must enter block before 'goto' */ gotostat(ls, v.t); /* handle goto/break */ - skipnoopstat(ls); /* skip other no-op statements */ + while (testnext(ls, ';')) {} /* skip colons */ if (block_follow(ls, 0)) { /* 'goto' is the entire block? */ leaveblock(fs); return; /* and that is it */ Modified: head/contrib/lua/src/lparser.h ============================================================================== --- head/contrib/lua/src/lparser.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lparser.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lparser.h,v 1.76 2015/12/30 18:16:13 roberto Exp $ +** $Id: lparser.h,v 1.76.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lprefix.h ============================================================================== --- head/contrib/lua/src/lprefix.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lprefix.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $ +** $Id: lprefix.h,v 1.2.1.1 2017/04/19 17:20:42 roberto Exp $ ** Definitions for Lua code that must come before any other header file ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lstate.c ============================================================================== --- head/contrib/lua/src/lstate.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lstate.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.133 2015/11/13 12:16:51 roberto Exp $ +** $Id: lstate.c,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lstate.h ============================================================================== --- head/contrib/lua/src/lstate.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lstate.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.133 2016/12/22 13:08:50 roberto Exp $ +** $Id: lstate.h,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ @@ -26,6 +26,24 @@ ** 'tobefnz': all objects ready to be finalized; ** 'fixedgc': all objects that are not to be collected (currently ** only small strings, such as reserved words). +** +** Moreover, there is another set of lists that control gray objects. +** These lists are linked by fields 'gclist'. (All objects that +** can become gray have such a field. The field is not the same +** in all objects, but it always has this name.) Any gray object +** must belong to one of these lists, and all objects in these lists +** must be gray: +** +** 'gray': regular gray objects, still waiting to be visited. +** 'grayagain': objects that must be revisited at the atomic phase. +** That includes +** - black objects got in a write barrier; +** - all kinds of weak tables during propagation phase; +** - all threads. +** 'weak': tables with weak values to be cleared; +** 'ephemeron': ephemeron tables with white->white entries; +** 'allweak': tables with weak keys and/or weak values to be cleared. +** The last three lists are used only during the atomic phase. */ Modified: head/contrib/lua/src/lstring.c ============================================================================== --- head/contrib/lua/src/lstring.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lstring.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lstring.c,v 2.56 2015/11/23 11:32:51 roberto Exp $ +** $Id: lstring.c,v 2.56.1.1 2017/04/19 17:20:42 roberto Exp $ ** String table (keeps all strings handled by Lua) ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lstring.h ============================================================================== --- head/contrib/lua/src/lstring.h Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lstring.h Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lstring.h,v 1.61 2015/11/03 15:36:01 roberto Exp $ +** $Id: lstring.h,v 1.61.1.1 2017/04/19 17:20:42 roberto Exp $ ** String table (keep all strings handled by Lua) ** See Copyright Notice in lua.h */ Modified: head/contrib/lua/src/lstrlib.c ============================================================================== --- head/contrib/lua/src/lstrlib.c Tue Aug 14 18:45:25 2018 (r337809) +++ head/contrib/lua/src/lstrlib.c Tue Aug 14 18:58:01 2018 (r337810) @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.254 2016/12/22 13:08:50 roberto Exp $ +** $Id: lstrlib.c,v 1.254.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -879,7 +879,7 @@ static int lua_number2strx (lua_State *L, char *buff, buff[i] = toupper(uchar(buff[i])); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Aug 14 18:58:17 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 F29741081A0E; Tue, 14 Aug 2018 18:58:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5B508237A; Tue, 14 Aug 2018 18:58:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86ADD1F895; Tue, 14 Aug 2018 18:58:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EIwG5Z064379; Tue, 14 Aug 2018 18:58:16 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EIwGZa064378; Tue, 14 Aug 2018 18:58:16 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808141858.w7EIwGZa064378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 14 Aug 2018 18:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337811 - head/sys/dev/neta X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/dev/neta X-SVN-Commit-Revision: 337811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 18:58:17 -0000 Author: loos Date: Tue Aug 14 18:58:16 2018 New Revision: 337811 URL: https://svnweb.freebsd.org/changeset/base/337811 Log: Disable the auto negotiation if the port is set to fixed-link. Tested on SG-3100 (ARMADA38X) and Espresso.bin (A37x0). Fixes the network on espresso.bin. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/neta/if_mvneta.c Modified: head/sys/dev/neta/if_mvneta.c ============================================================================== --- head/sys/dev/neta/if_mvneta.c Tue Aug 14 18:58:01 2018 (r337810) +++ head/sys/dev/neta/if_mvneta.c Tue Aug 14 18:58:16 2018 (r337811) @@ -757,6 +757,7 @@ mvneta_attach(device_t self) } else { /* Fixed-link, use predefined values */ + mvneta_update_autoneg(sc, FALSE); ifmedia_init(&sc->mvneta_ifmedia, 0, mvneta_mediachange, mvneta_mediastatus); From owner-svn-src-all@freebsd.org Tue Aug 14 19:12: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 C830710550A2; Tue, 14 Aug 2018 19:12:46 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D7E0830F8; Tue, 14 Aug 2018 19:12:46 +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 5E94F1FBB7; Tue, 14 Aug 2018 19:12:46 +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 w7EJCkU4074951; Tue, 14 Aug 2018 19:12:46 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EJCjB5074948; Tue, 14 Aug 2018 19:12:45 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201808141912.w7EJCjB5074948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 14 Aug 2018 19:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337812 - in head: sys/dev/netmap tests/sys/kqueue/libkqueue X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: in head: sys/dev/netmap tests/sys/kqueue/libkqueue X-SVN-Commit-Revision: 337812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 19:12:47 -0000 Author: dab Date: Tue Aug 14 19:12:45 2018 New Revision: 337812 URL: https://svnweb.freebsd.org/changeset/base/337812 Log: Fix several memory leaks. The libkqueue tests have several places that leak memory by using an idiom like: puts(kevent_to_str(kevp)); Rework to save the pointer returned from kevent_to_str() and then free() it after it has been used. Reported by: asomers (pointer to Coverity), Coverity CID: 1296063, 1296064, 1296065, 1296066, 1296067, 1350287, 1394960 Sponsored by: Dell EMC Modified: head/sys/dev/netmap/netmap_freebsd.c head/tests/sys/kqueue/libkqueue/common.h head/tests/sys/kqueue/libkqueue/main.c head/tests/sys/kqueue/libkqueue/proc.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Tue Aug 14 18:58:16 2018 (r337811) +++ head/sys/dev/netmap/netmap_freebsd.c Tue Aug 14 19:12:45 2018 (r337812) @@ -1498,7 +1498,7 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn) kn->kn_fop = (ev == EVFILT_WRITE) ? &netmap_wfiltops : &netmap_rfiltops; kn->kn_hook = priv; - knlist_add(&si->si.si_note, kn, 1); + knlist_add(&si->si.si_note, kn, 0); // XXX unlock(priv) ND("register %p %s td %p priv %p kn %p np_nifp %p kn_fp/fpop %s", na, na->ifp->if_xname, curthread, priv, kn, Modified: head/tests/sys/kqueue/libkqueue/common.h ============================================================================== --- head/tests/sys/kqueue/libkqueue/common.h Tue Aug 14 18:58:16 2018 (r337811) +++ head/tests/sys/kqueue/libkqueue/common.h Tue Aug 14 19:12:45 2018 (r337812) @@ -43,7 +43,7 @@ extern char *cur_test_id; int vnode_fd; -extern const char * kevent_to_str(struct kevent *); +extern char * kevent_to_str(struct kevent *); struct kevent * kevent_get(int); struct kevent * kevent_get_timeout(int, int); Modified: head/tests/sys/kqueue/libkqueue/main.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/main.c Tue Aug 14 18:58:16 2018 (r337811) +++ head/tests/sys/kqueue/libkqueue/main.c Tue Aug 14 19:12:45 2018 (r337812) @@ -41,13 +41,16 @@ test_no_kevents(void) int nfds; struct timespec timeo; struct kevent kev; + char *kev_str; puts("confirming that there are no events pending"); memset(&timeo, 0, sizeof(timeo)); nfds = kevent(kqfd, NULL, 0, &kev, 1, &timeo); if (nfds != 0) { puts("\nUnexpected event:"); - puts(kevent_to_str(&kev)); + kev_str = kevent_to_str(&kev); + puts(kev_str); + free(kev_str); errx(1, "%d event(s) pending, but none expected:", nfds); } } @@ -61,12 +64,15 @@ test_no_kevents_quietly(void) int nfds; struct timespec timeo; struct kevent kev; + char *kev_str; memset(&timeo, 0, sizeof(timeo)); nfds = kevent(kqfd, NULL, 0, &kev, 1, &timeo); if (nfds != 0) { puts("\nUnexpected event:"); - puts(kevent_to_str(&kev)); + kev_str = kevent_to_str(&kev); + puts(kev_str); + free(kev_str); errx(1, "%d event(s) pending, but none expected:", nfds); } } @@ -193,18 +199,20 @@ kevent_flags_dump(struct kevent *kev) } /* Copied from ../kevent.c kevent_dump() and improved */ -const char * +char * kevent_to_str(struct kevent *kev) { char buf[512]; + char *flags_str = kevent_flags_dump(kev); + char *fflags_str = kevent_fflags_dump(kev); snprintf(&buf[0], sizeof(buf), "[ident=%ju, filter=%d, %s, %s, data=%jd, udata=%p, " "ext=[%jx %jx %jx %jx]", (uintmax_t) kev->ident, kev->filter, - kevent_flags_dump(kev), - kevent_fflags_dump(kev), + flags_str, + fflags_str, (uintmax_t)kev->data, kev->udata, (uintmax_t)kev->ext[0], @@ -212,6 +220,9 @@ kevent_to_str(struct kevent *kev) (uintmax_t)kev->ext[2], (uintmax_t)kev->ext[3]); + free(flags_str); + free(fflags_str); + return (strdup(buf)); } Modified: head/tests/sys/kqueue/libkqueue/proc.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/proc.c Tue Aug 14 18:58:16 2018 (r337811) +++ head/tests/sys/kqueue/libkqueue/proc.c Tue Aug 14 19:12:45 2018 (r337812) @@ -172,6 +172,7 @@ proc_track(int sleep_time) int gchild_note = 0; pid_t gchild_pid = -1; int done = 0; + char *kev_str; while (!done) { @@ -182,7 +183,9 @@ proc_track(int sleep_time) if (kevp == NULL) { done = 1; } else { - printf(" -- Received kevent: %s\n", kevent_to_str(kevp)); + kev_str = kevent_to_str(kevp); + printf(" -- Received kevent: %s\n", kev_str); + free(kev_str); if ((kevp->fflags & NOTE_CHILD) && (kevp->fflags & NOTE_EXIT)) { errx(1, "NOTE_CHILD and NOTE_EXIT in same kevent: %s", kevent_to_str(kevp)); From owner-svn-src-all@freebsd.org Tue Aug 14 19:21: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 326221055604; Tue, 14 Aug 2018 19:21:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA87983673; Tue, 14 Aug 2018 19:21:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB2521FD03; Tue, 14 Aug 2018 19:21:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EJLV2b076058; Tue, 14 Aug 2018 19:21:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EJLVAa076057; Tue, 14 Aug 2018 19:21:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808141921.w7EJLVAa076057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Aug 2018 19:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337813 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 337813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 19:21:32 -0000 Author: markj Date: Tue Aug 14 19:21:31 2018 New Revision: 337813 URL: https://svnweb.freebsd.org/changeset/base/337813 Log: Help ensure that the copy loop doesn't get converted to a memcpy() call. Reported and reviewed by: kib X-MFC with: r337715 Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/ucode.c Modified: head/sys/x86/x86/ucode.c ============================================================================== --- head/sys/x86/x86/ucode.c Tue Aug 14 19:12:45 2018 (r337812) +++ head/sys/x86/x86/ucode.c Tue Aug 14 19:21:31 2018 (r337813) @@ -346,7 +346,7 @@ ucode_load_bsp(uintptr_t free) addr = map_ucode(free, len); /* We can't use memcpy() before ifunc resolution. */ for (i = 0; i < len; i++) - addr[i] = match[i]; + addr[i] = ((volatile uint8_t *)match)[i]; match = addr; if (loader->load(match, false) == 0) { From owner-svn-src-all@freebsd.org Tue Aug 14 19:31: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 C8EA610558BE; Tue, 14 Aug 2018 19:31:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C6A983C71; Tue, 14 Aug 2018 19:31:07 +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 5D6FC1FE8C; Tue, 14 Aug 2018 19:31:07 +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 w7EJV7Fo081256; Tue, 14 Aug 2018 19:31:07 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EJV77D081255; Tue, 14 Aug 2018 19:31:07 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201808141931.w7EJV77D081255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 14 Aug 2018 19:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337814 - head/tests/sys/kqueue/libkqueue X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/tests/sys/kqueue/libkqueue X-SVN-Commit-Revision: 337814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 19:31:08 -0000 Author: dab Date: Tue Aug 14 19:31:06 2018 New Revision: 337814 URL: https://svnweb.freebsd.org/changeset/base/337814 Log: Fix several (more) memory leaks. A follow-up to r337812 to catch a couple more memory leaks that should have been included in that change. Reported by: Coverity CID: 1296064, 1296067 (for real this time) MFC after: 3 days X-MFC-with: r337812 Sponsored by: Dell EMC Modified: head/tests/sys/kqueue/libkqueue/main.c Modified: head/tests/sys/kqueue/libkqueue/main.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/main.c Tue Aug 14 19:21:31 2018 (r337813) +++ head/tests/sys/kqueue/libkqueue/main.c Tue Aug 14 19:31:06 2018 (r337814) @@ -235,10 +235,14 @@ kevent_add(int kqfd, struct kevent *kev, intptr_t data, void *udata) { + char *kev_str; + EV_SET(kev, ident, filter, flags, fflags, data, NULL); if (kevent(kqfd, kev, 1, NULL, 0, NULL) < 0) { - printf("Unable to add the following kevent:\n%s\n", - kevent_to_str(kev)); + kev_str = kevent_to_str(kev); + printf("Unable to add the following kevent:\n%s\n", + kev_str); + free(kev_str); err(1, "kevent(): %s", strerror(errno)); } } @@ -246,6 +250,9 @@ kevent_add(int kqfd, struct kevent *kev, void kevent_cmp(struct kevent *k1, struct kevent *k2) { + char *kev1_str; + char *kev2_str; + /* XXX- Workaround for inconsistent implementation of kevent(2) */ @@ -258,8 +265,12 @@ kevent_cmp(struct kevent *k1, struct kevent *k2) k1->data != k2->data || k1->udata != k2->udata || k1->ext[0] != k2->ext[0] || k1->ext[1] != k2->ext[1] || k1->ext[0] != k2->ext[2] || k1->ext[0] != k2->ext[3]) { + kev1_str = kevent_to_str(k1); + kev2_str = kevent_to_str(k2); printf("kevent_cmp: mismatch:\n %s !=\n %s\n", - kevent_to_str(k1), kevent_to_str(k2)); + kev1_str, kev2_str); + free(kev1_str); + free(kev2_str); abort(); } } From owner-svn-src-all@freebsd.org Tue Aug 14 19:42: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 73F201055EE8; Tue, 14 Aug 2018 19:42:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2995284581; Tue, 14 Aug 2018 19:42:19 +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 0A99A2007A; Tue, 14 Aug 2018 19:42:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EJgIc2090268; Tue, 14 Aug 2018 19:42:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EJgIfn090267; Tue, 14 Aug 2018 19:42:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808141942.w7EJgIfn090267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 14 Aug 2018 19:42: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: r337815 - stable/11/stand/uboot/common X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/uboot/common X-SVN-Commit-Revision: 337815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 19:42:19 -0000 Author: kevans Date: Tue Aug 14 19:42:18 2018 New Revision: 337815 URL: https://svnweb.freebsd.org/changeset/base/337815 Log: ubldr: Bump heap size, 1MB -> 2MB 1MB was leaving very little margin in some of the worse-case scenarios with lualoader. 2MB is still low enough that we shouldn't have any problems with UBoot-supported boards. Modified: stable/11/stand/uboot/common/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/uboot/common/main.c ============================================================================== --- stable/11/stand/uboot/common/main.c Tue Aug 14 19:31:06 2018 (r337814) +++ stable/11/stand/uboot/common/main.c Tue Aug 14 19:42:18 2018 (r337815) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #endif #ifndef HEAP_SIZE -#define HEAP_SIZE (1 * 1024 * 1024) +#define HEAP_SIZE (2 * 1024 * 1024) #endif struct uboot_devdesc currdev; From owner-svn-src-all@freebsd.org Tue Aug 14 19:44:37 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 BA1961058339; Tue, 14 Aug 2018 19:44: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 704DB84980; Tue, 14 Aug 2018 19:44: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 52B692008E; Tue, 14 Aug 2018 19:44: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 w7EJibPs090672; Tue, 14 Aug 2018 19:44:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EJiaAv090670; Tue, 14 Aug 2018 19:44:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808141944.w7EJiaAv090670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 14 Aug 2018 19:44:36 +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: r337816 - in stable/11/stand/i386: gptboot isoboot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/i386: gptboot isoboot X-SVN-Commit-Revision: 337816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 19:44:37 -0000 Author: kevans Date: Tue Aug 14 19:44:36 2018 New Revision: 337816 URL: https://svnweb.freebsd.org/changeset/base/337816 Log: MFC r337520: Fix WITHOUT_LOADER_GELI (gptboot) and isoboot in general gptboot was broken when r316078 added the LOADER_GELI_SUPPORT #ifdef to not pass geliargs via __exec. KARGS_FLAGS_EXTARG must not be used if we're not going to pass an additional argument to __exec. PR: 228151 Modified: stable/11/stand/i386/gptboot/gptboot.c stable/11/stand/i386/isoboot/isoboot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/gptboot/gptboot.c ============================================================================== --- stable/11/stand/i386/gptboot/gptboot.c Tue Aug 14 19:42:18 2018 (r337815) +++ stable/11/stand/i386/gptboot/gptboot.c Tue Aug 14 19:44:36 2018 (r337816) @@ -482,9 +482,10 @@ load(void) #endif __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) #ifdef LOADER_GELI_SUPPORT - , geliargs + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo), geliargs +#else + 0, 0, 0, VTOP(&bootinfo) #endif ); } Modified: stable/11/stand/i386/isoboot/isoboot.c ============================================================================== --- stable/11/stand/i386/isoboot/isoboot.c Tue Aug 14 19:42:18 2018 (r337815) +++ stable/11/stand/i386/isoboot/isoboot.c Tue Aug 14 19:44:36 2018 (r337816) @@ -417,7 +417,7 @@ load(void) bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.unit, 0), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo)); + 0, 0, 0, VTOP(&bootinfo)); } static int From owner-svn-src-all@freebsd.org Tue Aug 14 19:58: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 A8BCD1058C5B; Tue, 14 Aug 2018 19:58:35 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (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 3AA05852B9; Tue, 14 Aug 2018 19:58:35 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x230.google.com with SMTP id f18-v6so22464035qtp.10; Tue, 14 Aug 2018 12:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=u0vp2kIEIpsHJ47ukBzO049cj5gTPTYN2WNmr7IsmoE=; b=jilkeJhISiU0jMfbp2ase68/FL0FsOn482hViUGOgevKiXH6bHhAZbRVcq5eLwj7wb LtGtQO3KclMvkMCuZbGQ8Ydma4sApefW+K0iFgbWgDbN4ZZU+/4umOfEj7a1lECaGpkx HXazip3nZyZ6l4ieQNEb7HoEcSSMPQqnmhLA6efzP06iQJ4pHv2qO89FW+uQ9fPyR1Rt 3qUGJK1wDNJ5iqVUq6lHBU34e7fJ+9+l6GTq3KyMTcj0MOplVHSdqdJH7vMnsropDGQB iFqX/oCOCHGWPleKqgPlHF2fY3+7Jbz2/UGZgdo3MJ5+UjazxugCobC4gLejXNlFYOWU 077w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=u0vp2kIEIpsHJ47ukBzO049cj5gTPTYN2WNmr7IsmoE=; b=O6O5HNu5dankPU07OkPB7jKre5WyTvFojOuESCXgk/w6he807iz6sXYrrNvOzQUB2Q qH8SWOcqphPEbigqraZ07NmgmGDFDQzL6MwCH3COqvXCuX00GW4Tin3Ip61FezwQADyT V7Acxzb/lKo3K7GtGZXK/fJygRaIRwxXji0DqjCyixjhoi03/YqaR6McTWbsLPaCqcoA X6xnqYsw5qyD6u5IW7tbj86wlH1M5DdxIPMh4llbNPDmJzS+DPY8YrT4OiY99hxeYnxu 613S0M07rItWnDld7XpPsXMD7tF8geD8hfodAf81QhEkThBeZmeNzmhwfIon46zKsB7e NuzA== X-Gm-Message-State: AOUpUlE18YYcR91gilvzz0oN1T3Y8PGSeCkqaKwjcKLDor/iBqe5A4wh /3Y+aUIR35ojVzboc0RdpyaI5eQJ X-Google-Smtp-Source: AA+uWPx6TPuPEuFeyZbh1KLCOzV72WPqQZyYNENR8nYFZSQ7fu0vEJw1wdgyw7j8YhX4fIROn1s2aw== X-Received: by 2002:ac8:1bdc:: with SMTP id m28-v6mr21473713qtk.81.1534276714469; Tue, 14 Aug 2018 12:58:34 -0700 (PDT) Received: from mbp-eth.home ([177.53.86.172]) by smtp.gmail.com with ESMTPSA id e29-v6sm7227771qte.47.2018.08.14.12.58.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Aug 2018 12:58:33 -0700 (PDT) Subject: Re: svn commit: r337814 - head/tests/sys/kqueue/libkqueue To: David Bright , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808141931.w7EJV77D081255@repo.freebsd.org> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga.bsd@gmail.com; prefer-encrypt=mutual; keydata= xsBNBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/UM7ATQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABwsB8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: <98e8803a-1677-066a-6e50-a0183bd93f53@gmail.com> Date: Tue, 14 Aug 2018 16:58:30 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201808141931.w7EJV77D081255@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 19:58:36 -0000 On 14/08/18 16:31, David Bright wrote: > Author: dab > Date: Tue Aug 14 19:31:06 2018 > New Revision: 337814 > URL: https://svnweb.freebsd.org/changeset/base/337814 > > Log: > Fix several (more) memory leaks. > > A follow-up to r337812 to catch a couple more memory leaks that should > have been included in that change. > > Reported by: Coverity > CID: 1296064, 1296067 (for real this time) > MFC after: 3 days > X-MFC-with: r337812 > Sponsored by: Dell EMC > > Modified: > head/tests/sys/kqueue/libkqueue/main.c > > Modified: head/tests/sys/kqueue/libkqueue/main.c > ============================================================================== > --- head/tests/sys/kqueue/libkqueue/main.c Tue Aug 14 19:21:31 2018 (r337813) > +++ head/tests/sys/kqueue/libkqueue/main.c Tue Aug 14 19:31:06 2018 (r337814) > @@ -235,10 +235,14 @@ kevent_add(int kqfd, struct kevent *kev, > intptr_t data, > void *udata) > { > + char *kev_str; > + > EV_SET(kev, ident, filter, flags, fflags, data, NULL); > if (kevent(kqfd, kev, 1, NULL, 0, NULL) < 0) { > - printf("Unable to add the following kevent:\n%s\n", > - kevent_to_str(kev)); > + kev_str = kevent_to_str(kev); It seems that this line is indented with spaces instead of TABs > + printf("Unable to add the following kevent:\n%s\n", > + kev_str); > + free(kev_str); > err(1, "kevent(): %s", strerror(errno)); > } > } > @@ -246,6 +250,9 @@ kevent_add(int kqfd, struct kevent *kev, > void > kevent_cmp(struct kevent *k1, struct kevent *k2) > { > + char *kev1_str; > + char *kev2_str; > + > /* XXX- > Workaround for inconsistent implementation of kevent(2) > */ > @@ -258,8 +265,12 @@ kevent_cmp(struct kevent *k1, struct kevent *k2) > k1->data != k2->data || k1->udata != k2->udata || > k1->ext[0] != k2->ext[0] || k1->ext[1] != k2->ext[1] || > k1->ext[0] != k2->ext[2] || k1->ext[0] != k2->ext[3]) { > + kev1_str = kevent_to_str(k1); Same here > + kev2_str = kevent_to_str(k2); > printf("kevent_cmp: mismatch:\n %s !=\n %s\n", > - kevent_to_str(k1), kevent_to_str(k2)); > + kev1_str, kev2_str); > + free(kev1_str); > + free(kev2_str); > abort(); > } > } > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > -- Renato Botelho From owner-svn-src-all@freebsd.org Tue Aug 14 20:02: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 C2CA5105B04B; Tue, 14 Aug 2018 20:02: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75D4585950; Tue, 14 Aug 2018 20:02: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 56CFA20398; Tue, 14 Aug 2018 20:02: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 w7EK23Wf000156; Tue, 14 Aug 2018 20:02:03 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EK22GQ098425; Tue, 14 Aug 2018 20:02:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808142002.w7EK22GQ098425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 14 Aug 2018 20:02: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: r337817 - in stable/11: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/patches contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/driv... X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/11: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/patches contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/eap_c... X-SVN-Commit-Revision: 337817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 20:02:04 -0000 Author: cy Date: Tue Aug 14 20:02:01 2018 New Revision: 337817 URL: https://svnweb.freebsd.org/changeset/base/337817 Log: MFC r336203, r336499, r336501-r336502, r336506, r336510, r336512-r336513, r336515, r336528-r336531 r336203: MFV r324714: Update wpa 2.5 --> 2.6. r336499: MFV: r336485 Address: hostapd: Avoid key reinstallation in FT handshake Obtained from: https://w1.fi/security/2017-1/\ rebased-v2.6-0001-hostapd-Avoid-key-\ reinstallation-in-FT-handshake.patch r336501: MFV: r336486 Prevent reinstallation of an already in-use group key. Upline git commit cb5132bb35698cc0c743e34fe0e845dfc4c3e410. Obtained from: https://w1.fi/security/2017-1/\ rebased-v2.6-0002-Prevent-reinstallation-\ of-an-already-in-use-group-ke.patch r336502: MFV r336487: Import upline security patch: Extend protection of GTK/IGTK reinstallation of WNM-Sleep Mode cases. This git commit 87e2db16bafcbc60b8d0016175814a73c1e8ed45. This commit is is simply a pops change as r324696 already plugged this vulnerability. To maintain consistency with the vendor branch props will be changed. Obtained from: https://w1.fi/security/2017-1/\ rebased-v2.6-0003-Extend-protection-of-GTK-IGTK-\ reinstallation-of-WNM-.patch r336506: MFV r336490: Prevent installation of an all-zero TK. This is also upline git commit 53bb18cc8b7a4da72e47e4b3752d0d2135cffb23. Obtained from: https://w1.fi/security/2017-1/\ rebased-v2.6-0004-Prevent-installation-\ of-an-all-zero-TK.patch r336510: MFV r336493: Fix PTK rekeying to generate a new ANonce. This is also upline git commit 0adc9b28b39d414d5febfff752f6a1576f785c85. This commit is a NOP, just changing props as the heavy lifting was done by r324696. This just brings us into line with the vendor branch. Obtained from: https://w1.fi/security/2017-1/\ rebased-v2.6-0005-Fix-PTK-rekeying-to-\ generate-a-new-ANonce.patch r336512: MFV r336494: TDLS: Reject TPK-TK reconfiguration. This is also upline git commmit ff89af96e5a35c86f50330d2b86c18323318a60c. Once again this is a NOP as this is a props change to sync up with the vendor branch. The real commit is in r324696. Obtained from: https://w1.fi/security/2017-1/\ rebased-v2.6-0006-TDLS-Reject-TPK-TK-\ reconfiguration.patch r336513: MFV r336495: Another props change. The real work was done by r324696. We're simply syncing up with the vendor branch again. mport upline security patch: WNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case. This is also upline git commit 114f2830d2c2aee6db23d48240e93415a256a37c. Obtained from: https://w1.fi/security/2017-1/\ rebased-v2.6-0007-WNM-Ignore-WNM-Sleep-Mode-\ Response-without-pending-r.patch r336515: MFV r336496: A props change to sync up with the vendor branch. The real work was done by r324696. FILS: Do not allow multiple (Re)Association Response frames. This is also upline git commit e760851176c77ae6de19821bb1d5bf3ae2cb5187. Obtained from: https://w1.fi/security/2017-1/\ rebased-v2.6-0008-FT-Do-not-allow-multiple-\ Reassociation-Response-fram.patch r336528: Revert r336501. It was a of the wrong rev from the vendor branch. r336529: MFV: r336486 Prevent reinstallation of an already in-use group key. Upline git commit cb5132bb35698cc0c743e34fe0e845dfc4c3e410. Obtained from: https://w1.fi/security/2017-1/\ rebased-v2.6-0002-Prevent-reinstallation-\ of-an-already-in-use-group-ke.patch r336530: To reduce our diff between our sources and our upline, sync up with upline. Also making it easier to read. Obtained from: diffing base with ports r336531: Remove a redundant declaration. While at it add a blank line, conforming with the convention used in this file. Added: stable/11/contrib/wpa/src/ap/mbo_ap.c - copied unchanged from r336203, head/contrib/wpa/src/ap/mbo_ap.c stable/11/contrib/wpa/src/ap/mbo_ap.h - copied unchanged from r336203, head/contrib/wpa/src/ap/mbo_ap.h stable/11/contrib/wpa/src/ap/neighbor_db.c - copied unchanged from r336203, head/contrib/wpa/src/ap/neighbor_db.c stable/11/contrib/wpa/src/ap/neighbor_db.h - copied unchanged from r336203, head/contrib/wpa/src/ap/neighbor_db.h stable/11/contrib/wpa/src/ap/rrm.c - copied unchanged from r336203, head/contrib/wpa/src/ap/rrm.c stable/11/contrib/wpa/src/ap/rrm.h - copied unchanged from r336203, head/contrib/wpa/src/ap/rrm.h stable/11/contrib/wpa/src/ap/taxonomy.c - copied unchanged from r336203, head/contrib/wpa/src/ap/taxonomy.c stable/11/contrib/wpa/src/ap/taxonomy.h - copied unchanged from r336203, head/contrib/wpa/src/ap/taxonomy.h stable/11/contrib/wpa/src/ap/vlan.c - copied unchanged from r336203, head/contrib/wpa/src/ap/vlan.c stable/11/contrib/wpa/src/ap/vlan.h - copied unchanged from r336203, head/contrib/wpa/src/ap/vlan.h stable/11/contrib/wpa/src/ap/vlan_full.c - copied unchanged from r336203, head/contrib/wpa/src/ap/vlan_full.c stable/11/contrib/wpa/src/ap/vlan_ifconfig.c - copied unchanged from r336203, head/contrib/wpa/src/ap/vlan_ifconfig.c stable/11/contrib/wpa/src/ap/vlan_ioctl.c - copied unchanged from r336203, head/contrib/wpa/src/ap/vlan_ioctl.c stable/11/contrib/wpa/src/common/cli.c - copied unchanged from r336203, head/contrib/wpa/src/common/cli.c stable/11/contrib/wpa/src/common/cli.h - copied unchanged from r336203, head/contrib/wpa/src/common/cli.h stable/11/contrib/wpa/src/common/ctrl_iface_common.c - copied unchanged from r336203, head/contrib/wpa/src/common/ctrl_iface_common.c stable/11/contrib/wpa/src/common/ctrl_iface_common.h - copied unchanged from r336203, head/contrib/wpa/src/common/ctrl_iface_common.h stable/11/contrib/wpa/src/crypto/sha384-internal.c - copied unchanged from r336203, head/contrib/wpa/src/crypto/sha384-internal.c stable/11/contrib/wpa/src/crypto/sha384_i.h - copied unchanged from r336203, head/contrib/wpa/src/crypto/sha384_i.h stable/11/contrib/wpa/src/crypto/sha512-internal.c - copied unchanged from r336203, head/contrib/wpa/src/crypto/sha512-internal.c stable/11/contrib/wpa/src/crypto/sha512_i.h - copied unchanged from r336203, head/contrib/wpa/src/crypto/sha512_i.h stable/11/contrib/wpa/src/crypto/tls_openssl.h - copied unchanged from r336203, head/contrib/wpa/src/crypto/tls_openssl.h stable/11/contrib/wpa/src/crypto/tls_openssl_ocsp.c - copied unchanged from r336203, head/contrib/wpa/src/crypto/tls_openssl_ocsp.c stable/11/contrib/wpa/src/tls/tlsv1_client_ocsp.c - copied unchanged from r336203, head/contrib/wpa/src/tls/tlsv1_client_ocsp.c stable/11/contrib/wpa/src/utils/module_tests.h - copied unchanged from r336203, head/contrib/wpa/src/utils/module_tests.h stable/11/contrib/wpa/wpa_supplicant/Android.mk - copied unchanged from r336203, head/contrib/wpa/wpa_supplicant/Android.mk stable/11/contrib/wpa/wpa_supplicant/README-Windows.txt - copied unchanged from r336203, head/contrib/wpa/wpa_supplicant/README-Windows.txt stable/11/contrib/wpa/wpa_supplicant/android.config - copied unchanged from r336203, head/contrib/wpa/wpa_supplicant/android.config stable/11/contrib/wpa/wpa_supplicant/binder/ - copied from r336203, head/contrib/wpa/wpa_supplicant/binder/ stable/11/contrib/wpa/wpa_supplicant/libwpa_test.c - copied unchanged from r336203, head/contrib/wpa/wpa_supplicant/libwpa_test.c stable/11/contrib/wpa/wpa_supplicant/mbo.c - copied unchanged from r336203, head/contrib/wpa/wpa_supplicant/mbo.c stable/11/contrib/wpa/wpa_supplicant/systemd/ - copied from r336203, head/contrib/wpa/wpa_supplicant/systemd/ stable/11/contrib/wpa/wpa_supplicant/vs2005/ - copied from r336203, head/contrib/wpa/wpa_supplicant/vs2005/ Deleted: stable/11/contrib/wpa/patches/openssl-0.9.8za-tls-extensions.patch stable/11/contrib/wpa/patches/openssl-0.9.8zf-tls-extensions.patch stable/11/contrib/wpa/wpa_supplicant/tests/link_test.c stable/11/contrib/wpa/wpa_supplicant/tests/test_eap_sim_common.c stable/11/contrib/wpa/wpa_supplicant/tests/test_wpa.c Modified: stable/11/contrib/wpa/CONTRIBUTIONS stable/11/contrib/wpa/COPYING stable/11/contrib/wpa/README stable/11/contrib/wpa/hostapd/ChangeLog stable/11/contrib/wpa/hostapd/README stable/11/contrib/wpa/hostapd/config_file.c stable/11/contrib/wpa/hostapd/ctrl_iface.c stable/11/contrib/wpa/hostapd/defconfig stable/11/contrib/wpa/hostapd/hapd_module_tests.c stable/11/contrib/wpa/hostapd/hlr_auc_gw.c stable/11/contrib/wpa/hostapd/hostapd.conf stable/11/contrib/wpa/hostapd/hostapd_cli.c stable/11/contrib/wpa/hostapd/main.c stable/11/contrib/wpa/hs20/client/Android.mk stable/11/contrib/wpa/hs20/client/Makefile stable/11/contrib/wpa/hs20/client/est.c stable/11/contrib/wpa/hs20/client/osu_client.c stable/11/contrib/wpa/src/ap/accounting.c stable/11/contrib/wpa/src/ap/accounting.h stable/11/contrib/wpa/src/ap/acs.c stable/11/contrib/wpa/src/ap/ap_config.c stable/11/contrib/wpa/src/ap/ap_config.h stable/11/contrib/wpa/src/ap/ap_drv_ops.c stable/11/contrib/wpa/src/ap/ap_drv_ops.h stable/11/contrib/wpa/src/ap/ap_mlme.c stable/11/contrib/wpa/src/ap/authsrv.c stable/11/contrib/wpa/src/ap/beacon.c stable/11/contrib/wpa/src/ap/beacon.h stable/11/contrib/wpa/src/ap/ctrl_iface_ap.c stable/11/contrib/wpa/src/ap/ctrl_iface_ap.h stable/11/contrib/wpa/src/ap/dfs.c stable/11/contrib/wpa/src/ap/dhcp_snoop.c stable/11/contrib/wpa/src/ap/drv_callbacks.c stable/11/contrib/wpa/src/ap/gas_serv.c stable/11/contrib/wpa/src/ap/gas_serv.h stable/11/contrib/wpa/src/ap/hostapd.c stable/11/contrib/wpa/src/ap/hostapd.h stable/11/contrib/wpa/src/ap/hw_features.c stable/11/contrib/wpa/src/ap/iapp.c stable/11/contrib/wpa/src/ap/ieee802_11.c stable/11/contrib/wpa/src/ap/ieee802_11.h stable/11/contrib/wpa/src/ap/ieee802_11_auth.c stable/11/contrib/wpa/src/ap/ieee802_11_auth.h stable/11/contrib/wpa/src/ap/ieee802_11_ht.c stable/11/contrib/wpa/src/ap/ieee802_11_shared.c stable/11/contrib/wpa/src/ap/ieee802_11_vht.c stable/11/contrib/wpa/src/ap/ieee802_1x.c stable/11/contrib/wpa/src/ap/ieee802_1x.h stable/11/contrib/wpa/src/ap/ndisc_snoop.c stable/11/contrib/wpa/src/ap/pmksa_cache_auth.c stable/11/contrib/wpa/src/ap/pmksa_cache_auth.h stable/11/contrib/wpa/src/ap/sta_info.c stable/11/contrib/wpa/src/ap/sta_info.h stable/11/contrib/wpa/src/ap/vlan_init.c stable/11/contrib/wpa/src/ap/vlan_init.h stable/11/contrib/wpa/src/ap/vlan_util.c stable/11/contrib/wpa/src/ap/vlan_util.h stable/11/contrib/wpa/src/ap/wnm_ap.c stable/11/contrib/wpa/src/ap/wnm_ap.h stable/11/contrib/wpa/src/ap/wpa_auth.c stable/11/contrib/wpa/src/ap/wpa_auth.h stable/11/contrib/wpa/src/ap/wpa_auth_ft.c stable/11/contrib/wpa/src/ap/wpa_auth_glue.c stable/11/contrib/wpa/src/ap/wpa_auth_i.h stable/11/contrib/wpa/src/ap/wpa_auth_ie.c stable/11/contrib/wpa/src/ap/wps_hostapd.c stable/11/contrib/wpa/src/common/common_module_tests.c stable/11/contrib/wpa/src/common/defs.h stable/11/contrib/wpa/src/common/eapol_common.h stable/11/contrib/wpa/src/common/ieee802_11_common.c stable/11/contrib/wpa/src/common/ieee802_11_common.h stable/11/contrib/wpa/src/common/ieee802_11_defs.h stable/11/contrib/wpa/src/common/ieee802_1x_defs.h stable/11/contrib/wpa/src/common/qca-vendor.h stable/11/contrib/wpa/src/common/sae.c stable/11/contrib/wpa/src/common/sae.h stable/11/contrib/wpa/src/common/version.h stable/11/contrib/wpa/src/common/wpa_common.c stable/11/contrib/wpa/src/common/wpa_common.h stable/11/contrib/wpa/src/common/wpa_ctrl.c stable/11/contrib/wpa/src/common/wpa_ctrl.h stable/11/contrib/wpa/src/common/wpa_helpers.c stable/11/contrib/wpa/src/crypto/aes-cbc.c stable/11/contrib/wpa/src/crypto/aes-omac1.c stable/11/contrib/wpa/src/crypto/crypto.h stable/11/contrib/wpa/src/crypto/crypto_internal.c stable/11/contrib/wpa/src/crypto/crypto_module_tests.c stable/11/contrib/wpa/src/crypto/crypto_openssl.c stable/11/contrib/wpa/src/crypto/dh_group5.c stable/11/contrib/wpa/src/crypto/dh_groups.c stable/11/contrib/wpa/src/crypto/fips_prf_openssl.c stable/11/contrib/wpa/src/crypto/md4-internal.c stable/11/contrib/wpa/src/crypto/md5-internal.c stable/11/contrib/wpa/src/crypto/ms_funcs.c stable/11/contrib/wpa/src/crypto/sha1-internal.c stable/11/contrib/wpa/src/crypto/sha256-internal.c stable/11/contrib/wpa/src/crypto/sha256-prf.c stable/11/contrib/wpa/src/crypto/sha256.h stable/11/contrib/wpa/src/crypto/tls.h stable/11/contrib/wpa/src/crypto/tls_gnutls.c stable/11/contrib/wpa/src/crypto/tls_internal.c stable/11/contrib/wpa/src/crypto/tls_none.c stable/11/contrib/wpa/src/crypto/tls_openssl.c stable/11/contrib/wpa/src/drivers/driver.h stable/11/contrib/wpa/src/drivers/driver_bsd.c stable/11/contrib/wpa/src/drivers/driver_common.c stable/11/contrib/wpa/src/drivers/driver_macsec_qca.c stable/11/contrib/wpa/src/drivers/driver_ndis.c stable/11/contrib/wpa/src/drivers/driver_nl80211.h stable/11/contrib/wpa/src/drivers/driver_nl80211_capa.c stable/11/contrib/wpa/src/drivers/driver_nl80211_event.c stable/11/contrib/wpa/src/drivers/driver_nl80211_monitor.c stable/11/contrib/wpa/src/drivers/driver_nl80211_scan.c stable/11/contrib/wpa/src/drivers/driver_privsep.c stable/11/contrib/wpa/src/drivers/driver_wired.c stable/11/contrib/wpa/src/drivers/drivers.c stable/11/contrib/wpa/src/eap_common/eap_eke_common.c stable/11/contrib/wpa/src/eap_common/eap_fast_common.c stable/11/contrib/wpa/src/eap_common/eap_fast_common.h stable/11/contrib/wpa/src/eap_common/eap_gpsk_common.c stable/11/contrib/wpa/src/eap_common/eap_pax_common.c stable/11/contrib/wpa/src/eap_common/eap_pwd_common.c stable/11/contrib/wpa/src/eap_common/eap_sake_common.c stable/11/contrib/wpa/src/eap_common/ikev2_common.c stable/11/contrib/wpa/src/eap_peer/eap.c stable/11/contrib/wpa/src/eap_peer/eap_aka.c stable/11/contrib/wpa/src/eap_peer/eap_config.h stable/11/contrib/wpa/src/eap_peer/eap_eke.c stable/11/contrib/wpa/src/eap_peer/eap_fast.c stable/11/contrib/wpa/src/eap_peer/eap_fast_pac.c stable/11/contrib/wpa/src/eap_peer/eap_gpsk.c stable/11/contrib/wpa/src/eap_peer/eap_gtc.c stable/11/contrib/wpa/src/eap_peer/eap_i.h stable/11/contrib/wpa/src/eap_peer/eap_ikev2.c stable/11/contrib/wpa/src/eap_peer/eap_leap.c stable/11/contrib/wpa/src/eap_peer/eap_md5.c stable/11/contrib/wpa/src/eap_peer/eap_methods.c stable/11/contrib/wpa/src/eap_peer/eap_methods.h stable/11/contrib/wpa/src/eap_peer/eap_mschapv2.c stable/11/contrib/wpa/src/eap_peer/eap_otp.c stable/11/contrib/wpa/src/eap_peer/eap_pax.c stable/11/contrib/wpa/src/eap_peer/eap_peap.c stable/11/contrib/wpa/src/eap_peer/eap_psk.c stable/11/contrib/wpa/src/eap_peer/eap_pwd.c stable/11/contrib/wpa/src/eap_peer/eap_sake.c stable/11/contrib/wpa/src/eap_peer/eap_sim.c stable/11/contrib/wpa/src/eap_peer/eap_tls.c stable/11/contrib/wpa/src/eap_peer/eap_tls_common.c stable/11/contrib/wpa/src/eap_peer/eap_tnc.c stable/11/contrib/wpa/src/eap_peer/eap_ttls.c stable/11/contrib/wpa/src/eap_peer/eap_vendor_test.c stable/11/contrib/wpa/src/eap_peer/eap_wsc.c stable/11/contrib/wpa/src/eap_peer/ikev2.c stable/11/contrib/wpa/src/eap_peer/tncc.c stable/11/contrib/wpa/src/eap_server/eap_methods.h stable/11/contrib/wpa/src/eap_server/eap_server_aka.c stable/11/contrib/wpa/src/eap_server/eap_server_eke.c stable/11/contrib/wpa/src/eap_server/eap_server_fast.c stable/11/contrib/wpa/src/eap_server/eap_server_gpsk.c stable/11/contrib/wpa/src/eap_server/eap_server_gtc.c stable/11/contrib/wpa/src/eap_server/eap_server_identity.c stable/11/contrib/wpa/src/eap_server/eap_server_ikev2.c stable/11/contrib/wpa/src/eap_server/eap_server_md5.c stable/11/contrib/wpa/src/eap_server/eap_server_methods.c stable/11/contrib/wpa/src/eap_server/eap_server_mschapv2.c stable/11/contrib/wpa/src/eap_server/eap_server_pax.c stable/11/contrib/wpa/src/eap_server/eap_server_peap.c stable/11/contrib/wpa/src/eap_server/eap_server_psk.c stable/11/contrib/wpa/src/eap_server/eap_server_pwd.c stable/11/contrib/wpa/src/eap_server/eap_server_sake.c stable/11/contrib/wpa/src/eap_server/eap_server_sim.c stable/11/contrib/wpa/src/eap_server/eap_server_tls.c stable/11/contrib/wpa/src/eap_server/eap_server_tls_common.c stable/11/contrib/wpa/src/eap_server/eap_server_tnc.c stable/11/contrib/wpa/src/eap_server/eap_server_ttls.c stable/11/contrib/wpa/src/eap_server/eap_server_vendor_test.c stable/11/contrib/wpa/src/eap_server/eap_server_wsc.c stable/11/contrib/wpa/src/eap_server/eap_sim_db.c stable/11/contrib/wpa/src/eap_server/eap_sim_db.h stable/11/contrib/wpa/src/eap_server/ikev2.c stable/11/contrib/wpa/src/eap_server/tncs.c stable/11/contrib/wpa/src/eapol_auth/eapol_auth_sm.c stable/11/contrib/wpa/src/eapol_auth/eapol_auth_sm_i.h stable/11/contrib/wpa/src/eapol_supp/eapol_supp_sm.c stable/11/contrib/wpa/src/fst/fst.c stable/11/contrib/wpa/src/fst/fst_ctrl_aux.c stable/11/contrib/wpa/src/fst/fst_ctrl_iface.c stable/11/contrib/wpa/src/fst/fst_defs.h stable/11/contrib/wpa/src/fst/fst_group.c stable/11/contrib/wpa/src/fst/fst_group.h stable/11/contrib/wpa/src/fst/fst_iface.c stable/11/contrib/wpa/src/fst/fst_iface.h stable/11/contrib/wpa/src/fst/fst_session.c stable/11/contrib/wpa/src/p2p/p2p.c stable/11/contrib/wpa/src/p2p/p2p.h stable/11/contrib/wpa/src/p2p/p2p_build.c stable/11/contrib/wpa/src/p2p/p2p_go_neg.c stable/11/contrib/wpa/src/p2p/p2p_group.c stable/11/contrib/wpa/src/p2p/p2p_i.h stable/11/contrib/wpa/src/p2p/p2p_invitation.c stable/11/contrib/wpa/src/p2p/p2p_parse.c stable/11/contrib/wpa/src/p2p/p2p_pd.c stable/11/contrib/wpa/src/p2p/p2p_sd.c stable/11/contrib/wpa/src/pae/ieee802_1x_cp.c stable/11/contrib/wpa/src/pae/ieee802_1x_cp.h stable/11/contrib/wpa/src/pae/ieee802_1x_kay.c stable/11/contrib/wpa/src/pae/ieee802_1x_kay.h stable/11/contrib/wpa/src/pae/ieee802_1x_kay_i.h stable/11/contrib/wpa/src/pae/ieee802_1x_secy_ops.c stable/11/contrib/wpa/src/pae/ieee802_1x_secy_ops.h stable/11/contrib/wpa/src/radius/radius.c stable/11/contrib/wpa/src/radius/radius.h stable/11/contrib/wpa/src/radius/radius_client.c stable/11/contrib/wpa/src/radius/radius_client.h stable/11/contrib/wpa/src/radius/radius_das.c stable/11/contrib/wpa/src/radius/radius_das.h stable/11/contrib/wpa/src/rsn_supp/pmksa_cache.c stable/11/contrib/wpa/src/rsn_supp/pmksa_cache.h stable/11/contrib/wpa/src/rsn_supp/preauth.c stable/11/contrib/wpa/src/rsn_supp/preauth.h stable/11/contrib/wpa/src/rsn_supp/tdls.c stable/11/contrib/wpa/src/rsn_supp/wpa.c stable/11/contrib/wpa/src/rsn_supp/wpa.h stable/11/contrib/wpa/src/rsn_supp/wpa_i.h stable/11/contrib/wpa/src/rsn_supp/wpa_ie.c stable/11/contrib/wpa/src/tls/asn1.h stable/11/contrib/wpa/src/tls/pkcs5.c stable/11/contrib/wpa/src/tls/tlsv1_client.c stable/11/contrib/wpa/src/tls/tlsv1_client.h stable/11/contrib/wpa/src/tls/tlsv1_client_i.h stable/11/contrib/wpa/src/tls/tlsv1_client_read.c stable/11/contrib/wpa/src/tls/tlsv1_client_write.c stable/11/contrib/wpa/src/tls/tlsv1_common.c stable/11/contrib/wpa/src/tls/tlsv1_common.h stable/11/contrib/wpa/src/tls/tlsv1_cred.c stable/11/contrib/wpa/src/tls/tlsv1_cred.h stable/11/contrib/wpa/src/tls/tlsv1_server_i.h stable/11/contrib/wpa/src/tls/tlsv1_server_read.c stable/11/contrib/wpa/src/tls/tlsv1_server_write.c stable/11/contrib/wpa/src/tls/x509v3.c stable/11/contrib/wpa/src/tls/x509v3.h stable/11/contrib/wpa/src/utils/browser-android.c stable/11/contrib/wpa/src/utils/common.c stable/11/contrib/wpa/src/utils/common.h stable/11/contrib/wpa/src/utils/edit_simple.c stable/11/contrib/wpa/src/utils/eloop.c stable/11/contrib/wpa/src/utils/eloop.h stable/11/contrib/wpa/src/utils/eloop_win.c stable/11/contrib/wpa/src/utils/ext_password.c stable/11/contrib/wpa/src/utils/ext_password_i.h stable/11/contrib/wpa/src/utils/http_curl.c stable/11/contrib/wpa/src/utils/os.h stable/11/contrib/wpa/src/utils/os_unix.c stable/11/contrib/wpa/src/utils/pcsc_funcs.c stable/11/contrib/wpa/src/utils/platform.h stable/11/contrib/wpa/src/utils/radiotap.c stable/11/contrib/wpa/src/utils/radiotap.h stable/11/contrib/wpa/src/utils/radiotap_iter.h stable/11/contrib/wpa/src/utils/trace.c stable/11/contrib/wpa/src/utils/trace.h stable/11/contrib/wpa/src/utils/utils_module_tests.c stable/11/contrib/wpa/src/utils/wpa_debug.c stable/11/contrib/wpa/src/utils/wpabuf.c stable/11/contrib/wpa/src/utils/wpabuf.h stable/11/contrib/wpa/src/utils/xml_libxml2.c stable/11/contrib/wpa/src/wps/wps.c stable/11/contrib/wpa/src/wps/wps.h stable/11/contrib/wpa/src/wps/wps_attr_build.c stable/11/contrib/wpa/src/wps/wps_attr_parse.c stable/11/contrib/wpa/src/wps/wps_attr_process.c stable/11/contrib/wpa/src/wps/wps_common.c stable/11/contrib/wpa/src/wps/wps_defs.h stable/11/contrib/wpa/src/wps/wps_enrollee.c stable/11/contrib/wpa/src/wps/wps_i.h stable/11/contrib/wpa/src/wps/wps_module_tests.c stable/11/contrib/wpa/src/wps/wps_registrar.c stable/11/contrib/wpa/src/wps/wps_upnp.c stable/11/contrib/wpa/src/wps/wps_upnp.h stable/11/contrib/wpa/src/wps/wps_upnp_i.h stable/11/contrib/wpa/src/wps/wps_upnp_ssdp.c stable/11/contrib/wpa/src/wps/wps_upnp_web.c stable/11/contrib/wpa/wpa_supplicant/ChangeLog stable/11/contrib/wpa/wpa_supplicant/README stable/11/contrib/wpa/wpa_supplicant/README-HS20 stable/11/contrib/wpa/wpa_supplicant/README-P2P stable/11/contrib/wpa/wpa_supplicant/ap.c stable/11/contrib/wpa/wpa_supplicant/ap.h stable/11/contrib/wpa/wpa_supplicant/autoscan.c stable/11/contrib/wpa/wpa_supplicant/autoscan.h stable/11/contrib/wpa/wpa_supplicant/bgscan.c stable/11/contrib/wpa/wpa_supplicant/bgscan.h stable/11/contrib/wpa/wpa_supplicant/bss.c stable/11/contrib/wpa/wpa_supplicant/bss.h stable/11/contrib/wpa/wpa_supplicant/config.c stable/11/contrib/wpa/wpa_supplicant/config.h stable/11/contrib/wpa/wpa_supplicant/config_file.c stable/11/contrib/wpa/wpa_supplicant/config_ssid.h stable/11/contrib/wpa/wpa_supplicant/ctrl_iface.c stable/11/contrib/wpa/wpa_supplicant/ctrl_iface_udp.c stable/11/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus-wpa_supplicant.conf stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_common_i.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_dict_helpers.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_dict_helpers.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_wps.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_helpers.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_helpers.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_introspect.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.c stable/11/contrib/wpa/wpa_supplicant/defconfig stable/11/contrib/wpa/wpa_supplicant/driver_i.h stable/11/contrib/wpa/wpa_supplicant/eapol_test.c stable/11/contrib/wpa/wpa_supplicant/events.c stable/11/contrib/wpa/wpa_supplicant/gas_query.c stable/11/contrib/wpa/wpa_supplicant/gas_query.h stable/11/contrib/wpa/wpa_supplicant/hs20_supplicant.c stable/11/contrib/wpa/wpa_supplicant/hs20_supplicant.h stable/11/contrib/wpa/wpa_supplicant/ibss_rsn.c stable/11/contrib/wpa/wpa_supplicant/ibss_rsn.h stable/11/contrib/wpa/wpa_supplicant/interworking.c stable/11/contrib/wpa/wpa_supplicant/interworking.h stable/11/contrib/wpa/wpa_supplicant/main.c stable/11/contrib/wpa/wpa_supplicant/mesh.c stable/11/contrib/wpa/wpa_supplicant/mesh.h stable/11/contrib/wpa/wpa_supplicant/mesh_mpm.c stable/11/contrib/wpa/wpa_supplicant/mesh_mpm.h stable/11/contrib/wpa/wpa_supplicant/mesh_rsn.c stable/11/contrib/wpa/wpa_supplicant/mesh_rsn.h stable/11/contrib/wpa/wpa_supplicant/notify.c stable/11/contrib/wpa/wpa_supplicant/notify.h stable/11/contrib/wpa/wpa_supplicant/offchannel.c stable/11/contrib/wpa/wpa_supplicant/p2p_supplicant.c stable/11/contrib/wpa/wpa_supplicant/p2p_supplicant.h stable/11/contrib/wpa/wpa_supplicant/p2p_supplicant_sd.c stable/11/contrib/wpa/wpa_supplicant/scan.c stable/11/contrib/wpa/wpa_supplicant/scan.h stable/11/contrib/wpa/wpa_supplicant/sme.c stable/11/contrib/wpa/wpa_supplicant/wmm_ac.h stable/11/contrib/wpa/wpa_supplicant/wnm_sta.c stable/11/contrib/wpa/wpa_supplicant/wnm_sta.h stable/11/contrib/wpa/wpa_supplicant/wpa_cli.c stable/11/contrib/wpa/wpa_supplicant/wpa_priv.c stable/11/contrib/wpa/wpa_supplicant/wpa_supplicant.c stable/11/contrib/wpa/wpa_supplicant/wpa_supplicant.conf stable/11/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h stable/11/contrib/wpa/wpa_supplicant/wpas_glue.c stable/11/contrib/wpa/wpa_supplicant/wpas_kay.c stable/11/contrib/wpa/wpa_supplicant/wpas_module_tests.c stable/11/contrib/wpa/wpa_supplicant/wps_supplicant.c stable/11/contrib/wpa/wpa_supplicant/wps_supplicant.h stable/11/usr.sbin/wpa/Makefile.inc stable/11/usr.sbin/wpa/hostapd/Makefile stable/11/usr.sbin/wpa/hostapd_cli/Makefile stable/11/usr.sbin/wpa/wpa_cli/Makefile stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/wpa/CONTRIBUTIONS ============================================================================== --- stable/11/contrib/wpa/CONTRIBUTIONS Tue Aug 14 19:44:36 2018 (r337816) +++ stable/11/contrib/wpa/CONTRIBUTIONS Tue Aug 14 20:02:01 2018 (r337817) @@ -29,6 +29,34 @@ using your real name. Pseudonyms or anonymous contribu unfortunately be accepted. +The preferred method of submitting the contribution to the project is by +email to the hostap mailing list: +hostap@lists.infradead.org +Note that the list may require subscription before accepting message +without moderation. You can subscribe to the list at this address: +http://lists.infradead.org/mailman/listinfo/hostap + +The message should contain an inlined patch against the current +development branch (i.e., the master branch of +git://w1.fi/hostap.git). Please make sure the software you use for +sending the patch does not corrupt whitespace. If that cannot be fixed +for some reason, it is better to include an attached version of the +patch file than just send a whitespace damaged version in the message +body. + +The patches should be separate logical changes rather than doing +everything in a single patch. In other words, please keep cleanup, new +features, and bug fixes all in their own patches. Each patch needs a +commit log that describes the changes (what the changes fix, what +functionality is added, why the changes are useful, etc.). + +Please try to follow the coding style used in the project. + +In general, the best way of generating a suitable formatted patch file +is by committing the changes to a cloned git repository and using git +format-patch. The patch can then be sent, e.g., with git send-email. + + History of license and contributions terms ------------------------------------------ @@ -112,7 +140,7 @@ The license terms used for hostap.git files Modified BSD license (no advertisement clause): -Copyright (c) 2002-2015, Jouni Malinen and contributors +Copyright (c) 2002-2016, Jouni Malinen and contributors All Rights Reserved. Redistribution and use in source and binary forms, with or without Modified: stable/11/contrib/wpa/COPYING ============================================================================== --- stable/11/contrib/wpa/COPYING Tue Aug 14 19:44:36 2018 (r337816) +++ stable/11/contrib/wpa/COPYING Tue Aug 14 20:02:01 2018 (r337817) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2015, Jouni Malinen and contributors +Copyright (c) 2002-2016, Jouni Malinen and contributors All Rights Reserved. Modified: stable/11/contrib/wpa/README ============================================================================== --- stable/11/contrib/wpa/README Tue Aug 14 19:44:36 2018 (r337816) +++ stable/11/contrib/wpa/README Tue Aug 14 20:02:01 2018 (r337817) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2015, Jouni Malinen and contributors +Copyright (c) 2002-2016, Jouni Malinen and contributors All Rights Reserved. These programs are licensed under the BSD license (the one with Modified: stable/11/contrib/wpa/hostapd/ChangeLog ============================================================================== --- stable/11/contrib/wpa/hostapd/ChangeLog Tue Aug 14 19:44:36 2018 (r337816) +++ stable/11/contrib/wpa/hostapd/ChangeLog Tue Aug 14 20:02:01 2018 (r337817) @@ -1,5 +1,78 @@ ChangeLog for hostapd +2016-10-02 - v2.6 + * fixed EAP-pwd last fragment validation + [http://w1.fi/security/2015-7/] (CVE-2015-5314) + * fixed WPS configuration update vulnerability with malformed passphrase + [http://w1.fi/security/2016-1/] (CVE-2016-4476) + * extended channel switch support for VHT bandwidth changes + * added support for configuring new ANQP-elements with + anqp_elem=: + * fixed Suite B 192-bit AKM to use proper PMK length + (note: this makes old releases incompatible with the fixed behavior) + * added no_probe_resp_if_max_sta=1 parameter to disable Probe Response + frame sending for not-associated STAs if max_num_sta limit has been + reached + * added option (-S as command line argument) to request all interfaces + to be started at the same time + * modified rts_threshold and fragm_threshold configuration parameters + to allow -1 to be used to disable RTS/fragmentation + * EAP-pwd: added support for Brainpool Elliptic Curves + (with OpenSSL 1.0.2 and newer) + * fixed EAPOL reauthentication after FT protocol run + * fixed FTIE generation for 4-way handshake after FT protocol run + * fixed and improved various FST operations + * TLS server + - support SHA384 and SHA512 hashes + - support TLS v1.2 signature algorithm with SHA384 and SHA512 + - support PKCS #5 v2.0 PBES2 + - support PKCS #5 with PKCS #12 style key decryption + - minimal support for PKCS #12 + - support OCSP stapling (including ocsp_multi) + * added support for OpenSSL 1.1 API changes + - drop support for OpenSSL 0.9.8 + - drop support for OpenSSL 1.0.0 + * EAP-PEAP: support fast-connect crypto binding + * RADIUS + - fix Called-Station-Id to not escape SSID + - add Event-Timestamp to all Accounting-Request packets + - add Acct-Session-Id to Accounting-On/Off + - add Acct-Multi-Session-Id ton Access-Request packets + - add Service-Type (= Frames) + - allow server to provide PSK instead of passphrase for WPA-PSK + Tunnel_password case + - update full message for interim accounting updates + - add Acct-Delay-Time into Accounting messages + - add require_message_authenticator configuration option to require + CoA/Disconnect-Request packets to be authenticated + * started to postpone WNM-Notification frame sending by 100 ms so that + the STA has some more time to configure the key before this frame is + received after the 4-way handshake + * VHT: added interoperability workaround for 80+80 and 160 MHz channels + * extended VLAN support (per-STA vif, etc.) + * fixed PMKID derivation with SAE + * nl80211 + - added support for full station state operations + - fix IEEE 802.1X/WEP EAP reauthentication and rekeying to use + unencrypted EAPOL frames + * added initial MBO support; number of extensions to WNM BSS Transition + Management + * added initial functionality for location related operations + * added assocresp_elements parameter to allow vendor specific elements + to be added into (Re)Association Response frames + * improved Public Action frame addressing + - use Address 3 = wildcard BSSID in GAS response if a query from an + unassociated STA used that address + - fix TX status processing for Address 3 = wildcard BSSID + - add gas_address3 configuration parameter to control Address 3 + behavior + * added command line parameter -i to override interface parameter in + hostapd.conf + * added command completion support to hostapd_cli + * added passive client taxonomy determination (CONFIG_TAXONOMY=y + compile option and "SIGNATURE " control interface command) + * number of small fixes + 2015-09-27 - v2.5 * fixed WPS UPnP vulnerability with HTTP chunked transfer encoding [http://w1.fi/security/2015-2/] (CVE-2015-4141) Modified: stable/11/contrib/wpa/hostapd/README ============================================================================== --- stable/11/contrib/wpa/hostapd/README Tue Aug 14 19:44:36 2018 (r337816) +++ stable/11/contrib/wpa/hostapd/README Tue Aug 14 20:02:01 2018 (r337817) @@ -2,7 +2,7 @@ hostapd - user space IEEE 802.11 AP and IEEE 802.1X/WP Authenticator and RADIUS authentication server ================================================================ -Copyright (c) 2002-2015, Jouni Malinen and contributors +Copyright (c) 2002-2016, Jouni Malinen and contributors All Rights Reserved. This program is licensed under the BSD license (the one with Modified: stable/11/contrib/wpa/hostapd/config_file.c ============================================================================== --- stable/11/contrib/wpa/hostapd/config_file.c Tue Aug 14 19:44:36 2018 (r337816) +++ stable/11/contrib/wpa/hostapd/config_file.c Tue Aug 14 20:02:01 2018 (r337817) @@ -97,6 +97,8 @@ static int hostapd_config_read_vlan_file(struct hostap } vlan->vlan_id = vlan_id; + vlan->vlan_desc.untagged = vlan_id; + vlan->vlan_desc.notempty = !!vlan_id; os_strlcpy(vlan->ifname, pos, sizeof(vlan->ifname)); vlan->next = bss->vlan; bss->vlan = vlan; @@ -197,7 +199,10 @@ static int hostapd_config_read_maclist(const char *fna *acl = newacl; os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); - (*acl)[*num].vlan_id = vlan_id; + os_memset(&(*acl)[*num].vlan_id, 0, + sizeof((*acl)[*num].vlan_id)); + (*acl)[*num].vlan_id.untagged = vlan_id; + (*acl)[*num].vlan_id.notempty = !!vlan_id; (*num)++; } @@ -631,8 +636,7 @@ hostapd_parse_radius_attr(const char *value) } -static int hostapd_parse_das_client(struct hostapd_bss_config *bss, - const char *val) +static int hostapd_parse_das_client(struct hostapd_bss_config *bss, char *val) { char *secret; @@ -640,7 +644,7 @@ static int hostapd_parse_das_client(struct hostapd_bss if (secret == NULL) return -1; - secret++; + *secret++ = '\0'; if (hostapd_parse_ip_addr(val, &bss->radius_das_client_addr)) return -1; @@ -1519,6 +1523,54 @@ fail: } +static int parse_anqp_elem(struct hostapd_bss_config *bss, char *buf, int line) +{ + char *delim; + u16 infoid; + size_t len; + struct wpabuf *payload; + struct anqp_element *elem; + + delim = os_strchr(buf, ':'); + if (!delim) + return -1; + delim++; + infoid = atoi(buf); + len = os_strlen(delim); + if (len & 1) + return -1; + len /= 2; + payload = wpabuf_alloc(len); + if (!payload) + return -1; + if (hexstr2bin(delim, wpabuf_put(payload, len), len) < 0) { + wpabuf_free(payload); + return -1; + } + + dl_list_for_each(elem, &bss->anqp_elem, struct anqp_element, list) { + if (elem->infoid == infoid) { + /* Update existing entry */ + wpabuf_free(elem->payload); + elem->payload = payload; + return 0; + } + } + + /* Add a new entry */ + elem = os_zalloc(sizeof(*elem)); + if (!elem) { + wpabuf_free(payload); + return -1; + } + elem->infoid = infoid; + elem->payload = payload; + dl_list_add(&bss->anqp_elem, &elem->list); + + return 0; +} + + static int parse_qos_map_set(struct hostapd_bss_config *bss, char *buf, int line) { @@ -1867,31 +1919,6 @@ static int hs20_parse_osu_service_desc(struct hostapd_ #endif /* CONFIG_HS20 */ -#ifdef CONFIG_WPS_NFC -static struct wpabuf * hostapd_parse_bin(const char *buf) -{ - size_t len; - struct wpabuf *ret; - - len = os_strlen(buf); - if (len & 0x01) - return NULL; - len /= 2; - - ret = wpabuf_alloc(len); - if (ret == NULL) - return NULL; - - if (hexstr2bin(buf, wpabuf_put(ret, len), len)) { - wpabuf_free(ret); - return NULL; - } - - return ret; -} -#endif /* CONFIG_WPS_NFC */ - - #ifdef CONFIG_ACS static int hostapd_config_parse_acs_chan_bias(struct hostapd_config *conf, char *pos) @@ -1934,6 +1961,31 @@ fail: #endif /* CONFIG_ACS */ +static int parse_wpabuf_hex(int line, const char *name, struct wpabuf **buf, + const char *val) +{ + struct wpabuf *elems; + + if (val[0] == '\0') { + wpabuf_free(*buf); + *buf = NULL; + return 0; + } + + elems = wpabuf_parse_bin(val); + if (!elems) { + wpa_printf(MSG_ERROR, "Line %d: Invalid %s '%s'", + line, name, val); + return -1; + } + + wpabuf_free(*buf); + *buf = elems; + + return 0; +} + + static int hostapd_config_fill(struct hostapd_config *conf, struct hostapd_bss_config *bss, const char *buf, char *pos, int line) @@ -2084,6 +2136,9 @@ static int hostapd_config_fill(struct hostapd_config * } else if (os_strcmp(buf, "ocsp_stapling_response") == 0) { os_free(bss->ocsp_stapling_response); bss->ocsp_stapling_response = os_strdup(pos); + } else if (os_strcmp(buf, "ocsp_stapling_response_multi") == 0) { + os_free(bss->ocsp_stapling_response_multi); + bss->ocsp_stapling_response_multi = os_strdup(pos); } else if (os_strcmp(buf, "dh_file") == 0) { os_free(bss->dh_file); bss->dh_file = os_strdup(pos); @@ -2139,6 +2194,8 @@ static int hostapd_config_fill(struct hostapd_config * } else if (os_strcmp(buf, "eap_sim_db") == 0) { os_free(bss->eap_sim_db); bss->eap_sim_db = os_strdup(pos); + } else if (os_strcmp(buf, "eap_sim_db_timeout") == 0) { + bss->eap_sim_db_timeout = atoi(pos); } else if (os_strcmp(buf, "eap_sim_aka_result_ind") == 0) { bss->eap_sim_aka_result_ind = atoi(pos); #endif /* EAP_SERVER_SIM */ @@ -2353,6 +2410,9 @@ static int hostapd_config_fill(struct hostapd_config * bss->radius_das_time_window = atoi(pos); } else if (os_strcmp(buf, "radius_das_require_event_timestamp") == 0) { bss->radius_das_require_event_timestamp = atoi(pos); + } else if (os_strcmp(buf, "radius_das_require_message_authenticator") == + 0) { + bss->radius_das_require_message_authenticator = atoi(pos); #endif /* CONFIG_NO_RADIUS */ } else if (os_strcmp(buf, "auth_algs") == 0) { bss->auth_algs = atoi(pos); @@ -2644,7 +2704,7 @@ static int hostapd_config_fill(struct hostapd_config * } } else if (os_strcmp(buf, "rts_threshold") == 0) { conf->rts_threshold = atoi(pos); - if (conf->rts_threshold < 0 || conf->rts_threshold > 2347) { + if (conf->rts_threshold < -1 || conf->rts_threshold > 65535) { wpa_printf(MSG_ERROR, "Line %d: invalid rts_threshold %d", line, conf->rts_threshold); @@ -2652,8 +2712,10 @@ static int hostapd_config_fill(struct hostapd_config * } } else if (os_strcmp(buf, "fragm_threshold") == 0) { conf->fragm_threshold = atoi(pos); - if (conf->fragm_threshold < 256 || - conf->fragm_threshold > 2346) { + if (conf->fragm_threshold == -1) { + /* allow a value of -1 */ + } else if (conf->fragm_threshold < 256 || + conf->fragm_threshold > 2346) { wpa_printf(MSG_ERROR, "Line %d: invalid fragm_threshold %d", line, conf->fragm_threshold); @@ -2686,6 +2748,8 @@ static int hostapd_config_fill(struct hostapd_config * conf->preamble = LONG_PREAMBLE; } else if (os_strcmp(buf, "ignore_broadcast_ssid") == 0) { bss->ignore_broadcast_ssid = atoi(pos); + } else if (os_strcmp(buf, "no_probe_resp_if_max_sta") == 0) { + bss->no_probe_resp_if_max_sta = atoi(pos); } else if (os_strcmp(buf, "wep_default_key") == 0) { bss->ssid.wep.idx = atoi(pos); if (bss->ssid.wep.idx > 3) { @@ -2707,6 +2771,8 @@ static int hostapd_config_fill(struct hostapd_config * #ifndef CONFIG_NO_VLAN } else if (os_strcmp(buf, "dynamic_vlan") == 0) { bss->ssid.dynamic_vlan = atoi(pos); + } else if (os_strcmp(buf, "per_sta_vif") == 0) { + bss->ssid.per_sta_vif = atoi(pos); } else if (os_strcmp(buf, "vlan_file") == 0) { if (hostapd_config_read_vlan_file(bss, pos)) { wpa_printf(MSG_ERROR, "Line %d: failed to read VLAN file '%s'", @@ -2762,6 +2828,8 @@ static int hostapd_config_fill(struct hostapd_config * line); return 1; } + } else if (os_strcmp(buf, "use_driver_iface_addr") == 0) { + conf->use_driver_iface_addr = atoi(pos); #ifdef CONFIG_IEEE80211W } else if (os_strcmp(buf, "ieee80211w") == 0) { bss->ieee80211w = atoi(pos); @@ -2827,6 +2895,8 @@ static int hostapd_config_fill(struct hostapd_config * conf->vht_oper_centr_freq_seg1_idx = atoi(pos); } else if (os_strcmp(buf, "vendor_vht") == 0) { bss->vendor_vht = atoi(pos); + } else if (os_strcmp(buf, "use_sta_nsts") == 0) { + bss->use_sta_nsts = atoi(pos); #endif /* CONFIG_IEEE80211AC */ } else if (os_strcmp(buf, "max_listen_interval") == 0) { bss->max_listen_interval = atoi(pos); @@ -2965,15 +3035,15 @@ static int hostapd_config_fill(struct hostapd_config * bss->wps_nfc_pw_from_config = 1; } else if (os_strcmp(buf, "wps_nfc_dh_pubkey") == 0) { wpabuf_free(bss->wps_nfc_dh_pubkey); - bss->wps_nfc_dh_pubkey = hostapd_parse_bin(pos); + bss->wps_nfc_dh_pubkey = wpabuf_parse_bin(pos); bss->wps_nfc_pw_from_config = 1; } else if (os_strcmp(buf, "wps_nfc_dh_privkey") == 0) { wpabuf_free(bss->wps_nfc_dh_privkey); - bss->wps_nfc_dh_privkey = hostapd_parse_bin(pos); + bss->wps_nfc_dh_privkey = wpabuf_parse_bin(pos); bss->wps_nfc_pw_from_config = 1; } else if (os_strcmp(buf, "wps_nfc_dev_pw") == 0) { wpabuf_free(bss->wps_nfc_dev_pw); - bss->wps_nfc_dev_pw = hostapd_parse_bin(pos); + bss->wps_nfc_dev_pw = wpabuf_parse_bin(pos); bss->wps_nfc_pw_from_config = 1; #endif /* CONFIG_WPS_NFC */ #endif /* CONFIG_WPS */ @@ -3136,6 +3206,9 @@ static int hostapd_config_fill(struct hostapd_config * } else if (os_strcmp(buf, "nai_realm") == 0) { if (parse_nai_realm(bss, pos, line) < 0) return 1; + } else if (os_strcmp(buf, "anqp_elem") == 0) { + if (parse_anqp_elem(bss, pos, line) < 0) + return 1; } else if (os_strcmp(buf, "gas_frag_limit") == 0) { bss->gas_frag_limit = atoi(pos); } else if (os_strcmp(buf, "gas_comeback_delay") == 0) { @@ -3149,13 +3222,15 @@ static int hostapd_config_fill(struct hostapd_config * os_free(bss->dump_msk_file); bss->dump_msk_file = os_strdup(pos); #endif /* CONFIG_RADIUS_TEST */ +#ifdef CONFIG_PROXYARP + } else if (os_strcmp(buf, "proxy_arp") == 0) { + bss->proxy_arp = atoi(pos); +#endif /* CONFIG_PROXYARP */ #ifdef CONFIG_HS20 } else if (os_strcmp(buf, "hs20") == 0) { bss->hs20 = atoi(pos); } else if (os_strcmp(buf, "disable_dgaf") == 0) { bss->disable_dgaf = atoi(pos); - } else if (os_strcmp(buf, "proxy_arp") == 0) { - bss->proxy_arp = atoi(pos); } else if (os_strcmp(buf, "na_mcast_to_ucast") == 0) { bss->na_mcast_to_ucast = atoi(pos); } else if (os_strcmp(buf, "osen") == 0) { @@ -3231,6 +3306,10 @@ static int hostapd_config_fill(struct hostapd_config * } else if (os_strcmp(buf, "subscr_remediation_method") == 0) { bss->subscr_remediation_method = atoi(pos); #endif /* CONFIG_HS20 */ +#ifdef CONFIG_MBO + } else if (os_strcmp(buf, "mbo") == 0) { + bss->mbo_enabled = atoi(pos); +#endif /* CONFIG_MBO */ #ifdef CONFIG_TESTING_OPTIONS #define PARSE_TEST_PROBABILITY(_val) \ } else if (os_strcmp(buf, #_val) == 0) { \ @@ -3249,6 +3328,8 @@ static int hostapd_config_fill(struct hostapd_config * PARSE_TEST_PROBABILITY(ignore_assoc_probability) PARSE_TEST_PROBABILITY(ignore_reassoc_probability) PARSE_TEST_PROBABILITY(corrupt_gtk_rekey_mic_probability) + } else if (os_strcmp(buf, "ecsa_ie_only") == 0) { + conf->ecsa_ie_only = atoi(pos); } else if (os_strcmp(buf, "bss_load_test") == 0) { WPA_PUT_LE16(bss->bss_load_test, atoi(pos)); pos = os_strchr(pos, ':'); @@ -3269,7 +3350,15 @@ static int hostapd_config_fill(struct hostapd_config * WPA_PUT_LE16(&bss->bss_load_test[3], atoi(pos)); bss->bss_load_test_set = 1; } else if (os_strcmp(buf, "radio_measurements") == 0) { - bss->radio_measurements = atoi(pos); + /* + * DEPRECATED: This parameter will be removed in the future. + * Use rrm_neighbor_report instead. + */ + int val = atoi(pos); + + if (val & BIT(0)) + bss->radio_measurements[0] |= + WLAN_RRM_CAPS_NEIGHBOR_REPORT; } else if (os_strcmp(buf, "own_ie_override") == 0) { struct wpabuf *tmp; size_t len = os_strlen(pos) / 2; @@ -3290,35 +3379,11 @@ static int hostapd_config_fill(struct hostapd_config * bss->own_ie_override = tmp; #endif /* CONFIG_TESTING_OPTIONS */ } else if (os_strcmp(buf, "vendor_elements") == 0) { - struct wpabuf *elems; - size_t len = os_strlen(pos); - if (len & 0x01) { - wpa_printf(MSG_ERROR, - "Line %d: Invalid vendor_elements '%s'", - line, pos); + if (parse_wpabuf_hex(line, buf, &bss->vendor_elements, pos)) return 1; - } - len /= 2; - if (len == 0) { - wpabuf_free(bss->vendor_elements); - bss->vendor_elements = NULL; - return 0; - } - - elems = wpabuf_alloc(len); - if (elems == NULL) + } else if (os_strcmp(buf, "assocresp_elements") == 0) { + if (parse_wpabuf_hex(line, buf, &bss->assocresp_elements, pos)) return 1; - - if (hexstr2bin(pos, wpabuf_put(elems, len), len)) { - wpabuf_free(elems); - wpa_printf(MSG_ERROR, - "Line %d: Invalid vendor_elements '%s'", - line, pos); - return 1; - } - - wpabuf_free(bss->vendor_elements); - bss->vendor_elements = elems; } else if (os_strcmp(buf, "sae_anti_clogging_threshold") == 0) { bss->sae_anti_clogging_threshold = atoi(pos); } else if (os_strcmp(buf, "sae_groups") == 0) { @@ -3391,7 +3456,8 @@ static int hostapd_config_fill(struct hostapd_config * return -1; } val = strtol(pos, &endp, 0); - if (*endp || val < 1 || val > FST_MAX_LLT_MS) { + if (*endp || val < 1 || + (unsigned long int) val > FST_MAX_LLT_MS) { wpa_printf(MSG_ERROR, "Line %d: Invalid fst_llt %ld (%s) (expected 1..%u)", line, val, pos, FST_MAX_LLT_MS); @@ -3409,6 +3475,22 @@ static int hostapd_config_fill(struct hostapd_config * } else if (os_strcmp(buf, "no_auth_if_seen_on") == 0) { os_free(bss->no_auth_if_seen_on); bss->no_auth_if_seen_on = os_strdup(pos); + } else if (os_strcmp(buf, "lci") == 0) { + wpabuf_free(conf->lci); + conf->lci = wpabuf_parse_bin(pos); + } else if (os_strcmp(buf, "civic") == 0) { + wpabuf_free(conf->civic); + conf->civic = wpabuf_parse_bin(pos); + } else if (os_strcmp(buf, "rrm_neighbor_report") == 0) { + if (atoi(pos)) + bss->radio_measurements[0] |= + WLAN_RRM_CAPS_NEIGHBOR_REPORT; + } else if (os_strcmp(buf, "gas_address3") == 0) { + bss->gas_address3 = atoi(pos); + } else if (os_strcmp(buf, "ftm_responder") == 0) { + bss->ftm_responder = atoi(pos); + } else if (os_strcmp(buf, "ftm_initiator") == 0) { + bss->ftm_initiator = atoi(pos); } else { wpa_printf(MSG_ERROR, "Line %d: unknown configuration item '%s'", @@ -3429,7 +3511,7 @@ struct hostapd_config * hostapd_config_read(const char { struct hostapd_config *conf; FILE *f; - char buf[512], *pos; + char buf[4096], *pos; int line = 0; int errors = 0; size_t i; Modified: stable/11/contrib/wpa/hostapd/ctrl_iface.c ============================================================================== --- stable/11/contrib/wpa/hostapd/ctrl_iface.c Tue Aug 14 19:44:36 2018 (r337816) +++ stable/11/contrib/wpa/hostapd/ctrl_iface.c Tue Aug 14 20:02:01 2018 (r337817) @@ -19,10 +19,16 @@ #include #include +#ifdef CONFIG_CTRL_IFACE_UDP +#include +#endif /* CONFIG_CTRL_IFACE_UDP */ + #include "utils/common.h" #include "utils/eloop.h" +#include "utils/module_tests.h" #include "common/version.h" #include "common/ieee802_11_defs.h" +#include "common/ctrl_iface_common.h" #include "crypto/tls.h" #include "drivers/driver.h" #include "eapol_auth/eapol_auth_sm.h" @@ -42,6 +48,8 @@ #include "ap/wnm_ap.h" #include "ap/wpa_auth.h" #include "ap/beacon.h" +#include "ap/neighbor_db.h" +#include "ap/rrm.h" #include "wps/wps_defs.h" #include "wps/wps.h" #include "fst/fst_ctrl_iface.h" @@ -51,96 +59,43 @@ #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 -struct wpa_ctrl_dst { - struct wpa_ctrl_dst *next; - struct sockaddr_un addr; - socklen_t addrlen; - int debug_level; - int errors; -}; +#ifdef CONFIG_CTRL_IFACE_UDP +#define COOKIE_LEN 8 +static unsigned char cookie[COOKIE_LEN]; +static unsigned char gcookie[COOKIE_LEN]; +#define HOSTAPD_CTRL_IFACE_PORT 8877 +#define HOSTAPD_CTRL_IFACE_PORT_LIMIT 50 +#define HOSTAPD_GLOBAL_CTRL_IFACE_PORT 8878 +#define HOSTAPD_GLOBAL_CTRL_IFACE_PORT_LIMIT 50 +#endif /* CONFIG_CTRL_IFACE_UDP */ - static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level, enum wpa_msg_type type, const char *buf, size_t len); static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd, - struct sockaddr_un *from, + struct sockaddr_storage *from, socklen_t fromlen) { - struct wpa_ctrl_dst *dst; - - dst = os_zalloc(sizeof(*dst)); - if (dst == NULL) - return -1; - os_memcpy(&dst->addr, from, sizeof(struct sockaddr_un)); - dst->addrlen = fromlen; - dst->debug_level = MSG_INFO; - dst->next = hapd->ctrl_dst; - hapd->ctrl_dst = dst; - wpa_hexdump(MSG_DEBUG, "CTRL_IFACE monitor attached", - (u8 *) from->sun_path, - fromlen - offsetof(struct sockaddr_un, sun_path)); - return 0; + return ctrl_iface_attach(&hapd->ctrl_dst, from, fromlen); } static int hostapd_ctrl_iface_detach(struct hostapd_data *hapd, - struct sockaddr_un *from, + struct sockaddr_storage *from, socklen_t fromlen) { - struct wpa_ctrl_dst *dst, *prev = NULL; - - dst = hapd->ctrl_dst; - while (dst) { - if (fromlen == dst->addrlen && - os_memcmp(from->sun_path, dst->addr.sun_path, - fromlen - offsetof(struct sockaddr_un, sun_path)) - == 0) { - wpa_hexdump(MSG_DEBUG, "CTRL_IFACE monitor detached", - (u8 *) from->sun_path, - fromlen - - offsetof(struct sockaddr_un, sun_path)); - if (prev == NULL) - hapd->ctrl_dst = dst->next; - else - prev->next = dst->next; - os_free(dst); - return 0; - } - prev = dst; - dst = dst->next; - } - return -1; + return ctrl_iface_detach(&hapd->ctrl_dst, from, fromlen); } static int hostapd_ctrl_iface_level(struct hostapd_data *hapd, - struct sockaddr_un *from, + struct sockaddr_storage *from, socklen_t fromlen, char *level) { - struct wpa_ctrl_dst *dst; - - wpa_printf(MSG_DEBUG, "CTRL_IFACE LEVEL %s", level); - - dst = hapd->ctrl_dst; - while (dst) { - if (fromlen == dst->addrlen && - os_memcmp(from->sun_path, dst->addr.sun_path, - fromlen - offsetof(struct sockaddr_un, sun_path)) - == 0) { - wpa_hexdump(MSG_DEBUG, "CTRL_IFACE changed monitor " - "level", (u8 *) from->sun_path, fromlen - - offsetof(struct sockaddr_un, sun_path)); - dst->debug_level = atoi(level); - return 0; - } - dst = dst->next; - } - - return -1; + return ctrl_iface_level(&hapd->ctrl_dst, from, fromlen, level); } @@ -884,6 +839,8 @@ static int hostapd_ctrl_iface_bss_tm_req(struct hostap int ret; u8 nei_rep[1000]; u8 *nei_pos = nei_rep; + u8 mbo[10]; + size_t mbo_len = 0; if (hwaddr_aton(cmd, addr)) { wpa_printf(MSG_DEBUG, "Invalid STA MAC address"); @@ -1049,10 +1006,66 @@ static int hostapd_ctrl_iface_bss_tm_req(struct hostap if (os_strstr(cmd, " disassoc_imminent=1")) req_mode |= WNM_BSS_TM_REQ_DISASSOC_IMMINENT; +#ifdef CONFIG_MBO + pos = os_strstr(cmd, "mbo="); + if (pos) { + unsigned int mbo_reason, cell_pref, reassoc_delay; + u8 *mbo_pos = mbo; + + ret = sscanf(pos, "mbo=%u:%u:%u", &mbo_reason, + &reassoc_delay, &cell_pref); + if (ret != 3) { + wpa_printf(MSG_DEBUG, + "MBO requires three arguments: mbo=::"); + return -1; + } + + if (mbo_reason > MBO_TRANSITION_REASON_PREMIUM_AP) { + wpa_printf(MSG_DEBUG, + "Invalid MBO transition reason code %u", + mbo_reason); + return -1; + } + + /* Valid values for Cellular preference are: 0, 1, 255 */ + if (cell_pref != 0 && cell_pref != 1 && cell_pref != 255) { + wpa_printf(MSG_DEBUG, + "Invalid MBO cellular capability %u", + cell_pref); + return -1; + } + + if (reassoc_delay > 65535 || + (reassoc_delay && + !(req_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT))) { + wpa_printf(MSG_DEBUG, + "MBO: Assoc retry delay is only valid in disassoc imminent mode"); + return -1; + } + + *mbo_pos++ = MBO_ATTR_ID_TRANSITION_REASON; + *mbo_pos++ = 1; + *mbo_pos++ = mbo_reason; + *mbo_pos++ = MBO_ATTR_ID_CELL_DATA_PREF; + *mbo_pos++ = 1; + *mbo_pos++ = cell_pref; + + if (reassoc_delay) { + *mbo_pos++ = MBO_ATTR_ID_ASSOC_RETRY_DELAY; + *mbo_pos++ = 2; + WPA_PUT_LE16(mbo_pos, reassoc_delay); + mbo_pos += 2; + } + + mbo_len = mbo_pos - mbo; + } +#endif /* CONFIG_MBO */ + ret = wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer, valid_int, bss_term_dur, url, nei_pos > nei_rep ? nei_rep : NULL, - nei_pos - nei_rep); + nei_pos - nei_rep, mbo_len ? mbo : NULL, + mbo_len); os_free(url); return ret; } @@ -1320,9 +1333,28 @@ static int hostapd_ctrl_iface_set(struct hostapd_data } else if (os_strcasecmp(cmd, "ext_eapol_frame_io") == 0) { hapd->ext_eapol_frame_io = atoi(value); #endif /* CONFIG_TESTING_OPTIONS */ +#ifdef CONFIG_MBO + } else if (os_strcasecmp(cmd, "mbo_assoc_disallow") == 0) { + int val; + + if (!hapd->conf->mbo_enabled) + return -1; + + val = atoi(value); + if (val < 0 || val > 1) + return -1; + + hapd->mbo_assoc_disallow = val; + ieee802_11_update_beacons(hapd->iface); + + /* + * TODO: Need to configure drivers that do AP MLME offload with + * disallowing station logic. + */ +#endif /* CONFIG_MBO */ } else { struct sta_info *sta; - int vlan_id; + struct vlan_description vlan_id; ret = hostapd_set_iface(hapd->iconf, hapd->conf, cmd, value); if (ret) @@ -1334,7 +1366,8 @@ static int hostapd_ctrl_iface_set(struct hostapd_data hapd->conf->deny_mac, hapd->conf->num_deny_mac, sta->addr, &vlan_id) && - (!vlan_id || vlan_id == sta->vlan_id)) + (!vlan_id.notempty || + !vlan_compare(&vlan_id, sta->vlan_desc))) ap_sta_disconnect( hapd, sta, sta->addr, WLAN_REASON_UNSPECIFIED); @@ -1346,7 +1379,8 @@ static int hostapd_ctrl_iface_set(struct hostapd_data hapd->conf->accept_mac, hapd->conf->num_accept_mac, sta->addr, &vlan_id) || - (vlan_id && vlan_id != sta->vlan_id)) + (vlan_id.notempty && + vlan_compare(&vlan_id, sta->vlan_desc))) ap_sta_disconnect( hapd, sta, sta->addr, WLAN_REASON_UNSPECIFIED); @@ -1557,8 +1591,8 @@ static u16 ipv4_hdr_checksum(const void *buf, size_t l #define HWSIM_PACKETLEN 1500 #define HWSIM_IP_LEN (HWSIM_PACKETLEN - sizeof(struct ether_header)) -void hostapd_data_test_rx(void *ctx, const u8 *src_addr, const u8 *buf, - size_t len) +static void hostapd_data_test_rx(void *ctx, const u8 *src_addr, const u8 *buf, + size_t len) { struct hostapd_data *hapd = ctx; const struct ether_header *eth; @@ -1745,8 +1779,6 @@ done: static int hostapd_ctrl_test_alloc_fail(struct hostapd_data *hapd, char *cmd) { #ifdef WPA_TRACE_BFD - extern char wpa_trace_fail_func[256]; - extern unsigned int wpa_trace_fail_after; char *pos; wpa_trace_fail_after = atoi(cmd); @@ -1770,9 +1802,6 @@ static int hostapd_ctrl_get_alloc_fail(struct hostapd_ char *buf, size_t buflen) { #ifdef WPA_TRACE_BFD - extern char wpa_trace_fail_func[256]; - extern unsigned int wpa_trace_fail_after; - return os_snprintf(buf, buflen, "%u:%s", wpa_trace_fail_after, wpa_trace_fail_func); #else /* WPA_TRACE_BFD */ @@ -1784,8 +1813,6 @@ static int hostapd_ctrl_get_alloc_fail(struct hostapd_ static int hostapd_ctrl_test_fail(struct hostapd_data *hapd, char *cmd) { #ifdef WPA_TRACE_BFD - extern char wpa_trace_test_fail_func[256]; - extern unsigned int wpa_trace_test_fail_after; char *pos; wpa_trace_test_fail_after = atoi(cmd); @@ -1809,9 +1836,6 @@ static int hostapd_ctrl_get_fail(struct hostapd_data * char *buf, size_t buflen) { #ifdef WPA_TRACE_BFD - extern char wpa_trace_test_fail_func[256]; - extern unsigned int wpa_trace_test_fail_after; - return os_snprintf(buf, buflen, "%u:%s", wpa_trace_test_fail_after, wpa_trace_test_fail_func); #else /* WPA_TRACE_BFD */ @@ -1875,13 +1899,13 @@ static int hostapd_ctrl_iface_vendor(struct hostapd_da /* cmd: [] */ vendor_id = strtoul(cmd, &pos, 16); - if (!isblank(*pos)) + if (!isblank((unsigned char) *pos)) return -EINVAL; subcmd = strtoul(pos, &pos, 10); if (*pos != '\0') { - if (!isblank(*pos++)) + if (!isblank((unsigned char) *pos++)) return -EINVAL; data_len = os_strlen(pos); } @@ -2016,6 +2040,9 @@ static int hostapd_ctrl_iface_track_sta_list(struct ho struct hostapd_sta_info *info; struct os_reltime now; + if (!iface->num_sta_seen) + return 0; + sta_track_expire(iface, 0); pos = buf; @@ -2040,10 +2067,228 @@ static int hostapd_ctrl_iface_track_sta_list(struct ho #endif /* NEED_AP_MLME */ +static int hostapd_ctrl_iface_req_lci(struct hostapd_data *hapd, + const char *cmd) +{ + u8 addr[ETH_ALEN]; + + if (hwaddr_aton(cmd, addr)) { + wpa_printf(MSG_INFO, "CTRL: REQ_LCI: Invalid MAC address"); + return -1; + } + + return hostapd_send_lci_req(hapd, addr); +} + + +static int hostapd_ctrl_iface_req_range(struct hostapd_data *hapd, char *cmd) +{ + u8 addr[ETH_ALEN]; + char *token, *context = NULL; + int random_interval, min_ap; + u8 responders[ETH_ALEN * RRM_RANGE_REQ_MAX_RESPONDERS]; + unsigned int n_responders; + + token = str_token(cmd, " ", &context); + if (!token || hwaddr_aton(token, addr)) { + wpa_printf(MSG_INFO, + "CTRL: REQ_RANGE - Bad destination address"); + return -1; + } + + token = str_token(cmd, " ", &context); + if (!token) + return -1; + + random_interval = atoi(token); + if (random_interval < 0 || random_interval > 0xffff) + return -1; + + token = str_token(cmd, " ", &context); + if (!token) + return -1; + + min_ap = atoi(token); + if (min_ap <= 0 || min_ap > WLAN_RRM_RANGE_REQ_MAX_MIN_AP) + return -1; + + n_responders = 0; + while ((token = str_token(cmd, " ", &context))) { + if (n_responders == RRM_RANGE_REQ_MAX_RESPONDERS) { + wpa_printf(MSG_INFO, + "CTRL: REQ_RANGE: Too many responders"); + return -1; + } + + if (hwaddr_aton(token, responders + n_responders * ETH_ALEN)) { + wpa_printf(MSG_INFO, + "CTRL: REQ_RANGE: Bad responder address"); + return -1; + } + + n_responders++; + } + + if (!n_responders) { + wpa_printf(MSG_INFO, + "CTRL: REQ_RANGE - No FTM responder address"); + return -1; + } + + return hostapd_send_range_req(hapd, addr, random_interval, min_ap, + responders, n_responders); +} + + +static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf) +{ + struct wpa_ssid_value ssid; + u8 bssid[ETH_ALEN]; + struct wpabuf *nr, *lci = NULL, *civic = NULL; + char *tmp; + int ret; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Aug 14 20:10:26 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 CEFD6105B3CB; Tue, 14 Aug 2018 20:10:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8267C85D48; Tue, 14 Aug 2018 20:10:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F831203CA; Tue, 14 Aug 2018 20:10:26 +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 w7EKAQ2R001145; Tue, 14 Aug 2018 20:10:26 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EKAQxP001144; Tue, 14 Aug 2018 20:10:26 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808142010.w7EKAQxP001144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 14 Aug 2018 20:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337818 - vendor/wpa/dist/src/rsn_supp X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: vendor/wpa/dist/src/rsn_supp X-SVN-Commit-Revision: 337818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 20:10:27 -0000 Author: cy Date: Tue Aug 14 20:10:25 2018 New Revision: 337818 URL: https://svnweb.freebsd.org/changeset/base/337818 Log: WPA: Ignore unauthenticated encrypted EAPOL-Key data Ignore unauthenticated encrypted EAPOL-Key data in supplicant processing. When using WPA2, these are frames that have the Encrypted flag set, but not the MIC flag. When using WPA2, EAPOL-Key frames that had the Encrypted flag set but not the MIC flag, had their data field decrypted without first verifying the MIC. In case the data field was encrypted using RC4 (i.e., when negotiating TKIP as the pairwise cipher), this meant that unauthenticated but decrypted data would then be processed. An adversary could abuse this as a decryption oracle to recover sensitive information in the data field of EAPOL-Key messages (e.g., the group key). (CVE-2018-14526) Signed-off-by: Mathy Vanhoef Obtained from: git://w1.fi/hostap.git MFC after: 1 day Security: CVE-2018-14526 Security: VuXML: 6bedc863-9fbe-11e8-945f-206a8a720317 Modified: vendor/wpa/dist/src/rsn_supp/wpa.c Modified: vendor/wpa/dist/src/rsn_supp/wpa.c ============================================================================== --- vendor/wpa/dist/src/rsn_supp/wpa.c Tue Aug 14 20:02:01 2018 (r337817) +++ vendor/wpa/dist/src/rsn_supp/wpa.c Tue Aug 14 20:10:25 2018 (r337818) @@ -2072,6 +2072,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_a if ((sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) { + /* + * Only decrypt the Key Data field if the frame's authenticity + * was verified. When using AES-SIV (FILS), the MIC flag is not + * set, so this check should only be performed if mic_len != 0 + * which is the case in this code branch. + */ + if (!(key_info & WPA_KEY_INFO_MIC)) { + wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, + "WPA: Ignore EAPOL-Key with encrypted but unauthenticated data"); + goto out; + } if (wpa_supplicant_decrypt_key_data(sm, key, ver, key_data, &key_data_len)) goto out; From owner-svn-src-all@freebsd.org Tue Aug 14 20:16:37 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 CCF7E105B85A; Tue, 14 Aug 2018 20:16:37 +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 2A980863A0; Tue, 14 Aug 2018 20:16:36 +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 w7EKGQqI044106; Tue, 14 Aug 2018 13:16:27 -0700 (PDT) (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 w7EKGPiZ044105; Tue, 14 Aug 2018 13:16:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808142016.w7EKGPiZ044105@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337816 - in stable/11/stand/i386: gptboot isoboot In-Reply-To: <201808141944.w7EJiaAv090670@repo.freebsd.org> To: Kyle Evans Date: Tue, 14 Aug 2018 13:16:25 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 20:16:38 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: kevans > Date: Tue Aug 14 19:44:36 2018 > New Revision: 337816 > URL: https://svnweb.freebsd.org/changeset/base/337816 > > Log: > MFC r337520: Fix WITHOUT_LOADER_GELI (gptboot) and isoboot in general ^^^^^^^^^^^^^^^^ This fixes the hybrid mode .iso build so that you can dd the disc1.iso to a USB memory stick and boot it. You no longer need a "special" memory image. > > gptboot was broken when r316078 added the LOADER_GELI_SUPPORT #ifdef to > not pass geliargs via __exec. KARGS_FLAGS_EXTARG must not be used if we're > not going to pass an additional argument to __exec. > > PR: 228151 > > Modified: > stable/11/stand/i386/gptboot/gptboot.c > stable/11/stand/i386/isoboot/isoboot.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/stand/i386/gptboot/gptboot.c > ============================================================================== > --- stable/11/stand/i386/gptboot/gptboot.c Tue Aug 14 19:42:18 2018 (r337815) > +++ stable/11/stand/i386/gptboot/gptboot.c Tue Aug 14 19:44:36 2018 (r337816) > @@ -482,9 +482,10 @@ load(void) > #endif > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), > - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) > #ifdef LOADER_GELI_SUPPORT > - , geliargs > + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo), geliargs > +#else > + 0, 0, 0, VTOP(&bootinfo) > #endif > ); > } > > Modified: stable/11/stand/i386/isoboot/isoboot.c > ============================================================================== > --- stable/11/stand/i386/isoboot/isoboot.c Tue Aug 14 19:42:18 2018 (r337815) > +++ stable/11/stand/i386/isoboot/isoboot.c Tue Aug 14 19:44:36 2018 (r337816) > @@ -417,7 +417,7 @@ load(void) > bootinfo.bi_bios_dev = dsk.drive; > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.unit, 0), > - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo)); > + 0, 0, 0, VTOP(&bootinfo)); > } > > static int > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Aug 14 20:18: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 0A2C0105B954; Tue, 14 Aug 2018 20:18:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C13E8653A; Tue, 14 Aug 2018 20:18:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id pflNf9MkmWppDpflOf8SYZ; Tue, 14 Aug 2018 14:18:00 -0600 X-Authority-Analysis: v=2.3 cv=YIcrNiOx c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=dapMudl6Dx4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=DGXMm_yJcGKE4MZM1S4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 5832E82D; Tue, 14 Aug 2018 13:18:23 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w7EKHxbM053663; Tue, 14 Aug 2018 13:17:59 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w7EKHwj3053640; Tue, 14 Aug 2018 13:17:59 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201808142017.w7EKHwj3053640@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r337818 - vendor/wpa/dist/src/rsn_supp In-Reply-To: Message from Cy Schubert of "Tue, 14 Aug 2018 20:10:26 -0000." <201808142010.w7EKAQxP001144@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 14 Aug 2018 13:17:58 -0700 X-CMAE-Envelope: MS4wfMpXHMVfwDVp+jMXR0WgKjW6zorFzu11IZCnbDzy5OG28P06PsrTP4vBvz4hnOwkqpPSuNXL8dinvFKojbrRQwtx/BGsa6vrScHS/GqLmq58D8fB7WbZ LNtD/ACfJ2x66oywEWBdsFEjDUPf58uqfR8NoRIJShD4OrbtJv7+UwA86fiIwSHZoKK7SITi+aB+OX4yBwTEVCi2uB1kT1C2Nu44xqDsRwCkWw55Mk7YC3XD 5QHXxz9sxkVKkXSsvwAfDHP5vqQkR4cdZZGp2Xj7G/XmUcPO2S14H5qtp8AtWLAXhesNGF7oJLtrAiRkfQP+Mg== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 20:18:03 -0000 In message <201808142010.w7EKAQxP001144@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Tue Aug 14 20:10:25 2018 > New Revision: 337818 > URL: https://svnweb.freebsd.org/changeset/base/337818 > > Log: > WPA: Ignore unauthenticated encrypted EAPOL-Key data > > Ignore unauthenticated encrypted EAPOL-Key data in supplicant > processing. When using WPA2, these are frames that have the Encrypted > flag set, but not the MIC flag. > > When using WPA2, EAPOL-Key frames that had the Encrypted flag set but > not the MIC flag, had their data field decrypted without first verifying > the MIC. In case the data field was encrypted using RC4 (i.e., when > negotiating TKIP as the pairwise cipher), this meant that > unauthenticated but decrypted data would then be processed. An adversary > could abuse this as a decryption oracle to recover sensitive information > in the data field of EAPOL-Key messages (e.g., the group key). > (CVE-2018-14526) > > Signed-off-by: Mathy Vanhoef > > Obtained from: git://w1.fi/hostap.git > MFC after: 1 day I got ahead of myself here. Ports and vuxml in progress. git-svn is disk intensive, as is svn for that matter. > Security: CVE-2018-14526 > Security: VuXML: 6bedc863-9fbe-11e8-945f-206a8a720317 > > Modified: > vendor/wpa/dist/src/rsn_supp/wpa.c > > Modified: vendor/wpa/dist/src/rsn_supp/wpa.c > ============================================================================= > = > --- vendor/wpa/dist/src/rsn_supp/wpa.c Tue Aug 14 20:02:01 2018 > (r337817) > +++ vendor/wpa/dist/src/rsn_supp/wpa.c Tue Aug 14 20:10:25 2018 > (r337818) > @@ -2072,6 +2072,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_a > > if ((sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) && > (key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) { > + /* > + * Only decrypt the Key Data field if the frame's authenticity > + * was verified. When using AES-SIV (FILS), the MIC flag is not > + * set, so this check should only be performed if mic_len != 0 > + * which is the case in this code branch. > + */ > + if (!(key_info & WPA_KEY_INFO_MIC)) { > + wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, > + "WPA: Ignore EAPOL-Key with encrypted but unaut > henticated data"); > + goto out; > + } > if (wpa_supplicant_decrypt_key_data(sm, key, ver, key_data, > &key_data_len)) > goto out; -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Tue Aug 14 20:24: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 919D4105BEBB; Tue, 14 Aug 2018 20:24:11 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4703186CEB; Tue, 14 Aug 2018 20:24:11 +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 2962F20705; Tue, 14 Aug 2018 20:24:11 +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 w7EKOB53011521; Tue, 14 Aug 2018 20:24:11 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EKOB4o011520; Tue, 14 Aug 2018 20:24:11 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808142024.w7EKOB4o011520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 14 Aug 2018 20:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337819 - head/contrib/wpa/src/rsn_supp X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/wpa/src/rsn_supp X-SVN-Commit-Revision: 337819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 20:24:11 -0000 Author: cy Date: Tue Aug 14 20:24:10 2018 New Revision: 337819 URL: https://svnweb.freebsd.org/changeset/base/337819 Log: MFV r337818: WPA: Ignore unauthenticated encrypted EAPOL-Key data Ignore unauthenticated encrypted EAPOL-Key data in supplicant processing. When using WPA2, these are frames that have the Encrypted flag set, but not the MIC flag. When using WPA2, EAPOL-Key frames that had the Encrypted flag set but not the MIC flag, had their data field decrypted without first verifying the MIC. In case the data field was encrypted using RC4 (i.e., when negotiating TKIP as the pairwise cipher), this meant that unauthenticated but decrypted data would then be processed. An adversary could abuse this as a decryption oracle to recover sensitive information in the data field of EAPOL-Key messages (e.g., the group key). (CVE-2018-14526) Signed-off-by: Mathy Vanhoef Obtained from: git://w1.fi/hostap.git MFC after: 1 day Security: CVE-2018-14526 Security: VuXML: 6bedc863-9fbe-11e8-945f-206a8a720317 Modified: head/contrib/wpa/src/rsn_supp/wpa.c Directory Properties: head/contrib/wpa/ (props changed) Modified: head/contrib/wpa/src/rsn_supp/wpa.c ============================================================================== --- head/contrib/wpa/src/rsn_supp/wpa.c Tue Aug 14 20:10:25 2018 (r337818) +++ head/contrib/wpa/src/rsn_supp/wpa.c Tue Aug 14 20:24:10 2018 (r337819) @@ -2072,6 +2072,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_a if ((sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) { + /* + * Only decrypt the Key Data field if the frame's authenticity + * was verified. When using AES-SIV (FILS), the MIC flag is not + * set, so this check should only be performed if mic_len != 0 + * which is the case in this code branch. + */ + if (!(key_info & WPA_KEY_INFO_MIC)) { + wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, + "WPA: Ignore EAPOL-Key with encrypted but unauthenticated data"); + goto out; + } if (wpa_supplicant_decrypt_key_data(sm, key, ver, key_data, &key_data_len)) goto out; From owner-svn-src-all@freebsd.org Tue Aug 14 20:26:55 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 059231061068; Tue, 14 Aug 2018 20:26:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B067286EE9; Tue, 14 Aug 2018 20:26:54 +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 91FC620709; Tue, 14 Aug 2018 20:26:54 +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 w7EKQsAv011668; Tue, 14 Aug 2018 20:26:54 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EKQsfJ011667; Tue, 14 Aug 2018 20:26:54 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201808142026.w7EKQsfJ011667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 14 Aug 2018 20:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337820 - head/tests/sys/kqueue/libkqueue X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/tests/sys/kqueue/libkqueue X-SVN-Commit-Revision: 337820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 20:26:55 -0000 Author: dab Date: Tue Aug 14 20:26:54 2018 New Revision: 337820 URL: https://svnweb.freebsd.org/changeset/base/337820 Log: Fix a couple whitespace errors in r337814. Reported by: Renato Botelho MFC after: 3 days X-MFC-with: r337814 Sponsored by: Dell EMC Modified: head/tests/sys/kqueue/libkqueue/main.c Modified: head/tests/sys/kqueue/libkqueue/main.c ============================================================================== --- head/tests/sys/kqueue/libkqueue/main.c Tue Aug 14 20:24:10 2018 (r337819) +++ head/tests/sys/kqueue/libkqueue/main.c Tue Aug 14 20:26:54 2018 (r337820) @@ -239,9 +239,9 @@ kevent_add(int kqfd, struct kevent *kev, EV_SET(kev, ident, filter, flags, fflags, data, NULL); if (kevent(kqfd, kev, 1, NULL, 0, NULL) < 0) { - kev_str = kevent_to_str(kev); + kev_str = kevent_to_str(kev); printf("Unable to add the following kevent:\n%s\n", - kev_str); + kev_str); free(kev_str); err(1, "kevent(): %s", strerror(errno)); } @@ -265,9 +265,9 @@ kevent_cmp(struct kevent *k1, struct kevent *k2) k1->data != k2->data || k1->udata != k2->udata || k1->ext[0] != k2->ext[0] || k1->ext[1] != k2->ext[1] || k1->ext[0] != k2->ext[2] || k1->ext[0] != k2->ext[3]) { - kev1_str = kevent_to_str(k1); + kev1_str = kevent_to_str(k1); kev2_str = kevent_to_str(k2); - printf("kevent_cmp: mismatch:\n %s !=\n %s\n", + printf("kevent_cmp: mismatch:\n %s !=\n %s\n", kev1_str, kev2_str); free(kev1_str); free(kev2_str); From owner-svn-src-all@freebsd.org Tue Aug 14 20:33: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 8130810613ED; Tue, 14 Aug 2018 20:33:49 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32D7287433; Tue, 14 Aug 2018 20:33:49 +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 13807208A0; Tue, 14 Aug 2018 20:33:49 +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 w7EKXm7g016509; Tue, 14 Aug 2018 20:33:48 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EKXmQB016507; Tue, 14 Aug 2018 20:33:48 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201808142033.w7EKXmQB016507@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: Tue, 14 Aug 2018 20:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337821 - in head/contrib/amd: . hlfsd X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in head/contrib/amd: . hlfsd X-SVN-Commit-Revision: 337821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 20:33:49 -0000 Author: 0mp (ports committer) Date: Tue Aug 14 20:33:48 2018 New Revision: 337821 URL: https://svnweb.freebsd.org/changeset/base/337821 Log: Fix a broken "SEE ALSO" section of hlfsd(8). While here pet mandoc and igor. Reviewed by: bcr, eadler, krion, mat Approved by: krion (mentor), mat (mentor) Differential Revision: https://reviews.freebsd.org/D16376 Modified: head/contrib/amd/FREEBSD-upgrade head/contrib/amd/hlfsd/hlfsd.8 Modified: head/contrib/amd/FREEBSD-upgrade ============================================================================== --- head/contrib/amd/FREEBSD-upgrade Tue Aug 14 20:26:54 2018 (r337820) +++ head/contrib/amd/FREEBSD-upgrade Tue Aug 14 20:33:48 2018 (r337821) @@ -78,6 +78,8 @@ Local changes: r1.5 mdoc(7)NG r1.3 describe all of the command line options r1.2 un-mandocafied, un4.4BSD'ed + hlfsd/hlfsd.8 + - Fix a broken SEE ALSO section and some mdoc issues mk-amd-map/mk-amd-map.8 r1.4 removed HISTORY info from the .Os call. r1.2 un-mandocafied, un4.4BSD'ed Modified: head/contrib/amd/hlfsd/hlfsd.8 ============================================================================== --- head/contrib/amd/hlfsd/hlfsd.8 Tue Aug 14 20:26:54 2018 (r337820) +++ head/contrib/amd/hlfsd/hlfsd.8 Tue Aug 14 20:33:48 2018 (r337821) @@ -80,9 +80,7 @@ anywhere. The .Nm utility -operates by mounting itself as an -.Tn NFS -server for the directory containing +operates by mounting itself as an NFS server for the directory containing .Ar linkname , which defaults to .Pa /hlfs/home . @@ -334,8 +332,8 @@ symbolic link returned by points if it is unable to verify the that user's home directory is accessible. .El -.SH "SEE ALSO" -.Xr mail1 , +.Sh "SEE ALSO" +.Xr mail 1 , .Xr getgrent 3 , .Xr getpwent 3 , .Xr mnttab 4 , @@ -343,7 +341,7 @@ user's home directory is accessible. .Xr mtab 5 , .Xr amd 8 , .Xr automount 8 , -.Xr cron8 , +.Xr cron 8 , .Xr mount 8 , .Xr sendmail 8 , .Xr umount 8 From owner-svn-src-all@freebsd.org Tue Aug 14 20:45: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 A426B10617B1; Tue, 14 Aug 2018 20:45:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 599F8882E7; Tue, 14 Aug 2018 20:45:44 +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 3A9DB20A58; Tue, 14 Aug 2018 20:45:44 +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 w7EKjiEj021684; Tue, 14 Aug 2018 20:45:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EKjhd5021682; Tue, 14 Aug 2018 20:45:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808142045.w7EKjhd5021682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 14 Aug 2018 20:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337822 - head/sys/arm/ralink X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/arm/ralink X-SVN-Commit-Revision: 337822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 20:45:44 -0000 Author: imp Date: Tue Aug 14 20:45:43 2018 New Revision: 337822 URL: https://svnweb.freebsd.org/changeset/base/337822 Log: arm/ralink cleanup Remove the non-INTRNG code. Remove left over cut and paste code from the lpc code that was the start for the port. Set KERNPHYSADDR and KERNVIRTADDR Tested on Buffalo_WZR2-G300N Differential Revision: https://reviews.freebsd.org/D16622 Modified: head/sys/arm/ralink/rt1310_intc.c head/sys/arm/ralink/rt1310var.h head/sys/arm/ralink/std.ralink Modified: head/sys/arm/ralink/rt1310_intc.c ============================================================================== --- head/sys/arm/ralink/rt1310_intc.c Tue Aug 14 20:33:48 2018 (r337821) +++ head/sys/arm/ralink/rt1310_intc.c Tue Aug 14 20:45:43 2018 (r337822) @@ -60,32 +60,24 @@ __FBSDID("$FreeBSD$"); #define INTC_NIRQS 32 -#ifdef INTRNG #include "pic_if.h" struct rt1310_irqsrc { struct intr_irqsrc ri_isrc; u_int ri_irq; }; -#endif struct rt1310_intc_softc { device_t dev; struct resource * ri_res; bus_space_tag_t ri_bst; bus_space_handle_t ri_bsh; -#ifdef INTRNG struct rt1310_irqsrc ri_isrcs[INTC_NIRQS]; -#endif }; static int rt1310_intc_probe(device_t); static int rt1310_intc_attach(device_t); -#ifndef INTRNG -static void rt1310_intc_eoi(void *); -#else static int rt1310_pic_attach(struct rt1310_intc_softc *sc); -#endif static struct rt1310_intc_softc *intc_softc = NULL; @@ -143,11 +135,7 @@ rt1310_intc_probe(device_t dev) if (!ofw_bus_is_compatible_strict(dev, "rt,pic")) return (ENXIO); -#ifdef INTRNG - device_set_desc(dev, "RT1310 INTRNG Interrupt Controller"); -#else device_set_desc(dev, "RT1310 Interrupt Controller"); -#endif return (BUS_PROBE_DEFAULT); } @@ -173,11 +161,7 @@ rt1310_intc_attach(device_t dev) sc->ri_bst = rman_get_bustag(sc->ri_res); sc->ri_bsh = rman_get_bushandle(sc->ri_res); intc_softc = sc; -#ifndef INTRNG - arm_post_filter = rt1310_intc_eoi; -#else rt1310_pic_attach(sc); -#endif intc_write_4(sc, RT_INTC_IECR, 0); intc_write_4(sc, RT_INTC_ICCR, ~0); @@ -195,73 +179,7 @@ rt1310_intc_attach(device_t dev) return (0); } -#ifndef INTRNG -int -arm_get_next_irq(int last) -{ - struct rt1310_intc_softc *sc = intc_softc; - uint32_t value; - int i; - value = intc_read_4(sc, RT_INTC_IPR); - for (i = 0; i < 32; i++) { - if (value & (1 << i)) - return (i); - } - - return (-1); -} - -void -arm_mask_irq(uintptr_t nb) -{ - struct rt1310_intc_softc *sc = intc_softc; - uint32_t value; - - /* Make sure that interrupt isn't active already */ - rt1310_intc_eoi((void *)nb); - - /* Clear bit in ER register */ - value = intc_read_4(sc, RT_INTC_IECR); - value &= ~(1 << nb); - intc_write_4(sc, RT_INTC_IECR, value); - intc_write_4(sc, RT_INTC_IMR, value); - - intc_write_4(sc, RT_INTC_ICCR, 1 << nb); -} - -void -arm_unmask_irq(uintptr_t nb) -{ - struct rt1310_intc_softc *sc = intc_softc; - uint32_t value; - - value = intc_read_4(sc, RT_INTC_IECR); - - value |= (1 << nb); - - intc_write_4(sc, RT_INTC_IMR, value); - intc_write_4(sc, RT_INTC_IECR, value); -} - static void -rt1310_intc_eoi(void *data) -{ - struct rt1310_intc_softc *sc = intc_softc; - int nb = (int)data; - - intc_write_4(sc, RT_INTC_ICCR, 1 << nb); - if (nb == 0) { - uint32_t value; - value = intc_read_4(sc, RT_INTC_IECR); - value &= ~(1 << nb); - intc_write_4(sc, RT_INTC_IECR, value); - intc_write_4(sc, RT_INTC_IMR, value); - } -} - -#else - -static void rt1310_enable_intr(device_t dev, struct intr_irqsrc *isrc) { u_int irq; @@ -390,43 +308,20 @@ rt1310_pic_attach(struct rt1310_intc_softc *sc) return (intr_pic_claim_root(sc->dev, xref, rt1310_intr, sc, 0)); } -#endif struct fdt_fixup_entry fdt_fixup_table[] = { { NULL, NULL } }; -#ifndef INTRNG -static int -fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, - int *pol) -{ - if (!fdt_is_compatible(node, "lpc,pic")) - return (ENXIO); - - *interrupt = fdt32_to_cpu(intr[0]); - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - return (0); -} - -fdt_pic_decode_t fdt_pic_table[] = { - &fdt_pic_decode_ic, - NULL -}; -#endif - static device_method_t rt1310_intc_methods[] = { DEVMETHOD(device_probe, rt1310_intc_probe), DEVMETHOD(device_attach, rt1310_intc_attach), -#ifdef INTRNG DEVMETHOD(pic_disable_intr, rt1310_disable_intr), DEVMETHOD(pic_enable_intr, rt1310_enable_intr), DEVMETHOD(pic_map_intr, rt1310_map_intr), DEVMETHOD(pic_post_filter, rt1310_post_filter), DEVMETHOD(pic_post_ithread, rt1310_post_ithread), DEVMETHOD(pic_pre_ithread, rt1310_pre_ithread), -#endif { 0, 0 } }; Modified: head/sys/arm/ralink/rt1310var.h ============================================================================== --- head/sys/arm/ralink/rt1310var.h Tue Aug 14 20:33:48 2018 (r337821) +++ head/sys/arm/ralink/rt1310var.h Tue Aug 14 20:45:43 2018 (r337822) @@ -33,38 +33,11 @@ #include #include -/* Clocking and power control */ -uint32_t lpc_pwr_read(device_t, int); -void lpc_pwr_write(device_t, int, uint32_t); - /* GPIO */ void rt1310_gpio_init(void); int rt1310_gpio_set_flags(device_t, int, int); int rt1310_gpio_set_state(device_t, int, int); int rt1310_gpio_get_state(device_t, int, int *); - -/* DMA */ -struct lpc_dmac_channel_config -{ - int ldc_fcntl; - int ldc_src_periph; - int ldc_src_width; - int ldc_src_incr; - int ldc_src_burst; - int ldc_dst_periph; - int ldc_dst_width; - int ldc_dst_incr; - int ldc_dst_burst; - void (*ldc_success_handler)(void *); - void (*ldc_error_handler)(void *); - void * ldc_handler_arg; -}; - -int lpc_dmac_config_channel(device_t, int, struct lpc_dmac_channel_config *); -int lpc_dmac_setup_transfer(device_t, int, bus_addr_t, bus_addr_t, bus_size_t, int); -int lpc_dmac_enable_channel(device_t, int); -int lpc_dmac_disable_channel(device_t, int); -int lpc_dmac_start_burst(device_t, int); extern uint32_t rt1310_master_clock; Modified: head/sys/arm/ralink/std.ralink ============================================================================== --- head/sys/arm/ralink/std.ralink Tue Aug 14 20:33:48 2018 (r337821) +++ head/sys/arm/ralink/std.ralink Tue Aug 14 20:45:43 2018 (r337822) @@ -4,3 +4,8 @@ cpu CPU_ARM9E machine arm makeoptions CONF_CFLAGS="-march=armv5te" options INTRNG + +makeoptions KERNPHYSADDR=0x40000000 +makeoptions KERNVIRTADDR=0xc0000000 +options KERNVIRTADDR=0xc0000000 +options PHYSADDR=0x40000000 From owner-svn-src-all@freebsd.org Tue Aug 14 20:51: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 EFE47106195A for ; Tue, 14 Aug 2018 20:51:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (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 825B3885D8 for ; Tue, 14 Aug 2018 20:51:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x243.google.com with SMTP id p6-v6so10472078iom.12 for ; Tue, 14 Aug 2018 13:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YCBRdYjoAs18BHro+n2Z68rMGu6d1mPjyR1ML9cTfCE=; b=Gz/jxoBMf2VVzvVgTDgoH8jT3zoSEiA/3LRUUt5R1BOSTt3GgONC7Yx2ayZTE1sDjh PpuiT0AF32RtMgUQFLIA+2IlEp8OZ/Xu+loH8rwkjmEHLTrOhuJLaeL5NJB2wpPfJdSB ujV3s1tCcq/kaFTkKCBNkGdzNZN+YbIbT4wM0BvCphZYCUHtFScJH1H1tel5jAaBvHwn a+s6dOaqD2qkE1sKomxwIKSCanT5wtujSgMFTE6N452/jon1qguaQK2t0vJ02shRsoPu uyevKCxgpTfp2Fmbg0IzHgTuv5GSQoTPaDTa85WuGbsBRMV8u0wYONGgoP9fZiMauKYC KTMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YCBRdYjoAs18BHro+n2Z68rMGu6d1mPjyR1ML9cTfCE=; b=Va0VRlc680uNfxRtA6t3Yyu9TqqrhkJNIfTdmXvNUrgvr36UM45N4liBs1kcPIYu+Q L0oZata/XV4QmlsLQwUmdmr1BJzLfywT2r55dg1Q3IrGDaBCSCAjJO/yW2gTebT4L7Jh MKb+3RZ2hoHGNtgnpyu//kSi5PoLSOA4DYEvotkDpObPFRaSRVL7N/HciFxc3R4G4llN TBP30sFalXbQV9fuPPrjQCSdOM3/V63wf1a6zaunwYBhJtgiEYD5/CS8I8Yr1Y1XfGH1 rRta1z2EUDIb7J0idu1txR3mZiYGBGYAs3+6yruzTtGdCbT6NO3Cw7Gcs3Rlitkmac0T vg4A== X-Gm-Message-State: AOUpUlEO9qBOYHQqs18sC67lHNuA3t55aqoEg/oYFOpI2VNqmFUEn0E9 S9rWmci+0CFvNaxfpRq1l8XCyTc2WU1+XbXL+ehMvw== X-Google-Smtp-Source: AA+uWPyPWLwhgHgE02n7coMRloXWFdMAHaspgazmdR8tjaeAB0nt7L51bepv9xLvBHb2iTZbgAfAgwyNWWSUH0HsPDE= X-Received: by 2002:a6b:d004:: with SMTP id x4-v6mr19362022ioa.299.1534279863812; Tue, 14 Aug 2018 13:51:03 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Tue, 14 Aug 2018 13:51:03 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201808142045.w7EKjhd5021682@repo.freebsd.org> References: <201808142045.w7EKjhd5021682@repo.freebsd.org> From: Warner Losh Date: Tue, 14 Aug 2018 14:51:03 -0600 X-Google-Sender-Auth: QSEr2cpXPWi-IoKbiXS1oNnnRXo Message-ID: Subject: Re: svn commit: r337822 - head/sys/arm/ralink To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 20:51:05 -0000 On Tue, Aug 14, 2018 at 2:45 PM, Warner Losh wrote: > Author: imp > Date: Tue Aug 14 20:45:43 2018 > New Revision: 337822 > URL: https://svnweb.freebsd.org/changeset/base/337822 > > Log: > arm/ralink cleanup > > Remove the non-INTRNG code. > Remove left over cut and paste code from the lpc code that was the start > for the port. > Set KERNPHYSADDR and KERNVIRTADDR > > Tested on Buffalo_WZR2-G300N > > Differential Revision: https://reviews.freebsd.org/D16622 I should have tagged this with Submitted by: yamori813 at yahoo.co.jp (Hiroki Mori) Since this patch is 100% from Mori-san, with any touch by me being trivial. Warner From owner-svn-src-all@freebsd.org Tue Aug 14 21:37:41 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 5BFA810657FF; Tue, 14 Aug 2018 21:37:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 095AE8A55A; Tue, 14 Aug 2018 21:37:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 997FEE896; Tue, 14 Aug 2018 21:37:40 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f169.google.com with SMTP id p6-v6so16540476ljc.5; Tue, 14 Aug 2018 14:37:40 -0700 (PDT) X-Gm-Message-State: AOUpUlEVqcZ2CKsvR7sb7Lg5WExH/UyF3DsjY09LF+sgoDh7LZLcnCjd HC1+2m6yODEZG6lZzz9AMAUdKlzo/iOz0GfOepY= X-Google-Smtp-Source: AA+uWPztNlTbhq8l4OUYfCJ8oSyEJujt/1pPfHIW7bFmxo0WMgPCtdW4QYHRnCVryd6LCbDbLnvqSAW5PIPfkMglQVk= X-Received: by 2002:a2e:2e02:: with SMTP id u2-v6mr17207932lju.77.1534282659219; Tue, 14 Aug 2018 14:37:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Tue, 14 Aug 2018 14:37:18 -0700 (PDT) In-Reply-To: <201808080133.w781XaUM003779@repo.freebsd.org> References: <201808080133.w781XaUM003779@repo.freebsd.org> From: Kyle Evans Date: Tue, 14 Aug 2018 16:37:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337442 - in head/contrib/file: . doc magic magic/Magdir python src tests To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 21:37:41 -0000 On Tue, Aug 7, 2018 at 8:33 PM, Eitan Adler wrote: > Author: eadler > Date: Wed Aug 8 01:33:36 2018 > New Revision: 337442 > URL: https://svnweb.freebsd.org/changeset/base/337442 > > Log: > file: update to 5.34 > > PR: 230141 > exp-run by: antoine > Hi, Do you have any plans to MFC this and the previous update to stable/11? Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Tue Aug 14 22:13:09 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 550A0106683A; Tue, 14 Aug 2018 22:13:09 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 C243A8B7F7; Tue, 14 Aug 2018 22:13:08 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-wr1-x42b.google.com with SMTP id g1-v6so18491941wru.2; Tue, 14 Aug 2018 15:13:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1PZ5b1hdfK5UvYfhf/gNCL7l4tCjkTecO25nZLTFRGw=; b=Y//0Ack9cFp7Z/EGjLqFUvD48kMmvfwoB6w5j9xFFF3MC3QnkI1AJudxjYykv4OzF2 3RBwsebrjqCTIsAN8q2ZkTBirNdEHzn045hKVAZgKBSuMMxAhDu/M3ZURDiSgoqmU1gT +PpucPzqy+I70pcAIxArQ3zKUlq6WulZuMmJC1Q+dCU8UnPRNHsoAHg6XkU0JccoNfjT W8b8ZOppktJSF1rEeUQFsJV+AOIQhh1c0CTolrlf65Ls14pvtsYjR+1wObBvQXgZHCUf VXxDrTbOGBXb4+IVF7vE7Cvlyv5dlggA9PCWfBWnUSl3WnvTIwHW0sW3j5ZeuUQqFhVl 6nxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=1PZ5b1hdfK5UvYfhf/gNCL7l4tCjkTecO25nZLTFRGw=; b=HZD6a56ZHIv+3tcjTNkxBFWCF9eJlEVl5lgiVN9kk6Ojnss6g9aTkP/07ngMgptKrA kufrVCQzjH8n2ibD8IGN+j5GeaFU+S01ZVhU4MKMpsIew60jYjtyXaVhzPOGGvaTaqEN YV4hNmorFosvyxo4F9MmSO4q+Hon2BYBJzdMfsa5GnRHS4elu6X78p6To/VNqw7FX34h 7yERlhzGokOIuezJGXpVbEm0SWPzIPJ5VxI9OxR493+Lg1ABQQfyODPs5ecdVeQ13r1Z 5kAsjREE2v/qUCM4tPu4KiLOgEYlgLGptTPcDGl58mox6PVbAM1c46YGpMpSs7sfbpY1 zsog== X-Gm-Message-State: AOUpUlEcd34khHa681SU/uSvxXDrIfD7ybN4USoWKY8skI3LQSD2Lbt/ iwzTIeiAfympcS2pTs6Qd6Wkgiu0lUw= X-Google-Smtp-Source: AA+uWPySbTg5yJuYQDXgSzqOZbyZH0wDiiH0Aa/0MqIDhkd6e9DMiCtZ8ameoaOm1w//IhR1XD7XEQ== X-Received: by 2002:a5d:528f:: with SMTP id c15-v6mr14502079wrv.102.1534284787399; Tue, 14 Aug 2018 15:13:07 -0700 (PDT) Received: from jarvis (global-5-54.nat-1.net.cam.ac.uk. [131.111.5.54]) by smtp.gmail.com with ESMTPSA id l16-v6sm151062wmc.38.2018.08.14.15.13.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Aug 2018 15:13:06 -0700 (PDT) Sender: Mariusz Zaborski Date: Wed, 15 Aug 2018 00:11:40 +0200 From: Mariusz Zaborski To: Mateusz Piotrowski <0mp@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337821 - in head/contrib/amd: . hlfsd Message-ID: <20180814221139.GA15272@jarvis> References: <201808142033.w7EKXmQB016507@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dDRMvlgZJXvWKvBx" Content-Disposition: inline In-Reply-To: <201808142033.w7EKXmQB016507@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 22:13:09 -0000 --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 14, 2018 at 08:33:48PM +0000, Mateusz Piotrowski wrote: > Author: 0mp (ports committer) > Date: Tue Aug 14 20:33:48 2018 > New Revision: 337821 > URL: https://svnweb.freebsd.org/changeset/base/337821 >=20 > Log: > Fix a broken "SEE ALSO" section of hlfsd(8). > =20 > While here pet mandoc and igor. > =20 > Reviewed by: bcr, eadler, krion, mat > Approved by: krion (mentor), mat (mentor) > Differential Revision: https://reviews.freebsd.org/D16376 >=20 > Modified: > head/contrib/amd/FREEBSD-upgrade > head/contrib/amd/hlfsd/hlfsd.8 >=20 > Modified: head/contrib/amd/FREEBSD-upgrade > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/contrib/amd/FREEBSD-upgrade Tue Aug 14 20:26:54 2018 (r337820) > +++ head/contrib/amd/FREEBSD-upgrade Tue Aug 14 20:33:48 2018 (r337821) > @@ -78,6 +78,8 @@ Local changes: > r1.5 mdoc(7)NG > r1.3 describe all of the command line options > r1.2 un-mandocafied, un4.4BSD'ed > + hlfsd/hlfsd.8 > + - Fix a broken SEE ALSO section and some mdoc issues > mk-amd-map/mk-amd-map.8 > r1.4 removed HISTORY info from the .Os call. > r1.2 un-mandocafied, un4.4BSD'ed >=20 > Modified: head/contrib/amd/hlfsd/hlfsd.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/contrib/amd/hlfsd/hlfsd.8 Tue Aug 14 20:26:54 2018 (r337820) > +++ head/contrib/amd/hlfsd/hlfsd.8 Tue Aug 14 20:33:48 2018 (r337821) Please bump the date. > @@ -80,9 +80,7 @@ anywhere. > The > .Nm > utility > -operates by mounting itself as an > -.Tn NFS > -server for the directory containing > +operates by mounting itself as an NFS server for the directory containing > .Ar linkname , > which defaults to > .Pa /hlfs/home . > @@ -334,8 +332,8 @@ symbolic link returned by > points if it is unable to verify the that > user's home directory is accessible. > .El > -.SH "SEE ALSO" > -.Xr mail1 , > +.Sh "SEE ALSO" > +.Xr mail 1 , > .Xr getgrent 3 , > .Xr getpwent 3 , > .Xr mnttab 4 , > @@ -343,7 +341,7 @@ user's home directory is accessible. > .Xr mtab 5 , > .Xr amd 8 , > .Xr automount 8 , > -.Xr cron8 , > +.Xr cron 8 , > .Xr mount 8 , > .Xr sendmail 8 , > .Xr umount 8 >=20 --=20 Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD committer | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 --dDRMvlgZJXvWKvBx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkD1x0xkJXVVY1Gwf38KEGuLGxWQFAltzU5UACgkQ38KEGuLG xWT5eQ//YlIkHWs+B7P06jf/ZTWS3EWkTUCwJ1/aTJjDHnYjF9J/EmQvrsTRKoVU yYLM/syb7gngtltwEj1HeDipLNUjJZo8mDdfuWBzh1BpZcZT0xmn7W9Tfrm82V/c Hr6m3wfyY+ksi2RlapVEd3/o12MaSJ5NUCmAveIre66ywqbyfUMIzmaJcmU2l4/Q TTrK20EZtuc0omT5BDmKqG4tAj/BKTWUnlh36oTQ3jtbFAqzVohWJ/NaAxbTTkhF 3PH72CeGpwYjgJ0eITpU6E+mW6dRnEj0RzqbmyxWd2bI7YcjIr3Hj51NpGGgKnZP zZARBMXrCN2o+Ap1hm/7WB4PVOfAYtFvSUCVxTqy6/AA8EMKsVg9/ZarDZfbklya +GcKMyQqAq6K8TFEa92M15GQqzoZgKuNqzVZrpyAhMh8xc6XC2Yll0wP47NA7j2e Q2pWunae+KHQTnBwxWBtshop3CimJYfptl2i/yGdVVJ8qwk8c60yVQTkz+ehOA1X gQAdaPf5eLaY8TEffjDtjlgC2HDrpsiGDAkmi/iMoBi5tVnQOwNSx4GAbHzNGDk3 RPVyFZP1EMz51j1428F11AFmlFBKHdF/nSCOVYgtLeHctgikVSGW8qZ8eyiJRVsQ spc0zI0yXoWzbbA4N2axkIroEDiD1ghn62rmltPklJWL5K5kyd0= =Brdq -----END PGP SIGNATURE----- --dDRMvlgZJXvWKvBx-- From owner-svn-src-all@freebsd.org Tue Aug 14 22:57: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 C89511068AB3; Tue, 14 Aug 2018 22:57:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C3358CBF3; Tue, 14 Aug 2018 22:57:29 +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 5D19421F7F; Tue, 14 Aug 2018 22:57:29 +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 w7EMvTVC088202; Tue, 14 Aug 2018 22:57:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EMvTIZ088201; Tue, 14 Aug 2018 22:57:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808142257.w7EMvTIZ088201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 14 Aug 2018 22:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337823 - stable/11/usr.bin/printf X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/usr.bin/printf X-SVN-Commit-Revision: 337823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 22:57:30 -0000 Author: pfg Date: Tue Aug 14 22:57:28 2018 New Revision: 337823 URL: https://svnweb.freebsd.org/changeset/base/337823 Log: MFC r337458, r337618: Fix printf(1) ignores width and precision in %b format. The precision with the conversion specifier b is specified by POSIX: see point 7 in the reference documentation. Include fix from jilles@ to avoid breaking the testsuite. Reference: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html PR: 229641 Reported by: Rudolf Cejka Submitted by: Garrett D'Amore (illumos) Modified: stable/11/usr.bin/printf/printf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/printf/printf.c ============================================================================== --- stable/11/usr.bin/printf/printf.c Tue Aug 14 20:45:43 2018 (r337822) +++ stable/11/usr.bin/printf/printf.c Tue Aug 14 22:57:28 2018 (r337823) @@ -1,4 +1,5 @@ /*- + * Copyright 2018 Staysail Systems, Inc. * Copyright 2014 Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1989, 1993 @@ -378,13 +379,16 @@ printf_doformat(char *fmt, int *rval) char *p; int getout; - p = strdup(getstr()); - if (p == NULL) { + /* Convert "b" to "s" for output. */ + start[strlen(start) - 1] = 's'; + if ((p = strdup(getstr())) == NULL) { warnx("%s", strerror(ENOMEM)); return (NULL); } getout = escape(p, 0, &len); - fputs(p, stdout); + PF(start, p); + /* Restore format for next loop. */ + free(p); if (getout) return (end_fmt); From owner-svn-src-all@freebsd.org Tue Aug 14 23:34: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 1365E1069B1E; Tue, 14 Aug 2018 23:34:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1148DE85; Tue, 14 Aug 2018 23:34:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id B50541A1F2D; Wed, 15 Aug 2018 09:34:18 +1000 (AEST) Date: Wed, 15 Aug 2018 09:34:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337750 - head/share/man/man4 In-Reply-To: <201808141352.w7EDqA6F001954@repo.freebsd.org> Message-ID: <20180815084045.O1014@besplex.bde.org> References: <201808141352.w7EDqA6F001954@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=jJZvByP1D1G-hL7PPiIA:9 a=_P0jZaGDmSuAWyhi:21 a=qinOi3yzuv--cUAC:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2018 23:34:31 -0000 On Tue, 14 Aug 2018, Warner Losh wrote: > Log: > Add good description of init and lock devices from sio to uart. I thought at first that this was for the callin and callout devices. These have been completely broken since FreeBSD-8. (A few hundred bugs collateral bugs in the tty driver are fixed in my version, including the big fat lock which prevents even stty -f on not only the complementary device but on the same device when another thread is sleeping in open. (The normal use of callout devices is when you have a callin device being opened by getty. With working callout devices, you can open the complementary callout device. In -current, this hangs on the big fat lock. Even stty -f on the callin device to possibly set CLOCAL to unblock the open hangs on the big fat lock.)) The init and lock devices are only partly broken in uart. They used to be broken for console devices for the most important terminal attributes. These were "fixated" in a hard-coded way instead of using the lock devices. CLOCAL is broken for callout devices by ignoring the initial state device and forcing it on. > Modified: head/share/man/man4/uart.4 > ============================================================================== > --- head/share/man/man4/uart.4 Tue Aug 14 13:52:08 2018 (r337749) > +++ head/share/man/man4/uart.4 Tue Aug 14 13:52:10 2018 (r337750) > @@ -225,6 +225,52 @@ Generally speaking, a connection to a DB-9 style conne > level signal at up to 12 volts. > A connection to header pins or an edge-connector on an embedded board > is typically a TTL signal at 3.3 or 5 volts. > +.Sh Special Devices > +The > +.Nm > +driver also supports an initial-state and a lock-state control > +device for each of the callin and the callout "data" devices. > +The termios settings of a data device are copied > +from those of the corresponding initial-state device > +on first opens and are not inherited from previous opens. Bug: CLOCAL is forced on initially for callout devices and perhaps also for callin console devices. The setting in the initial state is ignored. Applications can change int later. This makes little difference for open, but affects the behaviour later. > +Use > +.Xr stty 1 > +in the normal way on the initial-state devices to program > +initial termios states suitable for your setup. > +.Pp > +The lock termios state acts as flags to disable changing > +the termios state. > +E.g., to lock a flag variable such as CRTSCTS, use > +.Em stty crtscts > +on the lock-state device. > +Speeds and special characters > +may be locked by setting the corresponding value in the lock-state > +device to any nonzero value. > +E.g., to lock a speed to 115200, use > +.Dq Li stty 115200 > +on the initial-state device and > +.Dq Li stty 1 > +on the lock-state device. Uart useed to fix speeds, and lock state setting was silently ignored. Similarly for CLOCAL. It works right now, except gettytab has mounds of entries to work around the previous misbehaviour. HUPCL is still broken in uart. The initial and lock state settings for it are silently ignored, and it is fixated in a hard-coded way to set for non-consoles and unset for consoles. Part of silently ignoring it is to accept changes to it via tcsetattr() but then ignore the setting. tcsetattr() is difficult enough to use without such bugs. It is document to succeed if it made _any_ setting successfully. So it must always succeed if it can reach the driver, since null changes to unimportant settings are always possible. And applications must call tcgetattr() after tcsetattr() to determine which settings succeeded. But when settings are silently ignored later, the ones reported by tcsetattr() can't be trusted either. > +.Pp > +Correct programs talking to correctly wired external devices > +work with almost arbitrary initial states and almost no locking, > +but other setups may benefit from changing some of the default > +initial state and locking the state. Not since a little before FreeBSD-8 or ever with uart. The tty layer sets wrong states in the initial and lock state devices. The initial state should be raw for non-consoles and sane for consoles. The lock state should be none for non-consoles and a few things (mainly the speed, CLOCAL and HUPCL, and possibly CRTSCTS) for consoles. This was broken to sane for all cases and some missing lock settings for console. > +In particular, the initial states for non (POSIX) standard flags > +should be set to suit the devices attached and may need to be > +locked to prevent buggy programs from changing them. > +E.g., CRTSCTS should be locked on for devices that support > +RTS/CTS handshaking at all times and off for devices that do not > +support it at all. This man page describes all of the delicate settings. CRTSCTS might need to be locked off for consoles since flow control can hang console output, which can cause an unbounded number of threads waiting in ttymsg() (ttymsg() is clueless about terminals and is missing all the necessary flow control and O_NONBLOCK handling). Even software xon/xoff might need to be locked off foc consoles. > +CLOCAL should be locked on for devices that do not support carrier. > +HUPCL may be locked off if you do not > +want to hang up for some reason. These are broken as described above. HUPCL is broken in sio too, except in my version. dg broke it in ~1993 to work around bugs in his modems. (They locked up if RTS and/or DTR was dropped too quickly in close, and perhaps there should be a timeout. Dropping of at least RTS was turned off to work around this.) When RTS is dropped in close, flow control normally prevents the output being done. The output tends to bite the next open(). This is the correct behaviour, except it gives security holes. When RTS is not dropped in close, flow-controlled output is normally done soon and acts like it is dropped. The broken HUPCL in uart results in RTS being forcibly dropped on last close for non-consoles, and never dropped on last close for consoles. Both behaviours are sometimes useful, but there is no way to control them. > +In general, very bad things happen > +if something is locked to the wrong state, and things should not > +be locked for devices that support more than one setting. > +The CLOCAL flag on callin ports should be locked off for logins > +to avoid certain security holes, but this needs to be done by > +getty if the callin port is used for anything else. I still sometimes forget this and lock myself out using CRTSCTS. Even my correct initial states sometimes cause problems. I often run statistics programs like netstat instead of getty on vtys. The correct initial state of raw doesn't work for these programs, and it requires tricky sttys to set a suitable cooked mode. E.g.: ttyv4 "/bin/sh -c '/home/bde/bin/scripts/systat -v 1 /dev/ttyv4 2>&1'" cons25 on secure ttyv8 "/bin/sh -c '(stty sane; /home/bde/bin/scripts/netstat -d -I sk0 1) /dev/ttyv8 2>&1"' cons25 on secure systat uses curses so has clues about terminal handling so it doesn't need a stty. > .Sh FILES > .Bl -tag -width "/dev/ttyu?.init" -compact > .It Pa /dev/ttyu? Bruce From owner-svn-src-all@freebsd.org Wed Aug 15 00:15:41 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 1FE77106B2DA; Wed, 15 Aug 2018 00:15:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC0188F5A8; Wed, 15 Aug 2018 00:15:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98AFC22C4A; Wed, 15 Aug 2018 00:15:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7F0FeqI029007; Wed, 15 Aug 2018 00:15:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F0Fe9W029006; Wed, 15 Aug 2018 00:15:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808150015.w7F0Fe9W029006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 15 Aug 2018 00:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337824 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 337824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 00:15:41 -0000 Author: imp Date: Wed Aug 15 00:15:40 2018 New Revision: 337824 URL: https://svnweb.freebsd.org/changeset/base/337824 Log: Flesh out a comment about what we're doing with read bias and trims. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Aug 14 22:57:28 2018 (r337823) +++ head/sys/cam/cam_iosched.c Wed Aug 15 00:15:40 2018 (r337824) @@ -1311,7 +1311,9 @@ cam_iosched_get_trim(struct cam_iosched_softc *isc) if (do_dynamic_iosched) { /* * If pending read, prefer that based on current read bias - * setting. + * setting. The read bias is shared for both writes and + * TRIMs, but on TRIMs the bias is for a combined TRIM + * not a single TRIM request that's come in. */ if (bioq_first(&isc->bio_queue) && isc->current_read_bias) { isc->current_read_bias--; From owner-svn-src-all@freebsd.org Wed Aug 15 01:24: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 644DB106D42A; Wed, 15 Aug 2018 01:24:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16E9971922; Wed, 15 Aug 2018 01:24:44 +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 ECCBC2376E; Wed, 15 Aug 2018 01:24:43 +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 w7F1Oh26064292; Wed, 15 Aug 2018 01:24:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F1OhGo064291; Wed, 15 Aug 2018 01:24:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808150124.w7F1OhGo064291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 15 Aug 2018 01:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337825 - stable/11/usr.bin/apply X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.bin/apply X-SVN-Commit-Revision: 337825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 01:24:44 -0000 Author: kevans Date: Wed Aug 15 01:24:43 2018 New Revision: 337825 URL: https://svnweb.freebsd.org/changeset/base/337825 Log: MFC r337504: apply(1): Fix magic number substitution with a magic space Using a space as the magic character would result in problems if the command started with a number: - For a 'valid' number n, n < size of argv, it would erroneously get replaced with that argument; e.g. `apply -a ' ' -d 1rm x => `execxrm x` - For an 'invalid' number n, n >= size of argv, it would segfault. e.g. `apply -a ' ' 2to3 test.py` would try to access argv[2] This problem occurred because apply(1) would prepend "exec " to the command string before doing the actual magic number replacements, so it would come across "exec 2to3 1" and assume that the " 2" is also a magic number to be replaced. Re-work this to instead just append "exec " to the command sbuf and workaround the ugliness. This also simplifies stuff in the process. PR: 226948 Modified: stable/11/usr.bin/apply/apply.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/apply/apply.c ============================================================================== --- stable/11/usr.bin/apply/apply.c Wed Aug 15 00:15:40 2018 (r337824) +++ stable/11/usr.bin/apply/apply.c Wed Aug 15 01:24:43 2018 (r337825) @@ -53,7 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define EXEC "exec " +#define ISMAGICNO(p) \ + (p)[0] == magic && isdigit((unsigned char)(p)[1]) && (p)[1] != '0' static int exec_shell(const char *, const char *, const char *); static void usage(void); @@ -63,8 +64,9 @@ main(int argc, char *argv[]) { struct sbuf *cmdbuf; long arg_max; - int ch, debug, i, magic, n, nargs, offset, rval; + int ch, debug, i, magic, n, nargs, rval; size_t cmdsize; + char buf[4]; char *cmd, *name, *p, *shell, *slashp, *tmpshell; debug = 0; @@ -73,7 +75,7 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "a:d0123456789")) != -1) switch (ch) { case 'a': - if (optarg[1] != '\0') + if (optarg[0] == '\0' || optarg[1] != '\0') errx(1, "illegal magic character specification"); magic = optarg[0]; @@ -103,7 +105,7 @@ main(int argc, char *argv[]) * largest one. */ for (n = 0, p = argv[0]; *p != '\0'; ++p) - if (p[0] == magic && isdigit(p[1]) && p[1] != '0') { + if (ISMAGICNO(p)) { ++p; if (p[0] - '0' > n) n = p[0] - '0'; @@ -132,28 +134,19 @@ main(int argc, char *argv[]) * Allocate enough space to hold the maximum command. Save the * size to pass to snprintf(). */ - cmdsize = sizeof(EXEC) - 1 + strlen(argv[0]) - + 9 * (sizeof(" %1") - 1) + 1; - if ((cmd = malloc(cmdsize)) == NULL) - err(1, NULL); - if (n == 0) { + cmdsize = strlen(argv[0]) + 9 * (sizeof(" %1") - 1) + 1; + if ((cmd = malloc(cmdsize)) == NULL) + err(1, NULL); + strlcpy(cmd, argv[0], cmdsize); + /* If nargs not set, default to a single argument. */ if (nargs == -1) nargs = 1; - p = cmd; - offset = snprintf(cmd, cmdsize, EXEC "%s", argv[0]); - if ((size_t)offset >= cmdsize) - errx(1, "snprintf() failed"); - p += offset; - cmdsize -= offset; for (i = 1; i <= nargs; i++) { - offset = snprintf(p, cmdsize, " %c%d", magic, i); - if ((size_t)offset >= cmdsize) - errx(1, "snprintf() failed"); - p += offset; - cmdsize -= offset; + snprintf(buf, sizeof(buf), " %c%d", magic, i); + strlcat(cmd, buf, cmdsize); } /* @@ -163,9 +156,8 @@ main(int argc, char *argv[]) if (nargs == 0) nargs = 1; } else { - offset = snprintf(cmd, cmdsize, EXEC "%s", argv[0]); - if ((size_t)offset >= cmdsize) - errx(1, "snprintf() failed"); + if ((cmd = strdup(argv[0])) == NULL) + err(1, NULL); nargs = n; } @@ -182,9 +174,10 @@ main(int argc, char *argv[]) */ for (rval = 0; argc > nargs; argc -= nargs, argv += nargs) { sbuf_clear(cmdbuf); + sbuf_cat(cmdbuf, "exec "); /* Expand command argv references. */ for (p = cmd; *p != '\0'; ++p) { - if (p[0] == magic && isdigit(p[1]) && p[1] != '0') { + if (ISMAGICNO(p)) { if (sbuf_cat(cmdbuf, argv[(++p)[0] - '0']) == -1) errc(1, ENOMEM, "sbuf"); From owner-svn-src-all@freebsd.org Wed Aug 15 01:29: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 39438106D5F7; Wed, 15 Aug 2018 01:29:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA17871AFF; Wed, 15 Aug 2018 01:29:02 +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 AD18E23772; Wed, 15 Aug 2018 01:29:02 +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 w7F1T2mo064555; Wed, 15 Aug 2018 01:29:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F1T23r064553; Wed, 15 Aug 2018 01:29:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808150129.w7F1T23r064553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 15 Aug 2018 01:29: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: r337826 - stable/11/bin/ls X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/bin/ls X-SVN-Commit-Revision: 337826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 01:29:03 -0000 Author: kevans Date: Wed Aug 15 01:29:02 2018 New Revision: 337826 URL: https://svnweb.freebsd.org/changeset/base/337826 Log: MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment COLORTERM is the de facto standard, while CLICOLOR is generally specific to FreeBSD and ls(1). PR: 230101 Modified: stable/11/bin/ls/ls.1 stable/11/bin/ls/ls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ls/ls.1 ============================================================================== --- stable/11/bin/ls/ls.1 Wed Aug 15 01:24:43 2018 (r337825) +++ stable/11/bin/ls/ls.1 Wed Aug 15 01:29:02 2018 (r337826) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd August 8, 2018 .Dt LS 1 .Os .Sh NAME @@ -140,6 +140,8 @@ after each that is a Enable colorized output. This option is equivalent to defining .Ev CLICOLOR +or +.Ev COLORTERM in the environment. (See below.) This functionality can be compiled out by removing the definition of @@ -636,6 +638,10 @@ The variable still needs to reference a color capable terminal however otherwise it is not possible to determine which color sequences to use. +.It Ev COLORTERM +See description for +.Ev CLICOLOR +above. .It Ev COLUMNS If this variable contains a string representing a decimal integer, it is used as the @@ -660,7 +666,9 @@ for more information. .It Ev LSCOLORS The value of this variable describes what color to use for which attribute when colors are enabled with -.Ev CLICOLOR . +.Ev CLICOLOR +or +.Ev COLORTERM . This string is a concatenation of pairs of the format .Ar f Ns Ar b , where @@ -767,6 +775,8 @@ option for more details. .It Ev TERM The .Ev CLICOLOR +and +.Ev COLORTERM functionality depends on a terminal type with color capabilities. .It Ev TZ The timezone to use when displaying dates. Modified: stable/11/bin/ls/ls.c ============================================================================== --- stable/11/bin/ls/ls.c Wed Aug 15 01:24:43 2018 (r337825) +++ stable/11/bin/ls/ls.c Wed Aug 15 01:29:02 2018 (r337826) @@ -374,7 +374,7 @@ main(int argc, char *argv[]) f_listdot = 1; /* Enabling of colours is conditional on the environment. */ - if (getenv("CLICOLOR") && + if ((getenv("CLICOLOR") || getenv("COLORTERM")) && (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) #ifdef COLORLS if (tgetent(termcapbuf, getenv("TERM")) == 1) { From owner-svn-src-all@freebsd.org Wed Aug 15 02:11: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 1D2F4106E608; Wed, 15 Aug 2018 02:11:42 +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 85FA072C35; Wed, 15 Aug 2018 02:11:41 +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 w7F1ftmV045151; Tue, 14 Aug 2018 18:41:55 -0700 (PDT) (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 w7F1ft69045150; Tue, 14 Aug 2018 18:41:55 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808150141.w7F1ft69045150@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: <201808150129.w7F1T23r064553@repo.freebsd.org> To: Kyle Evans Date: Tue, 14 Aug 2018 18:41:55 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 02:11:42 -0000 > Author: kevans > Date: Wed Aug 15 01:29:02 2018 > New Revision: 337826 > URL: https://svnweb.freebsd.org/changeset/base/337826 > > Log: > MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment > > COLORTERM is the de facto standard, while CLICOLOR is generally specific to > FreeBSD and ls(1). I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" Seems that the defaults for xfce terminal is to have COLORTERM. > PR: 230101 > > Modified: > stable/11/bin/ls/ls.1 > stable/11/bin/ls/ls.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/bin/ls/ls.1 > ============================================================================== > --- stable/11/bin/ls/ls.1 Wed Aug 15 01:24:43 2018 (r337825) > +++ stable/11/bin/ls/ls.1 Wed Aug 15 01:29:02 2018 (r337826) > @@ -32,7 +32,7 @@ > .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 > .\" $FreeBSD$ > .\" > -.Dd December 1, 2015 > +.Dd August 8, 2018 > .Dt LS 1 > .Os > .Sh NAME > @@ -140,6 +140,8 @@ after each that is a > Enable colorized output. > This option is equivalent to defining > .Ev CLICOLOR > +or > +.Ev COLORTERM > in the environment. > (See below.) > This functionality can be compiled out by removing the definition of > @@ -636,6 +638,10 @@ The > variable still needs to reference a color capable terminal however > otherwise it is not possible to determine which color sequences to > use. > +.It Ev COLORTERM > +See description for > +.Ev CLICOLOR > +above. > .It Ev COLUMNS > If this variable contains a string representing a > decimal integer, it is used as the > @@ -660,7 +666,9 @@ for more information. > .It Ev LSCOLORS > The value of this variable describes what color to use for which > attribute when colors are enabled with > -.Ev CLICOLOR . > +.Ev CLICOLOR > +or > +.Ev COLORTERM . > This string is a concatenation of pairs of the format > .Ar f Ns Ar b , > where > @@ -767,6 +775,8 @@ option for more details. > .It Ev TERM > The > .Ev CLICOLOR > +and > +.Ev COLORTERM > functionality depends on a terminal type with color capabilities. > .It Ev TZ > The timezone to use when displaying dates. > > Modified: stable/11/bin/ls/ls.c > ============================================================================== > --- stable/11/bin/ls/ls.c Wed Aug 15 01:24:43 2018 (r337825) > +++ stable/11/bin/ls/ls.c Wed Aug 15 01:29:02 2018 (r337826) > @@ -374,7 +374,7 @@ main(int argc, char *argv[]) > f_listdot = 1; > > /* Enabling of colours is conditional on the environment. */ > - if (getenv("CLICOLOR") && > + if ((getenv("CLICOLOR") || getenv("COLORTERM")) && > (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) > #ifdef COLORLS > if (tgetent(termcapbuf, getenv("TERM")) == 1) { > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 02:14: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 6BABE106E6D9; Wed, 15 Aug 2018 02:14:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C7AA72E2D; Wed, 15 Aug 2018 02:14:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E62F123F7A; Wed, 15 Aug 2018 02:14:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7F2Enr6089946; Wed, 15 Aug 2018 02:14:49 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F2ElCX089932; Wed, 15 Aug 2018 02:14:47 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808150214.w7F2ElCX089932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 15 Aug 2018 02:14:47 +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: r337827 - in stable/11: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic X-SVN-Commit-Revision: 337827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 02:14:50 -0000 Author: eadler Date: Wed Aug 15 02:14:46 2018 New Revision: 337827 URL: https://svnweb.freebsd.org/changeset/base/337827 Log: MFC r333919, r333922, r333944, r337442: Update file to file 5.34 (through 5.33) Added: stable/11/contrib/file/magic/Magdir/beetle - copied unchanged from r333919, head/contrib/file/magic/Magdir/beetle stable/11/contrib/file/magic/Magdir/dataone - copied unchanged from r337442, head/contrib/file/magic/Magdir/dataone stable/11/contrib/file/magic/Magdir/dbpf - copied, changed from r333919, head/contrib/file/magic/Magdir/dbpf stable/11/contrib/file/magic/Magdir/measure - copied, changed from r333919, head/contrib/file/magic/Magdir/measure stable/11/contrib/file/magic/Magdir/rpi - copied unchanged from r333919, head/contrib/file/magic/Magdir/rpi stable/11/contrib/file/magic/Magdir/tplink - copied unchanged from r333919, head/contrib/file/magic/Magdir/tplink stable/11/contrib/file/magic/Magdir/zip - copied unchanged from r333919, head/contrib/file/magic/Magdir/zip stable/11/contrib/file/python/CHANGELOG.md - copied unchanged from r337442, head/contrib/file/python/CHANGELOG.md stable/11/contrib/file/python/LICENSE - copied unchanged from r337442, head/contrib/file/python/LICENSE stable/11/contrib/file/python/README.md - copied unchanged from r337442, head/contrib/file/python/README.md stable/11/contrib/file/python/tests.py - copied unchanged from r337442, head/contrib/file/python/tests.py stable/11/contrib/file/src/buffer.c - copied unchanged from r333919, head/contrib/file/src/buffer.c stable/11/contrib/file/src/seccomp.c - copied, changed from r333919, head/contrib/file/src/seccomp.c stable/11/contrib/file/tests/JW07022A.mp3.result - copied unchanged from r337442, head/contrib/file/tests/JW07022A.mp3.result stable/11/contrib/file/tests/JW07022A.mp3.testfile - copied unchanged from r337442, head/contrib/file/tests/JW07022A.mp3.testfile Deleted: stable/11/contrib/file/python/README Modified: stable/11/contrib/file/ChangeLog stable/11/contrib/file/README stable/11/contrib/file/TODO stable/11/contrib/file/config.h.in stable/11/contrib/file/configure stable/11/contrib/file/configure.ac stable/11/contrib/file/doc/file.man stable/11/contrib/file/doc/magic.man stable/11/contrib/file/magic/Magdir/acorn stable/11/contrib/file/magic/Magdir/animation stable/11/contrib/file/magic/Magdir/apple stable/11/contrib/file/magic/Magdir/archive stable/11/contrib/file/magic/Magdir/audio stable/11/contrib/file/magic/Magdir/c64 stable/11/contrib/file/magic/Magdir/cad stable/11/contrib/file/magic/Magdir/compress stable/11/contrib/file/magic/Magdir/console stable/11/contrib/file/magic/Magdir/database stable/11/contrib/file/magic/Magdir/dump stable/11/contrib/file/magic/Magdir/elf stable/11/contrib/file/magic/Magdir/filesystems stable/11/contrib/file/magic/Magdir/fonts stable/11/contrib/file/magic/Magdir/fsav stable/11/contrib/file/magic/Magdir/games stable/11/contrib/file/magic/Magdir/geo stable/11/contrib/file/magic/Magdir/gnu stable/11/contrib/file/magic/Magdir/images stable/11/contrib/file/magic/Magdir/intel stable/11/contrib/file/magic/Magdir/linux stable/11/contrib/file/magic/Magdir/macintosh stable/11/contrib/file/magic/Magdir/make stable/11/contrib/file/magic/Magdir/mozilla stable/11/contrib/file/magic/Magdir/msdos stable/11/contrib/file/magic/Magdir/msooxml stable/11/contrib/file/magic/Magdir/netbsd stable/11/contrib/file/magic/Magdir/ole2compounddocs stable/11/contrib/file/magic/Magdir/pdf stable/11/contrib/file/magic/Magdir/pgp stable/11/contrib/file/magic/Magdir/revision stable/11/contrib/file/magic/Magdir/riff stable/11/contrib/file/magic/Magdir/sgi stable/11/contrib/file/magic/Magdir/sgml stable/11/contrib/file/magic/Magdir/spectrum stable/11/contrib/file/magic/Magdir/ssl stable/11/contrib/file/magic/Magdir/terminfo stable/11/contrib/file/magic/Magdir/vorbis stable/11/contrib/file/magic/Magdir/windows stable/11/contrib/file/magic/Makefile.am stable/11/contrib/file/magic/Makefile.in stable/11/contrib/file/python/Makefile.am stable/11/contrib/file/python/Makefile.in stable/11/contrib/file/python/magic.py stable/11/contrib/file/python/setup.py stable/11/contrib/file/src/Makefile.am stable/11/contrib/file/src/Makefile.in stable/11/contrib/file/src/apprentice.c stable/11/contrib/file/src/ascmagic.c stable/11/contrib/file/src/cdf.c stable/11/contrib/file/src/compress.c stable/11/contrib/file/src/der.c stable/11/contrib/file/src/encoding.c stable/11/contrib/file/src/file.c stable/11/contrib/file/src/file.h stable/11/contrib/file/src/file_opts.h stable/11/contrib/file/src/funcs.c stable/11/contrib/file/src/is_tar.c stable/11/contrib/file/src/readcdf.c stable/11/contrib/file/src/readelf.c stable/11/contrib/file/src/readelf.h stable/11/contrib/file/src/softmagic.c stable/11/contrib/file/tests/Makefile.am stable/11/contrib/file/tests/Makefile.in stable/11/lib/libmagic/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/file/ChangeLog ============================================================================== --- stable/11/contrib/file/ChangeLog Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/ChangeLog Wed Aug 15 02:14:46 2018 (r337827) @@ -1,3 +1,40 @@ +2018-07-25 8:50 Christos Zoulas + + * release 5.34 + +2018-06-22 16:38 Christos Zoulas + + * Add Quad indirect offsets + +2018-05-24 14:10 Christos Zoulas + + * Enable parsing of ELF dynamic sections to handle PIE better + +2018-04-15 14:52 Christos Zoulas + + * release 5.33 + +2018-02-24 14:50 Christos Zoulas + + * extend the support for ${x?:} expansions for magic descriptions + +2018-02-21 16:25 Christos Zoulas + + * add support for ${x?:} in mime types to handle + pie binaries. + +2017-11-03 9:23 Christos Zoulas + + * add support for negative offsets (offsets from the end of file) + +2017-09-26 8:22 Christos Zoulas + + * close the file on error when writing magic (Steve Grubb) + +2017-09-24 12:02 Christos Zoulas + + * seccomp support (Paul Moore) + 2017-09-02 11:53 Christos Zoulas * release 5.32 Modified: stable/11/contrib/file/README ============================================================================== --- stable/11/contrib/file/README Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/README Wed Aug 15 02:14:46 2018 (r337827) @@ -1,14 +1,13 @@ ## README for file(1) Command ## - @(#) $File: README,v 1.50 2016/04/16 22:40:54 christos Exp $ + @(#) $File: README,v 1.54 2018/05/30 03:06:56 christos Exp $ -Mailing List: file@mx.gw.com -Mailing List archives: http://mx.gw.com/pipermail/file/ -Bug tracker: http://bugs.gw.com/ +Mailing List: file@astron.com +Mailing List archives: http://mailman.astron.com/pipermail/file/ +Bug tracker: http://bugs.astron.com/ E-mail: christos@astron.com +Build Status: https://travis-ci.org/file/file -[![Build Status](https://travis-ci.org/file/file.png?branch=master)](https://travis-ci.org/file/file) - Phone: Do not even think of telephoning me about this program. Send cash first! This is Release 5.x of Ian Darwin's (copyright but distributable) @@ -67,28 +66,6 @@ in magic(5) format please, to the maintainer, Christos COPYING - read this first. README - read this second (you are currently reading this file). INSTALL - read on how to install -src/localtime_r.c -src/magic.c -src/magic.h -src/mygetopt.h -src/newtest2.c -src/newtest3.c -src/pread.c -src/print.c -src/readcdf.c -src/readelf.c -src/readelf.h -src/regex.c -src/regex2.c -src/softmagic.c -src/strcasestr.c -src/strlcat.c -src/strlcpy.c -src/strndup.c -src/tar.h -src/teststrchr.c -src/vasprintf.c -src/x.c src/apprentice.c - parses /etc/magic to learn magic src/apptype.c - used for OS/2 specific application type magic src/ascmagic.c - third & last set of tests, based on hardwired assumptions. @@ -96,6 +73,7 @@ src/asctime_r.c - replacement for OS's that don't have src/asprintf.c - replacement for OS's that don't have it. src/asctime_r.c - replacement for OS's that don't have it. src/asprintf.c - replacement for OS's that don't have it. +src/buffer.c - buffer handling functions. src/cdf.[ch] - parser for Microsoft Compound Document Files src/cdf_time.c - time converter for CDF. src/compress.c - handles decompressing files to look inside. @@ -128,6 +106,7 @@ src/mygetopt.h - replacement for OS's that don't have src/strcasestr.c - replacement for OS's that don't have it. src/strlcat.c - replacement for OS's that don't have it. src/strlcpy.c - replacement for OS's that don't have it. +src/strndup.c - replacement for OS's that don't have it. src/tar.h - tar file definitions src/vasprintf.c - for systems that don't have it. doc/file.man - man page for the command @@ -155,6 +134,19 @@ guidelines: * Further reference, such as documentation of format ------------------------------------------------------------------------------ + +gpg for dummies: + +$ gpg --verify file-X.YY.tar.gz.asc file-X.YY.tar.gz +gpg: assuming signed data in `file-X.YY.tar.gz' +gpg: Signature made WWW MMM DD HH:MM:SS YYYY ZZZ using DSA key ID KKKKKKKK + +To download the key: + +$ gpg --keyserver hkp://keys.gnupg.net --recv-keys KKKKKKKK + +------------------------------------------------------------------------------ + Parts of this software were developed at SoftQuad Inc., developers of SGML/HTML/XML publishing software, in Toronto, Canada. Modified: stable/11/contrib/file/TODO ============================================================================== --- stable/11/contrib/file/TODO Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/TODO Wed Aug 15 02:14:46 2018 (r337827) @@ -31,6 +31,19 @@ could require structural changes to the matching code # rule 2 >0 .... ... +--- +- Merge the stat code dance in one place and keep it in one place + (perhaps struct buffer). +- Enable seeking around if offset > nbytes if possible (the fd + is seekable). +- We could use file_pipe2file more (for EOF offsets, CDF documents), + but that is expensive; perhaps we should provide a way to disable it +- The implementation of struct buffer needs re-thinking and more work. + For example we don't always pass the fd in the child. This is not + important yet as we don't have yet cases where use/indirect magic + needs negative offsets. +- Really the whole thing just needs here's an (offset, buffer, size) + you have (filebuffer, filebuffersize &&|| fd), fill the buffer with + data from offset. The buffer API should be changed to just do that. christos - Modified: stable/11/contrib/file/config.h.in ============================================================================== --- stable/11/contrib/file/config.h.in Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/config.h.in Wed Aug 15 02:14:46 2018 (r337827) @@ -77,6 +77,9 @@ /* Define to 1 if you have the `gnurx' library (-lgnurx). */ #undef HAVE_LIBGNURX +/* Define to 1 if you have the `seccomp' library (-lseccomp). */ +#undef HAVE_LIBSECCOMP + /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ Modified: stable/11/contrib/file/configure ============================================================================== --- stable/11/contrib/file/configure Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/configure Wed Aug 15 02:14:46 2018 (r337827) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.32. +# Generated by GNU Autoconf 2.69 for file 5.34. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.32' -PACKAGE_STRING='file 5.32' +PACKAGE_VERSION='5.34' +PACKAGE_STRING='file 5.34' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -767,6 +767,7 @@ enable_silent_rules enable_elf enable_elf_core enable_zlib +enable_libseccomp enable_fsect_man5 enable_dependency_tracking enable_static @@ -1328,7 +1329,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.32 to adapt to many kinds of systems. +\`configure' configures file 5.34 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1398,7 +1399,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.32:";; + short | recursive ) echo "Configuration of file 5.34:";; esac cat <<\_ACEOF @@ -1411,6 +1412,7 @@ Optional Features: --disable-elf disable builtin ELF support --disable-elf-core disable ELF core file support --disable-zlib disable zlib compression support [default=auto] + --disable-libseccomp disable libseccomp sandboxing [default=auto] --enable-fsect-man5 enable file formats in man section 5 --enable-dependency-tracking do not reject slow dependency extractors @@ -1509,7 +1511,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.32 +file configure 5.34 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2165,7 +2167,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.32, which was +It was created by file $as_me 5.34, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3031,7 +3033,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.32' + VERSION='5.34' cat >>confdefs.h <<_ACEOF @@ -3230,6 +3232,16 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_zlib" >&5 $as_echo "$enable_zlib" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libseccomp support" >&5 +$as_echo_n "checking for libseccomp support... " >&6; } +# Check whether --enable-libseccomp was given. +if test "${enable_libseccomp+set}" = set; then : + enableval=$enable_libseccomp; +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_libseccomp" >&5 +$as_echo "$enable_libseccomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file formats in man section 5" >&5 $as_echo_n "checking for file formats in man section 5... " >&6; } # Check whether --enable-fsect-man5 was given. @@ -14461,6 +14473,53 @@ _ACEOF fi fi +if test "$enable_libseccomp" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for seccomp_init in -lseccomp" >&5 +$as_echo_n "checking for seccomp_init in -lseccomp... " >&6; } +if ${ac_cv_lib_seccomp_seccomp_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lseccomp $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char seccomp_init (); +int +main () +{ +return seccomp_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_seccomp_seccomp_init=yes +else + ac_cv_lib_seccomp_seccomp_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_seccomp_seccomp_init" >&5 +$as_echo "$ac_cv_lib_seccomp_seccomp_init" >&6; } +if test "x$ac_cv_lib_seccomp_seccomp_init" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSECCOMP 1 +_ACEOF + + LIBS="-lseccomp $LIBS" + +fi + +fi if test "$MINGW" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for regexec in -lgnurx" >&5 $as_echo_n "checking for regexec in -lgnurx... " >&6; } @@ -15075,7 +15134,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.32, which was +This file was extended by file $as_me 5.34, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15141,7 +15200,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.32 +file config.status 5.34 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/file/configure.ac ============================================================================== --- stable/11/contrib/file/configure.ac Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/configure.ac Wed Aug 15 02:14:46 2018 (r337827) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.32],[christos@astron.com]) +AC_INIT([file],[5.34],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -39,6 +39,11 @@ AC_ARG_ENABLE(zlib, [AS_HELP_STRING([--disable-zlib], [disable zlib compression support @<:@default=auto@:>@])]) AC_MSG_RESULT($enable_zlib) +AC_MSG_CHECKING(for libseccomp support) +AC_ARG_ENABLE(libseccomp, +[AS_HELP_STRING([--disable-libseccomp], [disable libseccomp sandboxing @<:@default=auto@:>@])]) +AC_MSG_RESULT($enable_libseccomp) + AC_MSG_CHECKING(for file formats in man section 5) AC_ARG_ENABLE(fsect-man5, [ --enable-fsect-man5 enable file formats in man section 5], @@ -157,6 +162,9 @@ AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcp dnl Checks for libraries if test "$enable_zlib" != "no"; then AC_CHECK_LIB(z, gzopen) +fi +if test "$enable_libseccomp" != "no"; then + AC_CHECK_LIB(seccomp, seccomp_init) fi if test "$MINGW" = 1; then AC_CHECK_LIB(gnurx,regexec,,AC_MSG_ERROR([libgnurx is required to build file(1) with MinGW])) Modified: stable/11/contrib/file/doc/file.man ============================================================================== --- stable/11/contrib/file/doc/file.man Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/doc/file.man Wed Aug 15 02:14:46 2018 (r337827) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.125 2017/01/03 11:24:46 christos Exp $ -.Dd October 19, 2016 +.\" $File: file.man,v 1.131 2018/07/24 21:33:56 christos Exp $ +.Dd July 25, 2018 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -8,7 +8,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl bcdEhiklLNnprsvzZ0 +.Op Fl bcdEhiklLNnprsSvzZ0 .Op Fl Fl apple .Op Fl Fl extension .Op Fl Fl mime-encoding @@ -168,7 +168,8 @@ in any of the character sets listed above is simply sa .Bl -tag -width indent .It Fl Fl apple Causes the file command to output the file type and creator code as -used by older MacOS versions. The code consists of eight letters, +used by older MacOS versions. +The code consists of eight letters, the first describing the file type, the latter the creator. .It Fl b , Fl Fl brief Do not prepend filenames to output lines (brief mode). @@ -215,12 +216,14 @@ elf magic is found. .It soft Consults magic files. .It tar -Examines tar files. +Examines tar files by verifying the checksum of the 512 byte tar header. +Excluding this test can provide more detailed content description by using +the soft magic method. .It text A synonym for .Sq ascii . .El -.It Fl Fl extension +.It Fl Fl extension Print a slash-separated list of valid extensions for the file type found. .It Fl F , Fl Fl separator Ar separator Use the specified string as the separator between the filename and the @@ -350,6 +353,16 @@ This option also causes to disregard the file size as reported by .Xr stat 2 since on some systems it reports a zero size for raw disk partitions. +.It Fl S , Fl Fl no-sandbox +On systems where libseccomp +.Pa ( https://github.com/seccomp/libseccomp ) +is available, the +.Fl S +flag disables sandboxing which is enabled by default. +This option is needed for file to execute external descompressing programs, +i.e. when the +.Fl z +flag is specified and the built-in decompressors are not available. .It Fl v , Fl Fl version Print the version of the program and exit. .It Fl z , Fl Fl uncompress @@ -366,20 +379,13 @@ Nice to the output. This does not affect the separator, which is still printed. .Pp -If this option is repeated more than once, then +If this option is repeated more than once, then .Nm prints just the filename followed by a NUL followed by the description (or ERROR: text) followed by a second NUL for each entry. .It Fl -help Print a help message and exit. .El -.Sh FILES -.Bl -tag -width __MAGIC__.mgc -compact -.It Pa __MAGIC__.mgc -Default compiled list of magic. -.It Pa __MAGIC__ -Directory containing default magic files. -.El .Sh ENVIRONMENT The environment variable .Ev MAGIC @@ -392,11 +398,6 @@ will not attempt to open adds .Dq Pa .mgc to the value of this variable as appropriate. -However, -.Pa file -has to exist in order for -.Pa file.mime -to be considered. The environment variable .Ev POSIXLY_CORRECT controls (on systems that support symbolic links), whether @@ -410,6 +411,65 @@ This is also controlled by the and .Fl h options. +.Sh FILES +.Bl -tag -width __MAGIC__.mgc -compact +.It Pa __MAGIC__.mgc +Default compiled list of magic. +.It Pa __MAGIC__ +Directory containing default magic files. +.El +.Sh EXIT STATUS +.Nm +will exit with +.Dv 0 +if the operation was successful or +.Dv >0 +if an error was encountered. +The following errors cause diagnostic messages, but don't affect the program +exit code (as POSIX requires), unless +.Fl E +is specified: +.Bl -bullet -compact -offset indent +.It +A file cannot be found +.It +There is no permission to read a file +.It +The file type cannot be determined +.El +.Sh EXAMPLES +.Bd -literal -offset indent +$ file file.c file /dev/{wd0a,hda} +file.c: C program text +file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), + dynamically linked (uses shared libs), stripped +/dev/wd0a: block special (0/0) +/dev/hda: block special (3/0) + +$ file -s /dev/wd0{b,d} +/dev/wd0b: data +/dev/wd0d: x86 boot sector + +$ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10} +/dev/hda: x86 boot sector +/dev/hda1: Linux/i386 ext2 filesystem +/dev/hda2: x86 boot sector +/dev/hda3: x86 boot sector, extended partition table +/dev/hda4: Linux/i386 ext2 filesystem +/dev/hda5: Linux/i386 swap file +/dev/hda6: Linux/i386 swap file +/dev/hda7: Linux/i386 swap file +/dev/hda8: Linux/i386 swap file +/dev/hda9: empty +/dev/hda10: empty + +$ file -i file.c file /dev/{wd0a,hda} +file.c: text/x-c +file: application/x-executable +/dev/hda: application/x-not-regular-file +/dev/wd0a: application/x-not-regular-file + +.Ed .Sh SEE ALSO .Xr hexdump 1 , .Xr od 1 , @@ -462,6 +522,23 @@ for example, .Bd -literal -offset indent \*[Gt]16 long\*[Am]0x7fffffff \*[Gt]0 not stripped .Ed +.Sh SECURITY +On systems where libseccomp +.Pa ( https://github.com/seccomp/libseccomp ) +is available, +.Nm +is enforces limiting system calls to only the ones necessary for the +operation of the program. +This enforcement does not provide any security benefit when +.Nm +is asked to decompress input files running external programs with +the +.Fl z +option. +To enable execution of external decompressors, one needs to disable +sandboxing using the +.Fl S +flag. .Sh MAGIC DIRECTORY The magic file entries have been collected from various sources, mainly USENET, and contributed by various authors. @@ -479,39 +556,6 @@ command uses a magic file, keep the old magic file around for comparison purposes (rename it to .Pa __MAGIC__.orig ) . -.Sh EXAMPLES -.Bd -literal -offset indent -$ file file.c file /dev/{wd0a,hda} -file.c: C program text -file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), - dynamically linked (uses shared libs), stripped -/dev/wd0a: block special (0/0) -/dev/hda: block special (3/0) - -$ file -s /dev/wd0{b,d} -/dev/wd0b: data -/dev/wd0d: x86 boot sector - -$ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10} -/dev/hda: x86 boot sector -/dev/hda1: Linux/i386 ext2 filesystem -/dev/hda2: x86 boot sector -/dev/hda3: x86 boot sector, extended partition table -/dev/hda4: Linux/i386 ext2 filesystem -/dev/hda5: Linux/i386 swap file -/dev/hda6: Linux/i386 swap file -/dev/hda7: Linux/i386 swap file -/dev/hda8: Linux/i386 swap file -/dev/hda9: empty -/dev/hda10: empty - -$ file -i file.c file /dev/{wd0a,hda} -file.c: text/x-c -file: application/x-executable -/dev/hda: application/x-not-regular-file -/dev/wd0a: application/x-not-regular-file - -.Ed .Sh HISTORY There has been a .Nm @@ -533,7 +577,7 @@ Geoff Collyer found several inadequacies and provided some magic file entries. Contributions of the .Sq \*[Am] -operator by Rob McMahon, +operator by Rob McMahon, .Aq cudcv@warwick.ac.uk , 1989. .Pp @@ -583,16 +627,13 @@ and were written by John Gilmore from his public-domain .Xr tar 1 program, and are not covered by the above license. -.Sh RETURN CODE -.Nm -returns 0 on success, and non-zero on error. .Sh BUGS Please report bugs and send patches to the bug tracker at -.Pa http://bugs.gw.com/ +.Pa http://bugs.astron.com/ or the mailing list at -.Aq file@mx.gw.com +.Aq file@astron.com (visit -.Pa http://mx.gw.com/mailman/listinfo/file +.Pa http://mailman.astron.com/mailman/listinfo/file first to subscribe). .Sh TODO Fix output so that tests for MIME and APPLE flags are not needed all Modified: stable/11/contrib/file/doc/magic.man ============================================================================== --- stable/11/contrib/file/doc/magic.man Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/doc/magic.man Wed Aug 15 02:14:46 2018 (r337827) @@ -1,5 +1,6 @@ -.\" $File: magic.man,v 1.91 2017/02/12 15:30:08 christos Exp $ -.Dd February 12, 2017 +.It S2 +.\" $File: magic.man,v 1.93 2018/06/22 20:39:49 christos Exp $ +.Dd June 22, 2018 .Dt MAGIC __FSECTION__ .Os .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems. @@ -36,8 +37,20 @@ If the test succeeds, a message is printed. The line consists of the following fields: .Bl -tag -width ".Dv message" .It Dv offset -A number specifying the offset, in bytes, into the file of the data +A number specifying the offset (in bytes) into the file of the data which is to be tested. +This offset can be a negative number if it is: +.Bl -bullet -compact +.It +The first direct offset of the magic entry (at continuation level 0), +in which case it is interpreted an offset from end end of the file +going backwards. +This works only when a file descriptor to the file is a available and it +is a regular file. +.It +A continuation offset relative to the end of the last up-level field +.Dv ( \*[Am] ) . +.El .It Dv type The type of the data to be tested. The possible values are: @@ -541,12 +554,12 @@ the file. The value at that offset is read, and is used again as an offset in the file. Indirect offsets are of the form: -.Em (( x [[.,][bislBISL]][+\-][ y ]) . +.Em (( x [[.,][bBcCeEfFgGhHiIlmsSqQ]][+\-][ y ]) . The value of .Em x is used as an offset in the file. A byte, id3 length, short or long is read at that offset depending on the -.Em [bislBISLm] +.Em [bBcCeEfFgGhHiIlmsSqQ] type specifier. The value is treated as signed if .Dq , @@ -563,6 +576,20 @@ To that number the value of .Em y is added and the result is used as an offset in the file. The default type if one is not specified is long. +The following types are recognized: +.Bl -column -offset indent "Type" "Half/Short" "Little" "Size" +.It Sy Type Sy Mnemonic Sy Endian Sy Size +.It bcBc Byte/Char N/A 1 +.It efg Double Little 8 +.It EFG Double Big 8 +.It hs Half/Short Little 2 +.It HS Half/Short Big 2 +.It i ID3 Little 4 +.It I ID3 Big 4 +.It m Middle Middle 4 +.It q Quad Little 8 +.It Q Quad Big 8 +.El .Pp That way variable length structures can be examined: .Bd -literal -offset indent Modified: stable/11/contrib/file/magic/Magdir/acorn ============================================================================== --- stable/11/contrib/file/magic/Magdir/acorn Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/magic/Magdir/acorn Wed Aug 15 02:14:46 2018 (r337827) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: acorn,v 1.5 2009/09/19 16:28:07 christos Exp $ +# $File: acorn,v 1.6 2017/10/19 16:40:37 christos Exp $ # acorn: file(1) magic for files found on Acorn systems # @@ -67,3 +67,36 @@ >>8 byte x version %d, >>10 leshort =1 1 pattern >>10 leshort !1 %d patterns + +# From: Joerg Jenderek +# URL: https://www.kyzer.me.uk/pack/xad/#PackDir +# reference: https://www.kyzer.me.uk/pack/xad/xad_PackDir.lha/PackDir.c +# GRR: line below is too general as it matches also "Git pack" in ./revision +0 string PACK\0 +# check for valid compression method 0-4 +>5 ulelong <5 +# https://www.riscosopen.org/wiki/documentation/show/Introduction%20To%20Filing%20Systems +# To skip "Git pack" version 0 test for root directory object like +# ADFS::RPC.$.websitezip.FONTFIX +>>9 string >ADFS\ PackDir archive (RISC OS) +# TrID labels above as "Acorn PackDir compressed Archive" +# compression mode y (0 - 4) for GIF LZW with a maximum n bits +# (y~n,0~12,1~13,2~14,3~15,4~16) +>>>5 ulelong+12 x \b, LZW %u-bits compression +# http://www.filebase.org.uk/filetypes +# !Packdir compressed archive has three hexadecimal digits code 68E +!:mime application/x-acorn-68E +!:ext pkd/bin +# null terminated root directory object like IDEFS::IDE-4.$.Apps.GRAPHICS.!XFMPdemo +>>>9 string x \b, root "%s" +# load address 0xFFFtttdd, ttt is the object filetype and dddddddddd is time +>>>>&1 ulelong x \b, load address 0x%x +# execution address 0xdddddddd dddddddddd is 40 bit unsigned centiseconds since 1.1.1900 UTC +>>>>&5 ulelong x \b, exec address 0x%x +# attributes (bits: 0~owner read,1~owner write,3~no delete,4~public read,5~public write) +>>>>&9 ulelong x \b, attributes 0x%x +# number of entries in this directory. for root dir 0 +#>>>&13 ulelong x \b, entries 0x%x +# the entries start here with object name +>>>>&17 string x \b, 1st object "%s" + Modified: stable/11/contrib/file/magic/Magdir/animation ============================================================================== --- stable/11/contrib/file/magic/Magdir/animation Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/magic/Magdir/animation Wed Aug 15 02:14:46 2018 (r337827) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: animation,v 1.63 2017/05/26 14:33:07 christos Exp $ +# $File: animation,v 1.68 2018/05/06 16:08:07 christos Exp $ # animation: file(1) magic for animation/movie formats # # animation formats @@ -56,20 +56,20 @@ >>11 byte 6 \b, Release 6 MBMS Extended Presentations >>11 byte 7 \b, Release 7 MBMS Extended Presentations >8 string 3gg \b, MPEG v4 system, 3GPP ->11 byte 6 \b, Release 6 General Profile !:mime video/3gpp +>>11 byte 6 \b, Release 6 General Profile >8 string 3gp \b, MPEG v4 system, 3GPP ->11 byte 1 \b, Release %d (non existent) ->11 byte 2 \b, Release %d (non existent) ->11 byte 3 \b, Release %d (non existent) ->11 byte 4 \b, Release %d ->11 byte 5 \b, Release %d ->11 byte 6 \b, Release %d ->11 byte 7 \b, Release %d Streaming Servers !:mime video/3gpp +>>11 byte 1 \b, Release %d (non existent) +>>11 byte 2 \b, Release %d (non existent) +>>11 byte 3 \b, Release %d (non existent) +>>11 byte 4 \b, Release %d +>>11 byte 5 \b, Release %d +>>11 byte 6 \b, Release %d +>>11 byte 7 \b, Release %d Streaming Servers >8 string 3gs \b, MPEG v4 system, 3GPP ->11 byte 7 \b, Release %d Streaming Servers !:mime video/3gpp +>>11 byte 7 \b, Release %d Streaming Servers >8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC [ISO 14496-12:2005] !:mime video/mp4 >8 string/W qt \b, Apple QuickTime movie @@ -188,6 +188,36 @@ >8 string pana \b, Panasonic Digital Camera >8 string qt \b, Apple QuickTime (.MOV/QT) !:mime video/quicktime +# HEIF image format +# see https://nokiatech.github.io/heif/technical.html +>8 string mif1 \b, HEIF Image +!:mime image/heif +>8 string msf1 \b, HEIF Image Sequence +!:mime image/heif-sequence +>8 string heic \b, HEIF Image HEVC Main or Main Still Picture Profile +!:mime image/heic +>8 string heix \b, HEIF Image HEVC Main 10 Profile +!:mime image/heic +>8 string hevc \b, HEIF Image Sequenz HEVC Main or Main Still Picture Profile +!:mime image/heic-sequence +>8 string hevx \b, HEIF Image Sequence HEVC Main 10 Profile +!:mime image/heic-sequence +# following HEIF brands are not mentioned in the heif technical info currently (Oct 2017) +# but used in the reference implementation: +# https://github.com/nokiatech/heif/blob/d5e9a21c8ba8df712bdf643021dd9f6518134776/Srcs/reader/hevcimagefilereader.cpp +>8 string heim \b, HEIF Image L-HEVC +!:mime image/heif +>8 string heis \b, HEIF Image L-HEVC +!:mime image/heif +>8 string avic \b, HEIF Image AVC +!:mime image/heif +>8 string hevm \b, HEIF Image Sequence L-HEVC +!:mime image/heif-sequence +>8 string hevs \b, HEIF Image Sequence L-HEVC +!:mime image/heif-sequence +>8 string avcs \b, HEIF Image Sequence AVC +!:mime image/heif-sequence + >8 string ROSS \b, Ross Video >8 string sdv \b, SD Memory Card Video >8 string ssc1 \b, Samsung stereo, single stream (patent pending) @@ -1027,3 +1057,10 @@ 0 string \x06\x0e\x2b\x34\x02\x05\x01\x01\x0d\x01\x02\x01\x01\x02 Material exchange container format !:ext mxf !:mime application/mxf + +# Recognize LucasArts Smush video files (cf. +# https://wiki.multimedia.cx/index.php/Smush) +0 string ANIM +>8 string AHDR LucasArts Smush Animation Format (SAN) video +0 string SANM +>8 string SHDR LucasArts Smush v2 (SANM) video Modified: stable/11/contrib/file/magic/Magdir/apple ============================================================================== --- stable/11/contrib/file/magic/Magdir/apple Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/magic/Magdir/apple Wed Aug 15 02:14:46 2018 (r337827) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: apple,v 1.36 2017/03/17 21:35:28 christos Exp $ +# $File: apple,v 1.39 2018/03/02 15:26:39 christos Exp $ # apple: file(1) magic for Apple file formats # 0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text @@ -431,3 +431,19 @@ >>>>0 use appleworks >0 belong 0x0481ad00 >>0 use appleworks + +# magic for Apple File System (APFS) +# from Alex Myczko +32 string NXSB Apple File System (APFS) +>36 ulelong x \b, blocksize %u + +# iTunes cover art (versions 1 and 2) +4 string itch +>24 string artw +>>0x1e8 string data iTunes cover art +>>>0x1ed string PNG (PNG) +>>>0x1ec beshort 0xffd8 (JPEG) + +# MacPaint image +65 string PNTGMPNT MacPaint image data +#0 belong 2 MacPaint image data Modified: stable/11/contrib/file/magic/Magdir/archive ============================================================================== --- stable/11/contrib/file/magic/Magdir/archive Wed Aug 15 01:29:02 2018 (r337826) +++ stable/11/contrib/file/magic/Magdir/archive Wed Aug 15 02:14:46 2018 (r337827) @@ -1,16 +1,151 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.108 2017/08/30 13:45:10 christos Exp $ +# $File: archive,v 1.119 2018/04/24 23:19:45 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # # cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc. -# pre-POSIX "tar" archives are handled in the C code. +# pre-POSIX "tar" archives are also handled in the C code ../../src/is_tar.c. # POSIX tar archives -257 string ustar\0 POSIX tar archive -!:mime application/x-tar # encoding: posix -257 string ustar\040\040\0 GNU tar archive -!:mime application/x-tar # encoding: gnu +# URL: https://en.wikipedia.org/wiki/Tar_(computing) +# Reference: https://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=FreeBSD+8-current +# header mainly padded with nul bytes +500 quad 0 +!:strength /2 +# filename or extended attribute printable strings in range space null til umlaut ue +>0 ubeshort >0x1F00 +>>0 ubeshort <0xFCFD +# last 4 header bytes often null but tar\0 in gtarfail2.tar gtarfail.tar-bad +# at https://sourceforge.net/projects/s-tar/files/testscripts/ +>>>508 ubelong&0x8B9E8DFF 0 +# nul, space or ascii digit 0-7 at start of mode +>>>>100 ubyte&0xC8 =0 +>>>>>101 ubyte&0xC8 =0 +# nul, space at end of check sum +>>>>>>155 ubyte&0xDF =0 +# space or ascii digit 0 at start of check sum +>>>>>>>148 ubyte&0xEF =0x20 +>>>>>>>>0 use tar-file +# minimal check and then display tar archive information which can also be +# embedded inside others like Android Backup, Clam AntiVirus database +0 name tar-file +>257 string !ustar +# header padded with nuls +>>257 ulong =0 +# GNU tar version 1.29 with non pax format option without refusing +# creates misleading V7 header for Long path, Multi-volume, Volume type +>>>156 ubyte 0x4c GNU tar archive +!:mime application/x-gtar +!:ext tar/gtar +>>>156 ubyte 0x4d GNU tar archive +!:mime application/x-gtar +!:ext tar/gtar +>>>156 ubyte 0x56 GNU tar archive +!:mime application/x-gtar +!:ext tar/gtar +>>>156 default x tar archive (V7) +!:mime application/x-tar +!:ext tar +# other stuff in padding +# some implementations add new fields to the blank area at the end of the header record +# created for example by DOS TAR 3.20g 1994 Tim V.Shapore with -j option +>>257 ulong !0 tar archive (old) +!:mime application/x-tar +!:ext tar +# magic in newer, GNU, posix variants +>257 string =ustar +# 2 last char of magic and UStar version because string expression does not work +# 2 space characters followed by a null for GNU variant +>>261 ubelong =0x72202000 POSIX tar archive (GNU) +!:mime application/x-gtar +!:ext tar/gtar +# UStar version with ASCII "00" +>>261 ubelong 0x72003030 POSIX +# gLOBAL and ExTENSION type only found in POSIX.1-2001 format +>>>156 ubyte 0x67 \b.1-2001 +>>>156 ubyte 0x78 \b.1-2001 +>>>156 ubyte x tar archive +!:mime application/x-ustar +!:ext tar/ustar +# version with 2 binary nuls embedded in Android Backup like com.android.settings.ab +>>261 ubelong 0x72000000 tar archive (ustar) +!:mime application/x-ustar +!:ext tar/ustar +# not seen ustar variant with garbish version +>>261 default x tar archive (unknown ustar) +!:mime application/x-ustar +!:ext tar/ustar +# type flag of 1st tar archive member +#>156 ubyte x \b, %c-type +>156 ubyte x +>>156 ubyte 0 \b, file +>>156 ubyte 0x30 \b, file +>>156 ubyte 0x31 \b, hard link +>>156 ubyte 0x32 \b, symlink +>>156 ubyte 0x33 \b, char device +>>156 ubyte 0x34 \b, block device +>>156 ubyte 0x35 \b, directory +>>156 ubyte 0x36 \b, fifo +>>156 ubyte 0x37 \b, reserved +>>156 ubyte 0x4c \b, long path +>>156 ubyte 0x4d \b, multi volume +>>156 ubyte 0x56 \b, volume +>>156 ubyte 0x67 \b, global +>>156 ubyte 0x78 \b, extension +>>156 default x \b, type +>>>156 ubyte x '%c' +# name[100] +>0 string >\0 %-.60s +# mode mainly stored as an octal number in ASCII null or space terminated +>100 string >\0 \b, mode %-.7s +# user id mainly as octal numbers in ASCII null or space terminated +>108 string >\0 \b, uid %-.7s +# group id mainly as octal numbers in ASCII null or space terminated +>116 string >\0 \b, gid %-.7s +# size mainly as octal number in ASCII +>124 ubyte <0x38 +>>124 string >\0 \b, size %-.12s +# coding indicated by setting the high-order bit of the leftmost byte +>124 ubyte >0xEF \b, size 0x +>>124 ubyte !0xff \b%2.2x +>>125 ubyte !0xff \b%2.2x +>>126 ubyte !0xff \b%2.2x +>>127 ubyte !0xff \b%2.2x +>>128 ubyte !0xff \b%2.2x +>>129 ubyte !0xff \b%2.2x +>>130 ubyte !0xff \b%2.2x +>>131 ubyte !0xff \b%2.2x +>>132 ubyte !0xff \b%2.2x +>>133 ubyte !0xff \b%2.2x +>>134 ubyte !0xff \b%2.2x +>>135 ubyte !0xff \b%2.2x +# seconds since 0:0:0 1 jan 1970 UTC as octal number mainly in ASCII null or space terminated +>136 string >\0 \b, seconds %-.11s +# header checksum stored as an octal number in ASCII null or space terminated +#>148 string x \b, cksum %.7s +# linkname[100] +>157 string >\0 \b, linkname %-.40s +# additional fields for ustar +>257 string =ustar +# owner user name null terminated +>>265 string >\0 \b, user %-.32s +# group name null terminated +>>297 string >\0 \b, group %-.32s +# device major minor if not zero *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 15 02:15: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 83B75106E770 for ; Wed, 15 Aug 2018 02:15:44 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3041E72F91 for ; Wed, 15 Aug 2018 02:15:44 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw1-f45.google.com (mail-yw1-f45.google.com [209.85.161.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)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id EE60E104EE for ; Wed, 15 Aug 2018 02:15:43 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw1-f45.google.com with SMTP id j68-v6so17810475ywg.1 for ; Tue, 14 Aug 2018 19:15:43 -0700 (PDT) X-Gm-Message-State: AOUpUlGMwoSToHkGQzZVMbYk5hGZpcBOSn9Don5XjZTRUspDLxeBh8tM Yvld2iJ3nL0z2CYIXvxgfSaTNKKlDwjtfsMh8e9dCw== X-Google-Smtp-Source: AA+uWPyr0fpjb0KGtW/i/Tu80rRZfcWOdtdVVtyJSe17zvzTFrR49Mn2VmPlszQ9x7Q1Yp1uDgbXJzdsWFPZnsCV4+4= X-Received: by 2002:a0d:e846:: with SMTP id r67-v6mr13923689ywe.19.1534299343335; Tue, 14 Aug 2018 19:15:43 -0700 (PDT) MIME-Version: 1.0 References: <201808080133.w781XaUM003779@repo.freebsd.org> In-Reply-To: From: Eitan Adler Date: Tue, 14 Aug 2018 19:15:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337442 - in head/contrib/file: . doc magic magic/Magdir python src tests To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 02:15:44 -0000 On Tue, 14 Aug 2018 at 14:37, Kyle Evans wrote: > > On Tue, Aug 7, 2018 at 8:33 PM, Eitan Adler wrote: > > Author: eadler > > Date: Wed Aug 8 01:33:36 2018 > > New Revision: 337442 > > URL: https://svnweb.freebsd.org/changeset/base/337442 > > > > Log: > > file: update to 5.34 > > > > PR: 230141 > > exp-run by: antoine > > > > Hi, > > Do you have any plans to MFC this and the previous update to stable/11? Done in 337827. I have no plans to MFC this to stable/10 -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Wed Aug 15 02:29: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 DA457106EC3A; Wed, 15 Aug 2018 02:29:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8107361D; Wed, 15 Aug 2018 02:29:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 2B42E10606; Wed, 15 Aug 2018 02:29:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f170.google.com with SMTP id j19-v6so16948612ljc.7; Tue, 14 Aug 2018 19:29:11 -0700 (PDT) X-Gm-Message-State: AOUpUlFyDLtf+dae+2qBUPEvFKl2GJAsaFYOsqTW/HywZgPEusSP4fQa fi1E3kCGPO8ZQXLfim5lRHVrJSpr8oRTQTb2VLk= X-Google-Smtp-Source: AA+uWPwKAxvK5FAFEYl11x1OWJxI46RtU35GA3AEM49sGE+8Ejh/yuNsPVKXOod6fVNqAVBp4DJBJqiWUBoVxC8N6uk= X-Received: by 2002:a2e:2e02:: with SMTP id u2-v6mr17649914lju.77.1534300149809; Tue, 14 Aug 2018 19:29:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Tue, 14 Aug 2018 19:28:49 -0700 (PDT) In-Reply-To: <201808150141.w7F1ft69045150@pdx.rh.CN85.dnsmgr.net> References: <201808150129.w7F1T23r064553@repo.freebsd.org> <201808150141.w7F1ft69045150@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Tue, 14 Aug 2018 21:28:49 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 02:29:12 -0000 On Tue, Aug 14, 2018 at 8:41 PM, Rodney W. Grimes wrote: >> Author: kevans >> Date: Wed Aug 15 01:29:02 2018 >> New Revision: 337826 >> URL: https://svnweb.freebsd.org/changeset/base/337826 >> >> Log: >> MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment >> >> COLORTERM is the de facto standard, while CLICOLOR is generally specific to >> FreeBSD and ls(1). > > I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" > Seems that the defaults for xfce terminal is to have COLORTERM. > Hmm? No one's pointed me at any such complaints, and I've not seen any seen pass by -- neither in response to the initial commit mail, or on -current@ Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Wed Aug 15 02:30: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 83C7F106ECD3; Wed, 15 Aug 2018 02:30:15 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33A6673765; Wed, 15 Aug 2018 02:30:15 +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 116CE24120; Wed, 15 Aug 2018 02:30:15 +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 w7F2UEUj095175; Wed, 15 Aug 2018 02:30:14 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F2UCxw095160; Wed, 15 Aug 2018 02:30:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808150230.w7F2UCxw095160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 15 Aug 2018 02:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r337828 - in releng: 11.1 11.1/contrib/wpa/src/rsn_supp 11.1/share/man/man4 11.1/sys/amd64/amd64 11.1/sys/amd64/vmm/intel 11.1/sys/conf 11.1/sys/netinet 11.1/sys/netinet6 11.1/sys/vm 11... X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in releng: 11.1 11.1/contrib/wpa/src/rsn_supp 11.1/share/man/man4 11.1/sys/amd64/amd64 11.1/sys/amd64/vmm/intel 11.1/sys/conf 11.1/sys/netinet 11.1/sys/netinet6 11.1/sys/vm 11.1/sys/x86/include 11.2 1... X-SVN-Commit-Revision: 337828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 02:30:16 -0000 Author: delphij Date: Wed Aug 15 02:30:11 2018 New Revision: 337828 URL: https://svnweb.freebsd.org/changeset/base/337828 Log: Revis manual pages. [SA-18:08.tcp] Fix L1 Terminal Fault (L1TF) kernel information disclosure. [SA-18:09.l1tf] Fix resource exhaustion in IP fragment reassembly. [SA-18:10.ip] Fix unauthenticated EAPOL-Key decryption vulnerability. [SA-18:11.hostapd] Approved by: so Modified: releng/11.1/UPDATING releng/11.1/contrib/wpa/src/rsn_supp/wpa.c releng/11.1/share/man/man4/inet.4 releng/11.1/share/man/man4/inet6.4 releng/11.1/share/man/man4/tcp.4 releng/11.1/sys/amd64/amd64/pmap.c releng/11.1/sys/amd64/vmm/intel/vmx.c releng/11.1/sys/amd64/vmm/intel/vmx_genassym.c releng/11.1/sys/amd64/vmm/intel/vmx_support.S releng/11.1/sys/conf/newvers.sh releng/11.1/sys/netinet/ip_reass.c releng/11.1/sys/netinet6/frag6.c releng/11.1/sys/netinet6/in6.h releng/11.1/sys/netinet6/in6_proto.c releng/11.1/sys/netinet6/ip6_var.h releng/11.1/sys/vm/vm_page.c releng/11.1/sys/vm/vm_page.h releng/11.1/sys/x86/include/specialreg.h releng/11.2/UPDATING releng/11.2/contrib/wpa/src/rsn_supp/wpa.c releng/11.2/share/man/man4/inet.4 releng/11.2/share/man/man4/inet6.4 releng/11.2/share/man/man4/tcp.4 releng/11.2/sys/amd64/amd64/pmap.c releng/11.2/sys/amd64/vmm/intel/vmx.c releng/11.2/sys/amd64/vmm/intel/vmx_genassym.c releng/11.2/sys/amd64/vmm/intel/vmx_support.S releng/11.2/sys/conf/newvers.sh releng/11.2/sys/netinet/ip_reass.c releng/11.2/sys/netinet6/frag6.c releng/11.2/sys/netinet6/in6.h releng/11.2/sys/netinet6/in6_proto.c releng/11.2/sys/netinet6/ip6_var.h releng/11.2/sys/x86/include/specialreg.h Modified: releng/11.1/UPDATING ============================================================================== --- releng/11.1/UPDATING Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/UPDATING Wed Aug 15 02:30:11 2018 (r337828) @@ -16,6 +16,21 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20180814 p13 FreeBSD-SA-18:08.tcp [revised] + FreeBSD-SA-18:09.l1tf + FreeBSD-SA-18:10.ip + FreeBSD-SA-18:11.hostapd + + Revise manual pages. [SA-18:08.tcp] + + Fix L1 Terminal Fault (L1TF) kernel information disclosure. + [SA-18:09.l1tf] + + Fix resource exhaustion in IP fragment reassembly. [SA-18:10.ip] + + Fix unauthenticated EAPOL-Key decryption vulnerability. + [SA-18:11.hostapd] + 20180806 p12 FreeBSD-SA-18:08.tcp Fix resource exhaustion in TCP reassembly. Modified: releng/11.1/contrib/wpa/src/rsn_supp/wpa.c ============================================================================== --- releng/11.1/contrib/wpa/src/rsn_supp/wpa.c Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/contrib/wpa/src/rsn_supp/wpa.c Wed Aug 15 02:30:11 2018 (r337828) @@ -2027,6 +2027,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_a if ((sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) { + /* + * Only decrypt the Key Data field if the frame's authenticity + * was verified. When using AES-SIV (FILS), the MIC flag is not + * set, so this check should only be performed if mic_len != 0 + * which is the case in this code branch. + */ + if (!(key_info & WPA_KEY_INFO_MIC)) { + wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, + "WPA: Ignore EAPOL-Key with encrypted but unauthenticated data"); + goto out; + } if (wpa_supplicant_decrypt_key_data(sm, key, ver, key_data, &key_data_len)) goto out; Modified: releng/11.1/share/man/man4/inet.4 ============================================================================== --- releng/11.1/share/man/man4/inet.4 Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/share/man/man4/inet.4 Wed Aug 15 02:30:11 2018 (r337828) @@ -28,7 +28,7 @@ .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd Feb 4, 2016 +.Dd August 14, 2018 .Dt INET 4 .Os .Sh NAME @@ -229,15 +229,38 @@ At the same time, on high-speed links, it can decrease cycle greatly. Default is 0 (sequential IP IDs). IPv6 flow IDs and fragment IDs are always random. +.It Va ip.maxfrags +Integer: maximum number of fragments the host will accept and simultaneously +hold across all reassembly queues in all VNETs. +If set to 0, reassembly is disabled. +If set to -1, this limit is not applied. +This limit is recalculated when the number of mbuf clusters is changed. +This is a global limit. .It Va ip.maxfragpackets -Integer: maximum number of fragmented packets the host will accept and hold -in the reassembling queue simultaneously. -0 means that the host will not accept any fragmented packets. -\-1 means that the host will accept as many fragmented packets as it receives. +Integer: maximum number of fragmented packets the host will accept and +simultaneously hold in the reassembly queue for a particular VNET. +0 means that the host will not accept any fragmented packets for that VNET. +\-1 means that the host will not apply this limit for that VNET. +This limit is recalculated when the number of mbuf clusters is changed. +This is a per-VNET limit. +.It Va ip.maxfragbucketsize +Integer: maximum number of reassembly queues per bucket. +Fragmented packets are hashed to buckets. +Each bucket has a list of reassembly queues. +The system must compare the incoming packets to the existing reassembly queues +in the bucket to find a matching reassembly queue. +To preserve system resources, the system limits the number of reassembly +queues allowed in each bucket. +This limit is recalculated when the number of mbuf clusters is changed or +when the value of +.Va ip.maxfragpackets +changes. +This is a per-VNET limit. .It Va ip.maxfragsperpacket Integer: maximum number of fragments the host will accept and hold -in the reassembling queue for a packet. -0 means that the host will not accept any fragmented packets. +in the reassembly queue for a packet. +0 means that the host will not accept any fragmented packets for the VNET. +This is a per-VNET limit. .El .Sh SEE ALSO .Xr ioctl 2 , Modified: releng/11.1/share/man/man4/inet6.4 ============================================================================== --- releng/11.1/share/man/man4/inet6.4 Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/share/man/man4/inet6.4 Wed Aug 15 02:30:11 2018 (r337828) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2009 +.Dd August 14, 2018 .Dt INET6 4 .Os .Sh NAME @@ -219,12 +219,41 @@ packets. This value applies to all the transport protocols on top of .Tn IPv6 . There are APIs to override the value. +.It Dv IPV6CTL_MAXFRAGS +.Pq ip6.maxfrags +Integer: maximum number of fragments the host will accept and simultaneously +hold across all reassembly queues in all VNETs. +If set to 0, fragment reassembly is disabled. +If set to -1, this limit is not applied. +This limit is recalculated when the number of mbuf clusters is changed. +This is a global limit. .It Dv IPV6CTL_MAXFRAGPACKETS .Pq ip6.maxfragpackets -Integer: default maximum number of fragmented packets the node will accept. -0 means that the node will not accept any fragmented packets. --1 means that the node will accept as many fragmented packets as it receives. -The flag is provided basically for avoiding possible DoS attacks. +Integer: maximum number of fragmented packets the node will accept and +simultaneously hold in the reassembly queue for a particular VNET. +0 means that the node will not accept any fragmented packets for that VNET. +-1 means that the node will not apply this limit for that VNET. +This limit is recalculated when the number of mbuf clusters is changed. +This is a per-VNET limit. +.It Dv IPV6CTL_MAXFRAGBUCKETSIZE +.Pq ip6.maxfragbucketsize +Integer: maximum number of reassembly queues per bucket. +Fragmented packets are hashed to buckets. +Each bucket has a list of reassembly queues. +The system must compare the incoming packets to the existing reassembly queues +in the bucket to find a matching reassembly queue. +To preserve system resources, the system limits the number of reassembly +queues allowed in each bucket. +This limit is recalculated when the number of mbuf clusters is changed or +when the value of +.Va ip6.maxfragpackets +changes. +This is a per-VNET limit. +.It Dv IPV6CTL_MAXFRAGSPERPACKET +.Pq ip6.maxfragsperpacket +Integer: maximum number of fragments the host will accept and hold in the +ressembly queue for a packet. +This is a per-VNET limit. .It Dv IPV6CTL_ACCEPT_RTADV .Pq ip6.accept_rtadv Boolean: the default value of a per-interface flag to Modified: releng/11.1/share/man/man4/tcp.4 ============================================================================== --- releng/11.1/share/man/man4/tcp.4 Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/share/man/man4/tcp.4 Wed Aug 15 02:30:11 2018 (r337828) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 6, 2017 +.Dd August 6, 2018 .Dt TCP 4 .Os .Sh NAME Modified: releng/11.1/sys/amd64/amd64/pmap.c ============================================================================== --- releng/11.1/sys/amd64/amd64/pmap.c Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/sys/amd64/amd64/pmap.c Wed Aug 15 02:30:11 2018 (r337828) @@ -1206,6 +1206,9 @@ pmap_init(void) vm_size_t s; int error, i, pv_npg; + /* L1TF, reserve page @0 unconditionally */ + vm_page_blacklist_add(0, bootverbose); + /* * Initialize the vm page array entries for the kernel pmap's * page table pages. Modified: releng/11.1/sys/amd64/vmm/intel/vmx.c ============================================================================== --- releng/11.1/sys/amd64/vmm/intel/vmx.c Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/sys/amd64/vmm/intel/vmx.c Wed Aug 15 02:30:11 2018 (r337828) @@ -183,6 +183,12 @@ static u_int vpid_alloc_failed; SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_alloc_failed, CTLFLAG_RD, &vpid_alloc_failed, 0, NULL); +static int guest_l1d_flush; +SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush, CTLFLAG_RD, + &guest_l1d_flush, 0, NULL); + +uint64_t vmx_msr_flush_cmd; + /* * Use the last page below 4GB as the APIC access address. This address is * occupied by the boot firmware so it is guaranteed that it will not conflict @@ -717,6 +723,12 @@ vmx_init(int ipinum) printf("vmx_init: ept initialization failed (%d)\n", error); return (error); } + + guest_l1d_flush = (cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) == 0; + TUNABLE_INT_FETCH("hw.vmm.l1d_flush", &guest_l1d_flush); + if (guest_l1d_flush && + (cpu_stdext_feature3 & CPUID_STDEXT3_L1D_FLUSH) != 0) + vmx_msr_flush_cmd = IA32_FLUSH_CMD_L1D; /* * Stash the cr0 and cr4 bits that must be fixed to 0 or 1 Modified: releng/11.1/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- releng/11.1/sys/amd64/vmm/intel/vmx_genassym.c Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/sys/amd64/vmm/intel/vmx_genassym.c Wed Aug 15 02:30:11 2018 (r337828) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "vmx_cpufunc.h" @@ -86,3 +87,6 @@ ASSYM(PM_EPTGEN, offsetof(struct pmap, pm_eptgen)); ASSYM(KERNEL_SS, GSEL(GDATA_SEL, SEL_KPL)); ASSYM(KERNEL_CS, GSEL(GCODE_SEL, SEL_KPL)); + +ASSYM(PAGE_SIZE, PAGE_SIZE); +ASSYM(KERNBASE, KERNBASE); Modified: releng/11.1/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- releng/11.1/sys/amd64/vmm/intel/vmx_support.S Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/sys/amd64/vmm/intel/vmx_support.S Wed Aug 15 02:30:11 2018 (r337828) @@ -28,6 +28,7 @@ */ #include +#include #include "vmx_assym.h" @@ -136,9 +137,47 @@ ENTRY(vmx_enter_guest) jbe invept_error /* Check invept instruction error */ guest_restore: - cmpl $0, %edx - je do_launch + /* + * Flush L1D cache if requested. Use IA32_FLUSH_CMD MSR if available, + * otherwise load enough of the data from the zero_region to flush + * existing L1D content. + */ +#define L1D_FLUSH_SIZE (64 * 1024) + movl %edx, %r8d + cmpb $0, guest_l1d_flush(%rip) + je after_l1d + movq vmx_msr_flush_cmd(%rip), %rax + testq %rax, %rax + jz 1f + movq %rax, %rdx + shrq $32, %rdx + movl $MSR_IA32_FLUSH_CMD, %ecx + wrmsr + jmp after_l1d +1: movq $KERNBASE, %r9 + movq $-L1D_FLUSH_SIZE, %rcx + /* + * pass 1: Preload TLB. + * Kernel text is mapped using superpages. TLB preload is + * done for the benefit of older CPUs which split 2M page + * into 4k TLB entries. + */ +2: movb L1D_FLUSH_SIZE(%r9, %rcx), %al + addq $PAGE_SIZE, %rcx + jne 2b + xorl %eax, %eax + cpuid + movq $-L1D_FLUSH_SIZE, %rcx + /* pass 2: Read each cache line */ +3: movb L1D_FLUSH_SIZE(%r9, %rcx), %al + addq $64, %rcx + jne 3b + lfence +#undef L1D_FLUSH_SIZE +after_l1d: + cmpl $0, %r8d + je do_launch VMX_GUEST_RESTORE vmresume /* Modified: releng/11.1/sys/conf/newvers.sh ============================================================================== --- releng/11.1/sys/conf/newvers.sh Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/sys/conf/newvers.sh Wed Aug 15 02:30:11 2018 (r337828) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.1" -BRANCH="RELEASE-p12" +BRANCH="RELEASE-p13" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.1/sys/netinet/ip_reass.c ============================================================================== --- releng/11.1/sys/netinet/ip_reass.c Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/sys/netinet/ip_reass.c Wed Aug 15 02:30:11 2018 (r337828) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,13 +64,14 @@ SYSCTL_DECL(_net_inet_ip); /* * Reassembly headers are stored in hash buckets. */ -#define IPREASS_NHASH_LOG2 6 +#define IPREASS_NHASH_LOG2 10 #define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2) #define IPREASS_HMASK (IPREASS_NHASH - 1) struct ipqbucket { TAILQ_HEAD(ipqhead, ipq) head; struct mtx lock; + int count; }; static VNET_DEFINE(struct ipqbucket, ipq[IPREASS_NHASH]); @@ -82,6 +84,9 @@ static VNET_DEFINE(uint32_t, ipq_hashseed); #define IPQ_UNLOCK(i) mtx_unlock(&V_ipq[i].lock) #define IPQ_LOCK_ASSERT(i) mtx_assert(&V_ipq[i].lock, MA_OWNED) +static VNET_DEFINE(int, ipreass_maxbucketsize); +#define V_ipreass_maxbucketsize VNET(ipreass_maxbucketsize) + void ipreass_init(void); void ipreass_drain(void); void ipreass_slowtimo(void); @@ -89,27 +94,53 @@ void ipreass_slowtimo(void); void ipreass_destroy(void); #endif static int sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS); +static int sysctl_maxfragbucketsize(SYSCTL_HANDLER_ARGS); static void ipreass_zone_change(void *); static void ipreass_drain_tomax(void); -static void ipq_free(struct ipqhead *, struct ipq *); +static void ipq_free(struct ipqbucket *, struct ipq *); static struct ipq * ipq_reuse(int); static inline void -ipq_timeout(struct ipqhead *head, struct ipq *fp) +ipq_timeout(struct ipqbucket *bucket, struct ipq *fp) { IPSTAT_ADD(ips_fragtimeout, fp->ipq_nfrags); - ipq_free(head, fp); + ipq_free(bucket, fp); } static inline void -ipq_drop(struct ipqhead *head, struct ipq *fp) +ipq_drop(struct ipqbucket *bucket, struct ipq *fp) { IPSTAT_ADD(ips_fragdropped, fp->ipq_nfrags); - ipq_free(head, fp); + ipq_free(bucket, fp); } +/* + * By default, limit the number of IP fragments across all reassembly + * queues to 1/32 of the total number of mbuf clusters. + * + * Limit the total number of reassembly queues per VNET to the + * IP fragment limit, but ensure the limit will not allow any bucket + * to grow above 100 items. (The bucket limit is + * IP_MAXFRAGPACKETS / (IPREASS_NHASH / 2), so the 50 is the correct + * multiplier to reach a 100-item limit.) + * The 100-item limit was chosen as brief testing seems to show that + * this produces "reasonable" performance on some subset of systems + * under DoS attack. + */ +#define IP_MAXFRAGS (nmbclusters / 32) +#define IP_MAXFRAGPACKETS (imin(IP_MAXFRAGS, IPREASS_NHASH * 50)) + +static int maxfrags; +static volatile u_int nfrags; +SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfrags, CTLFLAG_RW, + &maxfrags, 0, + "Maximum number of IPv4 fragments allowed across all reassembly queues"); +SYSCTL_UINT(_net_inet_ip, OID_AUTO, curfrags, CTLFLAG_RD, + __DEVOLATILE(u_int *, &nfrags), 0, + "Current number of IPv4 fragments across all reassembly queues"); + static VNET_DEFINE(uma_zone_t, ipq_zone); #define V_ipq_zone VNET(ipq_zone) SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragpackets, CTLFLAG_VNET | @@ -127,6 +158,10 @@ static VNET_DEFINE(int, maxfragsperpacket); SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(maxfragsperpacket), 0, "Maximum number of IPv4 fragments allowed per packet"); +SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragbucketsize, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, + sysctl_maxfragbucketsize, "I", + "Maximum number of IPv4 fragment reassembly queue entries per bucket"); /* * Take incoming datagram fragment and try to reassemble it into @@ -146,9 +181,9 @@ ip_reass(struct mbuf *m) struct mbuf *p, *q, *nq, *t; struct ipq *fp; struct ipqhead *head; - int i, hlen, next; + int i, hlen, next, tmpmax; u_int8_t ecn, ecn0; - uint32_t hash; + uint32_t hash, hashkey[3]; #ifdef RSS uint32_t rss_hash, rss_type; #endif @@ -156,8 +191,12 @@ ip_reass(struct mbuf *m) /* * If no reassembling or maxfragsperpacket are 0, * never accept fragments. + * Also, drop packet if it would exceed the maximum + * number of fragments. */ - if (V_noreass == 1 || V_maxfragsperpacket == 0) { + tmpmax = maxfrags; + if (V_noreass == 1 || V_maxfragsperpacket == 0 || + (tmpmax >= 0 && nfrags >= (u_int)tmpmax)) { IPSTAT_INC(ips_fragments); IPSTAT_INC(ips_fragdropped); m_freem(m); @@ -202,8 +241,12 @@ ip_reass(struct mbuf *m) m->m_data += hlen; m->m_len -= hlen; - hash = ip->ip_src.s_addr ^ ip->ip_id; - hash = jenkins_hash32(&hash, 1, V_ipq_hashseed) & IPREASS_HMASK; + hashkey[0] = ip->ip_src.s_addr; + hashkey[1] = ip->ip_dst.s_addr; + hashkey[2] = (uint32_t)ip->ip_p << 16; + hashkey[2] += ip->ip_id; + hash = jenkins_hash32(hashkey, nitems(hashkey), V_ipq_hashseed); + hash &= IPREASS_HMASK; head = &V_ipq[hash].head; IPQ_LOCK(hash); @@ -224,9 +267,12 @@ ip_reass(struct mbuf *m) * If first fragment to arrive, create a reassembly queue. */ if (fp == NULL) { - fp = uma_zalloc(V_ipq_zone, M_NOWAIT); + if (V_ipq[hash].count < V_ipreass_maxbucketsize) + fp = uma_zalloc(V_ipq_zone, M_NOWAIT); if (fp == NULL) fp = ipq_reuse(hash); + if (fp == NULL) + goto dropfrag; #ifdef MAC if (mac_ipq_init(fp, M_NOWAIT) != 0) { uma_zfree(V_ipq_zone, fp); @@ -236,7 +282,9 @@ ip_reass(struct mbuf *m) mac_ipq_create(m, fp); #endif TAILQ_INSERT_HEAD(head, fp, ipq_list); + V_ipq[hash].count++; fp->ipq_nfrags = 1; + atomic_add_int(&nfrags, 1); fp->ipq_ttl = IPFRAGTTL; fp->ipq_p = ip->ip_p; fp->ipq_id = ip->ip_id; @@ -247,6 +295,7 @@ ip_reass(struct mbuf *m) goto done; } else { fp->ipq_nfrags++; + atomic_add_int(&nfrags, 1); #ifdef MAC mac_ipq_update(m, fp); #endif @@ -323,6 +372,7 @@ ip_reass(struct mbuf *m) m->m_nextpkt = nq; IPSTAT_INC(ips_fragdropped); fp->ipq_nfrags--; + atomic_subtract_int(&nfrags, 1); m_freem(q); } @@ -340,7 +390,7 @@ ip_reass(struct mbuf *m) for (p = NULL, q = fp->ipq_frags; q; p = q, q = q->m_nextpkt) { if (ntohs(GETIP(q)->ip_off) != next) { if (fp->ipq_nfrags > V_maxfragsperpacket) - ipq_drop(head, fp); + ipq_drop(&V_ipq[hash], fp); goto done; } next += ntohs(GETIP(q)->ip_len); @@ -348,7 +398,7 @@ ip_reass(struct mbuf *m) /* Make sure the last packet didn't have the IP_MF flag */ if (p->m_flags & M_IP_FRAG) { if (fp->ipq_nfrags > V_maxfragsperpacket) - ipq_drop(head, fp); + ipq_drop(&V_ipq[hash], fp); goto done; } @@ -359,7 +409,7 @@ ip_reass(struct mbuf *m) ip = GETIP(q); if (next + (ip->ip_hl << 2) > IP_MAXPACKET) { IPSTAT_INC(ips_toolong); - ipq_drop(head, fp); + ipq_drop(&V_ipq[hash], fp); goto done; } @@ -387,6 +437,7 @@ ip_reass(struct mbuf *m) while (m->m_pkthdr.csum_data & 0xffff0000) m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16); + atomic_subtract_int(&nfrags, fp->ipq_nfrags); #ifdef MAC mac_ipq_reassemble(fp, m); mac_ipq_destroy(fp); @@ -401,6 +452,7 @@ ip_reass(struct mbuf *m) ip->ip_src = fp->ipq_src; ip->ip_dst = fp->ipq_dst; TAILQ_REMOVE(head, fp, ipq_list); + V_ipq[hash].count--; uma_zfree(V_ipq_zone, fp); m->m_len += (ip->ip_hl << 2); m->m_data -= (ip->ip_hl << 2); @@ -446,8 +498,10 @@ ip_reass(struct mbuf *m) dropfrag: IPSTAT_INC(ips_fragdropped); - if (fp != NULL) + if (fp != NULL) { fp->ipq_nfrags--; + atomic_subtract_int(&nfrags, 1); + } m_freem(m); done: IPQ_UNLOCK(hash); @@ -462,21 +516,27 @@ done: void ipreass_init(void) { + int max; for (int i = 0; i < IPREASS_NHASH; i++) { TAILQ_INIT(&V_ipq[i].head); mtx_init(&V_ipq[i].lock, "IP reassembly", NULL, MTX_DEF | MTX_DUPOK); + V_ipq[i].count = 0; } V_ipq_hashseed = arc4random(); V_maxfragsperpacket = 16; V_ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - uma_zone_set_max(V_ipq_zone, nmbclusters / 32); + max = IP_MAXFRAGPACKETS; + max = uma_zone_set_max(V_ipq_zone, max); + V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { + maxfrags = IP_MAXFRAGS; EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change, NULL, EVENTHANDLER_PRI_ANY); + } } /* @@ -491,7 +551,7 @@ ipreass_slowtimo(void) IPQ_LOCK(i); TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, tmp) if (--fp->ipq_ttl == 0) - ipq_timeout(&V_ipq[i].head, fp); + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } } @@ -506,7 +566,10 @@ ipreass_drain(void) for (int i = 0; i < IPREASS_NHASH; i++) { IPQ_LOCK(i); while(!TAILQ_EMPTY(&V_ipq[i].head)) - ipq_drop(&V_ipq[i].head, TAILQ_FIRST(&V_ipq[i].head)); + ipq_drop(&V_ipq[i], TAILQ_FIRST(&V_ipq[i].head)); + KASSERT(V_ipq[i].count == 0, + ("%s: V_ipq[%d] count %d (V_ipq=%p)", __func__, i, + V_ipq[i].count, V_ipq)); IPQ_UNLOCK(i); } } @@ -534,9 +597,23 @@ ipreass_destroy(void) static void ipreass_drain_tomax(void) { + struct ipq *fp; int target; /* + * Make sure each bucket is under the new limit. If + * necessary, drop enough of the oldest elements from + * each bucket to get under the new limit. + */ + for (int i = 0; i < IPREASS_NHASH; i++) { + IPQ_LOCK(i); + while (V_ipq[i].count > V_ipreass_maxbucketsize && + (fp = TAILQ_LAST(&V_ipq[i].head, ipqhead)) != NULL) + ipq_timeout(&V_ipq[i], fp); + IPQ_UNLOCK(i); + } + + /* * If we are over the maximum number of fragments, * drain off enough to get down to the new limit, * stripping off last elements on queues. Every @@ -544,13 +621,11 @@ ipreass_drain_tomax(void) */ target = uma_zone_get_max(V_ipq_zone); while (uma_zone_get_cur(V_ipq_zone) > target) { - struct ipq *fp; - for (int i = 0; i < IPREASS_NHASH; i++) { IPQ_LOCK(i); fp = TAILQ_LAST(&V_ipq[i].head, ipqhead); if (fp != NULL) - ipq_timeout(&V_ipq[i].head, fp); + ipq_timeout(&V_ipq[i], fp); IPQ_UNLOCK(i); } } @@ -559,9 +634,20 @@ ipreass_drain_tomax(void) static void ipreass_zone_change(void *tag) { + VNET_ITERATOR_DECL(vnet_iter); + int max; - uma_zone_set_max(V_ipq_zone, nmbclusters / 32); - ipreass_drain_tomax(); + maxfrags = IP_MAXFRAGS; + max = IP_MAXFRAGPACKETS; + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + max = uma_zone_set_max(V_ipq_zone, max); + V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); + ipreass_drain_tomax(); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK_NOSLEEP(); } /* @@ -589,6 +675,7 @@ sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS) * and place an extreme upper bound. */ max = uma_zone_set_max(V_ipq_zone, max); + V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); ipreass_drain_tomax(); V_noreass = 0; } else if (max == 0) { @@ -597,6 +684,7 @@ sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS) } else if (max == -1) { V_noreass = 0; uma_zone_set_max(V_ipq_zone, 0); + V_ipreass_maxbucketsize = INT_MAX; } else return (EINVAL); return (0); @@ -610,49 +698,72 @@ static struct ipq * ipq_reuse(int start) { struct ipq *fp; - int i; + int bucket, i; IPQ_LOCK_ASSERT(start); - for (i = start;; i++) { - if (i == IPREASS_NHASH) - i = 0; - if (i != start && IPQ_TRYLOCK(i) == 0) + for (i = 0; i < IPREASS_NHASH; i++) { + bucket = (start + i) % IPREASS_NHASH; + if (bucket != start && IPQ_TRYLOCK(bucket) == 0) continue; - fp = TAILQ_LAST(&V_ipq[i].head, ipqhead); + fp = TAILQ_LAST(&V_ipq[bucket].head, ipqhead); if (fp) { struct mbuf *m; IPSTAT_ADD(ips_fragtimeout, fp->ipq_nfrags); + atomic_subtract_int(&nfrags, fp->ipq_nfrags); while (fp->ipq_frags) { m = fp->ipq_frags; fp->ipq_frags = m->m_nextpkt; m_freem(m); } - TAILQ_REMOVE(&V_ipq[i].head, fp, ipq_list); - if (i != start) - IPQ_UNLOCK(i); - IPQ_LOCK_ASSERT(start); - return (fp); + TAILQ_REMOVE(&V_ipq[bucket].head, fp, ipq_list); + V_ipq[bucket].count--; + if (bucket != start) + IPQ_UNLOCK(bucket); + break; } - if (i != start) - IPQ_UNLOCK(i); + if (bucket != start) + IPQ_UNLOCK(bucket); } + IPQ_LOCK_ASSERT(start); + return (fp); } /* * Free a fragment reassembly header and all associated datagrams. */ static void -ipq_free(struct ipqhead *fhp, struct ipq *fp) +ipq_free(struct ipqbucket *bucket, struct ipq *fp) { struct mbuf *q; + atomic_subtract_int(&nfrags, fp->ipq_nfrags); while (fp->ipq_frags) { q = fp->ipq_frags; fp->ipq_frags = q->m_nextpkt; m_freem(q); } - TAILQ_REMOVE(fhp, fp, ipq_list); + TAILQ_REMOVE(&bucket->head, fp, ipq_list); + bucket->count--; uma_zfree(V_ipq_zone, fp); +} + +/* + * Get or set the maximum number of reassembly queues per bucket. + */ +static int +sysctl_maxfragbucketsize(SYSCTL_HANDLER_ARGS) +{ + int error, max; + + max = V_ipreass_maxbucketsize; + error = sysctl_handle_int(oidp, &max, 0, req); + if (error || !req->newptr) + return (error); + if (max <= 0) + return (EINVAL); + V_ipreass_maxbucketsize = max; + ipreass_drain_tomax(); + return (0); } Modified: releng/11.1/sys/netinet6/frag6.c ============================================================================== --- releng/11.1/sys/netinet6/frag6.c Wed Aug 15 02:14:46 2018 (r337827) +++ releng/11.1/sys/netinet6/frag6.c Wed Aug 15 02:30:11 2018 (r337828) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -63,58 +66,110 @@ __FBSDID("$FreeBSD$"); #include -static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *); -static void frag6_deq(struct ip6asfrag *); -static void frag6_insque(struct ip6q *, struct ip6q *); -static void frag6_remque(struct ip6q *); -static void frag6_freef(struct ip6q *); - -static struct mtx ip6qlock; /* - * These fields all protected by ip6qlock. + * Reassembly headers are stored in hash buckets. */ -static VNET_DEFINE(u_int, frag6_nfragpackets); -static VNET_DEFINE(u_int, frag6_nfrags); -static VNET_DEFINE(struct ip6q, ip6q); /* ip6 reassemble queue */ +#define IP6REASS_NHASH_LOG2 10 +#define IP6REASS_NHASH (1 << IP6REASS_NHASH_LOG2) +#define IP6REASS_HMASK (IP6REASS_NHASH - 1) +static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *, + uint32_t bucket __unused); +static void frag6_deq(struct ip6asfrag *, uint32_t bucket __unused); +static void frag6_insque_head(struct ip6q *, struct ip6q *, + uint32_t bucket); +static void frag6_remque(struct ip6q *, uint32_t bucket); +static void frag6_freef(struct ip6q *, uint32_t bucket); + +struct ip6qbucket { + struct ip6q ip6q; + struct mtx lock; + int count; +}; + +static VNET_DEFINE(volatile u_int, frag6_nfragpackets); +volatile u_int frag6_nfrags = 0; +static VNET_DEFINE(struct ip6qbucket, ip6q[IP6REASS_NHASH]); +static VNET_DEFINE(uint32_t, ip6q_hashseed); + #define V_frag6_nfragpackets VNET(frag6_nfragpackets) -#define V_frag6_nfrags VNET(frag6_nfrags) #define V_ip6q VNET(ip6q) +#define V_ip6q_hashseed VNET(ip6q_hashseed) -#define IP6Q_LOCK_INIT() mtx_init(&ip6qlock, "ip6qlock", NULL, MTX_DEF); -#define IP6Q_LOCK() mtx_lock(&ip6qlock) -#define IP6Q_TRYLOCK() mtx_trylock(&ip6qlock) -#define IP6Q_LOCK_ASSERT() mtx_assert(&ip6qlock, MA_OWNED) -#define IP6Q_UNLOCK() mtx_unlock(&ip6qlock) +#define IP6Q_LOCK(i) mtx_lock(&V_ip6q[(i)].lock) +#define IP6Q_TRYLOCK(i) mtx_trylock(&V_ip6q[(i)].lock) +#define IP6Q_LOCK_ASSERT(i) mtx_assert(&V_ip6q[(i)].lock, MA_OWNED) +#define IP6Q_UNLOCK(i) mtx_unlock(&V_ip6q[(i)].lock) +#define IP6Q_HEAD(i) (&V_ip6q[(i)].ip6q) static MALLOC_DEFINE(M_FTABLE, "fragment", "fragment reassembly header"); /* + * By default, limit the number of IP6 fragments across all reassembly + * queues to 1/32 of the total number of mbuf clusters. + * + * Limit the total number of reassembly queues per VNET to the + * IP6 fragment limit, but ensure the limit will not allow any bucket + * to grow above 100 items. (The bucket limit is + * IP_MAXFRAGPACKETS / (IPREASS_NHASH / 2), so the 50 is the correct + * multiplier to reach a 100-item limit.) + * The 100-item limit was chosen as brief testing seems to show that + * this produces "reasonable" performance on some subset of systems + * under DoS attack. + */ +#define IP6_MAXFRAGS (nmbclusters / 32) +#define IP6_MAXFRAGPACKETS (imin(IP6_MAXFRAGS, IP6REASS_NHASH * 50)) + +/* * Initialise reassembly queue and fragment identifier. */ +void +frag6_set_bucketsize() +{ + int i; + + if ((i = V_ip6_maxfragpackets) > 0) + V_ip6_maxfragbucketsize = imax(i / (IP6REASS_NHASH / 2), 1); +} + static void frag6_change(void *tag) { + VNET_ITERATOR_DECL(vnet_iter); - V_ip6_maxfragpackets = nmbclusters / 4; - V_ip6_maxfrags = nmbclusters / 4; + ip6_maxfrags = IP6_MAXFRAGS; + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_ip6_maxfragpackets = IP6_MAXFRAGPACKETS; + frag6_set_bucketsize(); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK_NOSLEEP(); } void frag6_init(void) { + struct ip6q *q6; + int i; - V_ip6_maxfragpackets = nmbclusters / 4; - V_ip6_maxfrags = nmbclusters / 4; - V_ip6q.ip6q_next = V_ip6q.ip6q_prev = &V_ip6q; - + V_ip6_maxfragpackets = IP6_MAXFRAGPACKETS; + frag6_set_bucketsize(); + for (i = 0; i < IP6REASS_NHASH; i++) { + q6 = IP6Q_HEAD(i); + q6->ip6q_next = q6->ip6q_prev = q6; + mtx_init(&V_ip6q[i].lock, "ip6qlock", NULL, MTX_DEF); + V_ip6q[i].count = 0; + } + V_ip6q_hashseed = arc4random(); + V_ip6_maxfragsperpacket = 64; if (!IS_DEFAULT_VNET(curvnet)) return; + ip6_maxfrags = IP6_MAXFRAGS; EVENTHANDLER_REGISTER(nmbclusters_change, frag6_change, NULL, EVENTHANDLER_PRI_ANY); - - IP6Q_LOCK_INIT(); } /* @@ -155,12 +210,13 @@ frag6_input(struct mbuf **mp, int *offp, int proto) struct mbuf *m = *mp, *t; struct ip6_hdr *ip6; struct ip6_frag *ip6f; - struct ip6q *q6; + struct ip6q *head, *q6; struct ip6asfrag *af6, *ip6af, *af6dwn; struct in6_ifaddr *ia; int offset = *offp, nxt, i, next; int first_frag = 0; int fragoff, frgpartlen; /* must be larger than u_int16_t */ + uint32_t hash, hashkey[sizeof(struct in6_addr) * 2 + 1], *hashkeyp; struct ifnet *dstifp; u_int8_t ecn, ecn0; #ifdef RSS @@ -228,19 +284,38 @@ frag6_input(struct mbuf **mp, int *offp, int proto) return (ip6f->ip6f_nxt); } - IP6Q_LOCK(); + /* Get fragment length and discard 0-byte fragments. */ + frgpartlen = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) - offset; + if (frgpartlen == 0) { + icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, + offsetof(struct ip6_hdr, ip6_plen)); + in6_ifstat_inc(dstifp, ifs6_reass_fail); + IP6STAT_INC(ip6s_fragdropped); + return IPPROTO_DONE; + } + hashkeyp = hashkey; + memcpy(hashkeyp, &ip6->ip6_src, sizeof(struct in6_addr)); + hashkeyp += sizeof(struct in6_addr) / sizeof(*hashkeyp); + memcpy(hashkeyp, &ip6->ip6_dst, sizeof(struct in6_addr)); + hashkeyp += sizeof(struct in6_addr) / sizeof(*hashkeyp); + *hashkeyp = ip6f->ip6f_ident; + hash = jenkins_hash32(hashkey, nitems(hashkey), V_ip6q_hashseed); + hash &= IP6REASS_HMASK; + head = IP6Q_HEAD(hash); + IP6Q_LOCK(hash); + /* * Enforce upper bound on number of fragments. * If maxfrag is 0, never accept fragments. * If maxfrag is -1, accept all fragments without limitation. */ - if (V_ip6_maxfrags < 0) + if (ip6_maxfrags < 0) ; - else if (V_frag6_nfrags >= (u_int)V_ip6_maxfrags) + else if (frag6_nfrags >= (u_int)ip6_maxfrags) goto dropfrag; - for (q6 = V_ip6q.ip6q_next; q6 != &V_ip6q; q6 = q6->ip6q_next) + for (q6 = head->ip6q_next; q6 != head; q6 = q6->ip6q_next) if (ip6f->ip6f_ident == q6->ip6q_ident && IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &q6->ip6q_src) && IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &q6->ip6q_dst) @@ -250,7 +325,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) ) break; - if (q6 == &V_ip6q) { + if (q6 == head) { /* * the first fragment to arrive, create a reassembly queue. */ @@ -265,9 +340,10 @@ frag6_input(struct mbuf **mp, int *offp, int proto) */ if (V_ip6_maxfragpackets < 0) ; - else if (V_frag6_nfragpackets >= (u_int)V_ip6_maxfragpackets) + else if (V_ip6q[hash].count >= V_ip6_maxfragbucketsize || + V_frag6_nfragpackets >= (u_int)V_ip6_maxfragpackets) goto dropfrag; - V_frag6_nfragpackets++; + atomic_add_int(&V_frag6_nfragpackets, 1); q6 = (struct ip6q *)malloc(sizeof(struct ip6q), M_FTABLE, M_NOWAIT); if (q6 == NULL) @@ -280,7 +356,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) } mac_ip6q_create(m, q6); #endif - frag6_insque(q6, &V_ip6q); + frag6_insque_head(q6, head, hash); /* ip6q_nxt will be filled afterwards, from 1st fragment */ q6->ip6q_down = q6->ip6q_up = (struct ip6asfrag *)q6; @@ -314,21 +390,20 @@ frag6_input(struct mbuf **mp, int *offp, int proto) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 15 02:31: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 E2DA1106EE77; Wed, 15 Aug 2018 02:31:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 951B273A16; Wed, 15 Aug 2018 02:31: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 765BD24147; Wed, 15 Aug 2018 02:31: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 w7F2VBGM097221; Wed, 15 Aug 2018 02:31:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F2VABY096059; Wed, 15 Aug 2018 02:31:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808150231.w7F2VABY096059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 15 Aug 2018 02:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r337829 - in releng/10.4: . contrib/wpa/src/rsn_supp share/man/man4 sys/conf X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in releng/10.4: . contrib/wpa/src/rsn_supp share/man/man4 sys/conf X-SVN-Commit-Revision: 337829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 02:31:12 -0000 Author: delphij Date: Wed Aug 15 02:31:10 2018 New Revision: 337829 URL: https://svnweb.freebsd.org/changeset/base/337829 Log: Revis manual pages. [SA-18:08.tcp] Fix unauthenticated EAPOL-Key decryption vulnerability. [SA-18:11.hostapd] Approved by: so Modified: releng/10.4/UPDATING releng/10.4/contrib/wpa/src/rsn_supp/wpa.c releng/10.4/share/man/man4/tcp.4 releng/10.4/sys/conf/newvers.sh Modified: releng/10.4/UPDATING ============================================================================== --- releng/10.4/UPDATING Wed Aug 15 02:30:11 2018 (r337828) +++ releng/10.4/UPDATING Wed Aug 15 02:31:10 2018 (r337829) @@ -16,6 +16,15 @@ from older versions of FreeBSD, try WITHOUT_CLANG to b stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. + +20180814 p11 FreeBSD-SA-18:08.tcp [revised] + FreeBSD-SA-18:11.hostapd + + Revise manual pages. [SA-18:08.tcp] + + Fixeunauthenticated EAPOL-Key decryption vulnerability. + [SA-18:11.hostapd] + 20180806 p10 FreeBSD-SA-18:08.tcp Fix resource exhaustion in TCP reassembly. Modified: releng/10.4/contrib/wpa/src/rsn_supp/wpa.c ============================================================================== --- releng/10.4/contrib/wpa/src/rsn_supp/wpa.c Wed Aug 15 02:30:11 2018 (r337828) +++ releng/10.4/contrib/wpa/src/rsn_supp/wpa.c Wed Aug 15 02:31:10 2018 (r337829) @@ -1829,6 +1829,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_a if (sm->proto == WPA_PROTO_RSN && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) { + /* + * Only decrypt the Key Data field if the frame's authenticity + * was verified. When using AES-SIV (FILS), the MIC flag is not + * set, so this check should only be performed if mic_len != 0 + * which is the case in this code branch. + */ + if (!(key_info & WPA_KEY_INFO_MIC)) { + wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, + "WPA: Ignore EAPOL-Key with encrypted but unauthenticated data"); + goto out; + } if (wpa_supplicant_decrypt_key_data(sm, key, ver)) goto out; extra_len = WPA_GET_BE16(key->key_data_length); Modified: releng/10.4/share/man/man4/tcp.4 ============================================================================== --- releng/10.4/share/man/man4/tcp.4 Wed Aug 15 02:30:11 2018 (r337828) +++ releng/10.4/share/man/man4/tcp.4 Wed Aug 15 02:31:10 2018 (r337829) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 13, 2014 +.Dd August 6, 2018 .Dt TCP 4 .Os .Sh NAME Modified: releng/10.4/sys/conf/newvers.sh ============================================================================== --- releng/10.4/sys/conf/newvers.sh Wed Aug 15 02:30:11 2018 (r337828) +++ releng/10.4/sys/conf/newvers.sh Wed Aug 15 02:31:10 2018 (r337829) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.4" -BRANCH="RELEASE-p10" +BRANCH="RELEASE-p11" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Wed Aug 15 03:03: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 DB6B6106F96F; Wed, 15 Aug 2018 03:03:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9099274A5C; Wed, 15 Aug 2018 03:03:02 +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 735D12480D; Wed, 15 Aug 2018 03:03:02 +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 w7F332R6016173; Wed, 15 Aug 2018 03:03:02 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F331Wu016170; Wed, 15 Aug 2018 03:03:01 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808150303.w7F331Wu016170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 15 Aug 2018 03:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337830 - 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: 337830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 03:03:03 -0000 Author: np Date: Wed Aug 15 03:03:01 2018 New Revision: 337830 URL: https://svnweb.freebsd.org/changeset/base/337830 Log: cxgbe(4): Use two hashes instead of a table to keep track of hashfilters. Two because the driver needs to look up a hashfilter by its 4-tuple or tid. A couple of fixes while here: - Reject attempts to add duplicate hashfilters. - Do not assume that any part of the 4-tuple that isn't specified is 0. This makes it consistent with all other mandatory parameters that already require explicit user input. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_filter.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Wed Aug 15 02:31:10 2018 (r337829) +++ head/sys/dev/cxgbe/adapter.h Wed Aug 15 03:03:01 2018 (r337830) @@ -1270,7 +1270,7 @@ int t4_filter_rpl(struct sge_iq *, const struct rss_he int t4_hashfilter_ao_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); int t4_hashfilter_tcb_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); int t4_del_hashfilter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); -void free_hftid_tab(struct tid_info *); +void free_hftid_hash(struct tid_info *); static inline struct wrqe * alloc_wrqe(int wr_len, struct sge_wrq *wrq) Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Wed Aug 15 02:31:10 2018 (r337829) +++ head/sys/dev/cxgbe/offload.h Wed Aug 15 03:03:01 2018 (r337830) @@ -169,11 +169,13 @@ struct tid_info { */ struct mtx hftid_lock __aligned(CACHE_LINE_SIZE); struct cv hftid_cv; - union { - void **hftid_tab; - void **tid_tab; - }; + void **tid_tab; u_int tids_in_use; + + void *hftid_hash_4t; /* LIST_HEAD(, filter_entry) *hftid_hash_4t; */ + u_long hftid_4t_mask; + void *hftid_hash_tid; /* LIST_HEAD(, filter_entry) *hftid_hash_tid; */ + u_long hftid_tid_mask; struct mtx etid_lock __aligned(CACHE_LINE_SIZE); union etid_entry *etid_tab; Modified: head/sys/dev/cxgbe/t4_filter.c ============================================================================== --- head/sys/dev/cxgbe/t4_filter.c Wed Aug 15 02:31:10 2018 (r337829) +++ head/sys/dev/cxgbe/t4_filter.c Wed Aug 15 03:03:01 2018 (r337830) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -53,6 +54,9 @@ __FBSDID("$FreeBSD$"); #include "t4_smt.h" struct filter_entry { + LIST_ENTRY(filter_entry) link_4t; + LIST_ENTRY(filter_entry) link_tid; + uint32_t valid:1; /* filter allocated and valid */ uint32_t locked:1; /* filter is administratively locked or busy */ uint32_t pending:1; /* filter action is pending firmware reply */ @@ -78,17 +82,54 @@ separate_hpfilter_region(struct adapter *sc) return (chip_id(sc) >= CHELSIO_T6); } +static inline uint32_t +hf_hashfn_4t(struct t4_filter_specification *fs) +{ + struct t4_filter_tuple *ft = &fs->val; + uint32_t hash; + + if (fs->type) { + /* IPv6 */ + hash = fnv_32_buf(&ft->sip[0], 16, FNV1_32_INIT); + hash = fnv_32_buf(&ft->dip[0], 16, hash); + } else { + hash = fnv_32_buf(&ft->sip[0], 4, FNV1_32_INIT); + hash = fnv_32_buf(&ft->dip[0], 4, hash); + } + hash = fnv_32_buf(&ft->sport, sizeof(ft->sport), hash); + hash = fnv_32_buf(&ft->dport, sizeof(ft->dport), hash); + + return (hash); +} + +static inline uint32_t +hf_hashfn_tid(int tid) +{ + + return (fnv_32_buf(&tid, sizeof(tid), FNV1_32_INIT)); +} + static int -alloc_hftid_tab(struct tid_info *t, int flags) +alloc_hftid_hash(struct tid_info *t, int flags) { + int n; MPASS(t->ntids > 0); - MPASS(t->hftid_tab == NULL); + MPASS(t->hftid_hash_4t == NULL); + MPASS(t->hftid_hash_tid == NULL); - t->hftid_tab = malloc(sizeof(*t->hftid_tab) * t->ntids, M_CXGBE, - M_ZERO | flags); - if (t->hftid_tab == NULL) + n = max(t->ntids / 1024, 16); + t->hftid_hash_4t = hashinit_flags(n, M_CXGBE, &t->hftid_4t_mask, flags); + if (t->hftid_hash_4t == NULL) return (ENOMEM); + t->hftid_hash_tid = hashinit_flags(n, M_CXGBE, &t->hftid_tid_mask, + flags); + if (t->hftid_hash_tid == NULL) { + hashdestroy(t->hftid_hash_4t, M_CXGBE, t->hftid_4t_mask); + t->hftid_hash_4t = NULL; + return (ENOMEM); + } + mtx_init(&t->hftid_lock, "T4 hashfilters", 0, MTX_DEF); cv_init(&t->hftid_cv, "t4hfcv"); @@ -96,22 +137,47 @@ alloc_hftid_tab(struct tid_info *t, int flags) } void -free_hftid_tab(struct tid_info *t) +free_hftid_hash(struct tid_info *t) { + struct filter_entry *f, *ftmp; + LIST_HEAD(, filter_entry) *head; int i; +#ifdef INVARIANTS + int n = 0; +#endif - if (t->hftid_tab != NULL) { - MPASS(t->ntids > 0); - for (i = 0; t->tids_in_use > 0 && i < t->ntids; i++) { - if (t->hftid_tab[i] == NULL) - continue; - free(t->hftid_tab[i], M_CXGBE); - t->tids_in_use--; + if (t->tids_in_use > 0) { + /* Remove everything from the tid hash. */ + head = t->hftid_hash_tid; + for (i = 0; i <= t->hftid_tid_mask; i++) { + LIST_FOREACH_SAFE(f, &head[i], link_tid, ftmp) { + LIST_REMOVE(f, link_tid); + } } - free(t->hftid_tab, M_CXGBE); - t->hftid_tab = NULL; + + /* Remove and then free each filter in the 4t hash. */ + head = t->hftid_hash_4t; + for (i = 0; i <= t->hftid_4t_mask; i++) { + LIST_FOREACH_SAFE(f, &head[i], link_4t, ftmp) { +#ifdef INVARIANTS + n += f->fs.type ? 2 : 1; +#endif + LIST_REMOVE(f, link_4t); + free(f, M_CXGBE); + } + } + MPASS(t->tids_in_use == n); + t->tids_in_use = 0; } + if (t->hftid_hash_4t) { + hashdestroy(t->hftid_hash_4t, M_CXGBE, t->hftid_4t_mask); + t->hftid_hash_4t = NULL; + } + if (t->hftid_hash_tid) { + hashdestroy(t->hftid_hash_tid, M_CXGBE, t->hftid_tid_mask); + t->hftid_hash_tid = NULL; + } if (mtx_initialized(&t->hftid_lock)) { mtx_destroy(&t->hftid_lock); cv_destroy(&t->hftid_cv); @@ -119,31 +185,146 @@ free_hftid_tab(struct tid_info *t) } static void -insert_hftid(struct adapter *sc, int tid, void *ctx, int ntids) +insert_hf(struct adapter *sc, struct filter_entry *f, uint32_t hash) { struct tid_info *t = &sc->tids; + LIST_HEAD(, filter_entry) *head = t->hftid_hash_4t; - t->hftid_tab[tid] = ctx; - atomic_add_int(&t->tids_in_use, ntids); + MPASS(head != NULL); + if (hash == 0) + hash = hf_hashfn_4t(&f->fs); + LIST_INSERT_HEAD(&head[hash & t->hftid_4t_mask], f, link_4t); + atomic_add_int(&t->tids_in_use, f->fs.type ? 2 : 1); } -static void * +static void +insert_hftid(struct adapter *sc, struct filter_entry *f) +{ + struct tid_info *t = &sc->tids; + LIST_HEAD(, filter_entry) *head = t->hftid_hash_tid; + uint32_t hash; + + MPASS(f->tid >= t->tid_base); + MPASS(f->tid - t->tid_base < t->ntids); + mtx_assert(&t->hftid_lock, MA_OWNED); + + hash = hf_hashfn_tid(f->tid); + LIST_INSERT_HEAD(&head[hash & t->hftid_tid_mask], f, link_tid); +} + +static bool +filter_eq(struct t4_filter_specification *fs1, + struct t4_filter_specification *fs2) +{ + int n; + + MPASS(fs1->hash && fs2->hash); + + if (fs1->type != fs2->type) + return (false); + + n = fs1->type ? 16 : 4; + if (bcmp(&fs1->val.sip[0], &fs2->val.sip[0], n) || + bcmp(&fs1->val.dip[0], &fs2->val.dip[0], n) || + fs1->val.sport != fs2->val.sport || + fs1->val.dport != fs2->val.dport) + return (false); + + /* + * We know the masks are the same because all hashfilter masks have to + * conform to the global tp->hash_filter_mask and the driver has + * verified that already. + */ + + if ((fs1->mask.pfvf_vld || fs1->mask.ovlan_vld) && + fs1->val.vnic != fs2->val.vnic) + return (false); + if (fs1->mask.vlan_vld && fs1->val.vlan != fs2->val.vlan) + return (false); + if (fs1->mask.macidx && fs1->val.macidx != fs2->val.macidx) + return (false); + if (fs1->mask.frag && fs1->val.frag != fs2->val.frag) + return (false); + if (fs1->mask.matchtype && fs1->val.matchtype != fs2->val.matchtype) + return (false); + if (fs1->mask.iport && fs1->val.iport != fs2->val.iport) + return (false); + if (fs1->mask.fcoe && fs1->val.fcoe != fs2->val.fcoe) + return (false); + if (fs1->mask.proto && fs1->val.proto != fs2->val.proto) + return (false); + if (fs1->mask.tos && fs1->val.tos != fs2->val.tos) + return (false); + if (fs1->mask.ethtype && fs1->val.ethtype != fs2->val.ethtype) + return (false); + + return (true); +} + +static struct filter_entry * +lookup_hf(struct adapter *sc, struct t4_filter_specification *fs, uint32_t hash) +{ + struct tid_info *t = &sc->tids; + LIST_HEAD(, filter_entry) *head = t->hftid_hash_4t; + struct filter_entry *f; + + mtx_assert(&t->hftid_lock, MA_OWNED); + MPASS(head != NULL); + + if (hash == 0) + hash = hf_hashfn_4t(fs); + + LIST_FOREACH(f, &head[hash & t->hftid_4t_mask], link_4t) { + if (filter_eq(&f->fs, fs)) + return (f); + } + + return (NULL); +} + +static struct filter_entry * lookup_hftid(struct adapter *sc, int tid) { struct tid_info *t = &sc->tids; + LIST_HEAD(, filter_entry) *head = t->hftid_hash_tid; + struct filter_entry *f; + uint32_t hash; - return (t->hftid_tab[tid]); + mtx_assert(&t->hftid_lock, MA_OWNED); + MPASS(head != NULL); + + hash = hf_hashfn_tid(tid); + LIST_FOREACH(f, &head[hash & t->hftid_tid_mask], link_tid) { + if (f->tid == tid) + return (f); + } + + return (NULL); } static void -remove_hftid(struct adapter *sc, int tid, int ntids) +remove_hf(struct adapter *sc, struct filter_entry *f) { struct tid_info *t = &sc->tids; - t->hftid_tab[tid] = NULL; - atomic_subtract_int(&t->tids_in_use, ntids); + mtx_assert(&t->hftid_lock, MA_OWNED); + + LIST_REMOVE(f, link_4t); + atomic_subtract_int(&t->tids_in_use, f->fs.type ? 2 : 1); } +static void +remove_hftid(struct adapter *sc, struct filter_entry *f) +{ +#ifdef INVARIANTS + struct tid_info *t = &sc->tids; + + mtx_assert(&t->hftid_lock, MA_OWNED); +#endif + + LIST_REMOVE(f, link_tid); +} + static uint32_t mode_to_fconf(uint32_t mode) { @@ -613,6 +794,25 @@ hashfilter_ntuple(struct adapter *sc, const struct t4_ return (0); } +static bool +is_4tuple_specified(struct t4_filter_specification *fs) +{ + int i; + const int n = fs->type ? 16 : 4; + + if (fs->mask.sport != 0xffff || fs->mask.dport != 0xffff) + return (false); + + for (i = 0; i < n; i++) { + if (fs->mask.sip[i] != 0xff) + return (false); + if (fs->mask.dip[i] != 0xff) + return (false); + } + + return (true); +} + int set_filter(struct adapter *sc, struct t4_filter *t) { @@ -635,6 +835,8 @@ set_filter(struct adapter *sc, struct t4_filter *t) /* T5 can't count hashfilter hits. */ if (is_t5(sc) && t->fs.hitcnts) return (EINVAL); + if (!is_4tuple_specified(&t->fs)) + return (EINVAL); rc = hashfilter_ntuple(sc, &t->fs, &ftuple); if (rc != 0) return (rc); @@ -689,8 +891,8 @@ set_filter(struct adapter *sc, struct t4_filter *t) return (rc); } if (t->fs.hash) { - if (__predict_false(ti->hftid_tab == NULL)) { - rc = alloc_hftid_tab(&sc->tids, M_NOWAIT); + if (__predict_false(ti->hftid_hash_4t == NULL)) { + rc = alloc_hftid_hash(&sc->tids, HASH_NOWAIT); if (rc != 0) goto done; } @@ -864,7 +1066,7 @@ del_filter(struct adapter *sc, struct t4_filter *t) * for are initialized. */ if (t->fs.hash) { - if (sc->tids.hftid_tab != NULL) + if (sc->tids.hftid_hash_4t != NULL) return (del_hashfilter(sc, t)); } else if (separate_hpfilter_region(sc) && t->fs.prio) { if (sc->tids.hpftid_tab != NULL) @@ -1018,18 +1220,9 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r KASSERT(f->tid == -1, ("%s: hashfilter[%p] has tid %d already.", __func__, f, f->tid)); if (status == CPL_ERR_NONE) { - struct filter_entry *f2; - f->tid = GET_TID(cpl); - MPASS(f->tid < sc->tids.ntids); - if (__predict_false((f2 = lookup_hftid(sc, f->tid)) != NULL)) { - /* XXX: avoid hash collisions in the first place. */ - MPASS(f2->tid == f->tid); - remove_hftid(sc, f2->tid, f2->fs.type ? 2 : 1); - free_filter_resources(f2); - free(f2, M_CXGBE); - } - insert_hftid(sc, f->tid, f, f->fs.type ? 2 : 1); + MPASS(lookup_hftid(sc, f->tid) == NULL); + insert_hftid(sc, f); /* * Leave the filter pending until it is fully set up, which will * be indicated by the reply to the last TCB update. No need to @@ -1046,6 +1239,7 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r if (act_open_has_tid(status)) release_tid(sc, GET_TID(cpl), &sc->sge.ctrlq[0]); free_filter_resources(f); + remove_hf(sc, f); if (f->locked == 0) free(f, M_CXGBE); } @@ -1080,7 +1274,8 @@ t4_hashfilter_tcb_rpl(struct sge_iq *iq, const struct f->tid = EIO; f->valid = 0; free_filter_resources(f); - remove_hftid(sc, tid, f->fs.type ? 2 : 1); + remove_hftid(sc, f); + remove_hf(sc, f); release_tid(sc, tid, &sc->sge.ctrlq[0]); if (f->locked == 0) free(f, M_CXGBE); @@ -1111,7 +1306,8 @@ t4_del_hashfilter_rpl(struct sge_iq *iq, const struct if (cpl->status == 0) { f->valid = 0; free_filter_resources(f); - remove_hftid(sc, tid, f->fs.type ? 2 : 1); + remove_hftid(sc, f); + remove_hf(sc, f); release_tid(sc, tid, &sc->sge.ctrlq[0]); if (f->locked == 0) free(f, M_CXGBE); @@ -1181,26 +1377,30 @@ done: static int get_hashfilter(struct adapter *sc, struct t4_filter *t) { - int i, nfilters = sc->tids.ntids; + struct tid_info *ti = &sc->tids; + int tid; struct filter_entry *f; + const int inv_tid = ti->ntids + ti->tid_base; MPASS(t->fs.hash); - if (sc->tids.tids_in_use == 0 || sc->tids.hftid_tab == NULL || - t->idx >= nfilters) { + if (ti->tids_in_use == 0 || ti->hftid_hash_tid == NULL || + t->idx >= inv_tid) { t->idx = 0xffffffff; return (0); } + if (t->idx < ti->tid_base) + t->idx = ti->tid_base; - mtx_lock(&sc->tids.hftid_lock); - for (i = t->idx; i < nfilters; i++) { - f = lookup_hftid(sc, i); + mtx_lock(&ti->hftid_lock); + for (tid = t->idx; tid < inv_tid; tid++) { + f = lookup_hftid(sc, tid); if (f != NULL && f->valid) { - t->idx = i; + t->idx = tid; t->l2tidx = f->l2te ? f->l2te->idx : 0; t->smtidx = f->smt ? f->smt->idx : 0; if (f->fs.hitcnts) - t->hits = get_filter_hits(sc, t->idx); + t->hits = get_filter_hits(sc, tid); else t->hits = UINT64_MAX; t->fs = f->fs; @@ -1210,7 +1410,7 @@ get_hashfilter(struct adapter *sc, struct t4_filter *t } t->idx = 0xffffffff; done: - mtx_unlock(&sc->tids.hftid_lock); + mtx_unlock(&ti->hftid_lock); return (0); } @@ -1335,20 +1535,21 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t struct wrq_cookie cookie; struct filter_entry *f; int rc, atid = -1; + uint32_t hash; MPASS(t->fs.hash); /* Already validated against fconf, iconf */ MPASS((t->fs.val.pfvf_vld & t->fs.val.ovlan_vld) == 0); MPASS((t->fs.mask.pfvf_vld & t->fs.mask.ovlan_vld) == 0); + hash = hf_hashfn_4t(&t->fs); + mtx_lock(&sc->tids.hftid_lock); + if (lookup_hf(sc, &t->fs, hash) != NULL) { + rc = EEXIST; + goto done; + } - /* - * XXX: Check for hash collisions and insert in the hash based lookup - * table so that in-flight hashfilters are also considered when checking - * for collisions. - */ - f = malloc(sizeof(*f), M_CXGBE, M_ZERO | M_NOWAIT); if (__predict_false(f == NULL)) { if (l2te) @@ -1394,6 +1595,7 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f->locked = 1; /* ithread mustn't free f if ioctl is still around. */ f->pending = 1; f->tid = -1; + insert_hf(sc, f, hash); commit_wrq_wr(&sc->sge.ctrlq[0], wr, &cookie); for (;;) { @@ -1404,6 +1606,7 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f->locked = 0; t->idx = f->tid; } else { + remove_hf(sc, f); rc = f->tid; free(f, M_CXGBE); } @@ -1544,19 +1747,21 @@ mk_del_hashfilter_wr(int tid, struct work_request_hdr static int del_hashfilter(struct adapter *sc, struct t4_filter *t) { + struct tid_info *ti = &sc->tids; void *wr; struct filter_entry *f; struct wrq_cookie cookie; int rc; const int wrlen = del_hashfilter_wrlen(); + const int inv_tid = ti->ntids + ti->tid_base; - MPASS(sc->tids.hftid_tab != NULL); + MPASS(sc->tids.hftid_hash_4t != NULL); MPASS(sc->tids.ntids > 0); - if (t->idx >= sc->tids.ntids) + if (t->idx < sc->tids.tid_base || t->idx >= inv_tid) return (EINVAL); - mtx_lock(&sc->tids.hftid_lock); + mtx_lock(&ti->hftid_lock); f = lookup_hftid(sc, t->idx); if (f == NULL || f->valid == 0) { rc = EINVAL; @@ -1595,14 +1800,14 @@ del_hashfilter(struct adapter *sc, struct t4_filter *t } break; } - if (cv_wait_sig(&sc->tids.hftid_cv, &sc->tids.hftid_lock) != 0) { + if (cv_wait_sig(&ti->hftid_cv, &ti->hftid_lock) != 0) { f->locked = 0; rc = EINPROGRESS; break; } } done: - mtx_unlock(&sc->tids.hftid_lock); + mtx_unlock(&ti->hftid_lock); return (rc); } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Aug 15 02:31:10 2018 (r337829) +++ head/sys/dev/cxgbe/t4_main.c Wed Aug 15 03:03:01 2018 (r337830) @@ -1405,8 +1405,7 @@ t4_detach_common(device_t dev) free(sc->sge.eqmap, M_CXGBE); free(sc->tids.ftid_tab, M_CXGBE); free(sc->tids.hpftid_tab, M_CXGBE); - if (sc->tids.hftid_tab) - free_hftid_tab(&sc->tids); + free_hftid_hash(&sc->tids); free(sc->tids.atid_tab, M_CXGBE); free(sc->tids.tid_tab, M_CXGBE); free(sc->tt.tls_rx_ports, M_CXGBE); From owner-svn-src-all@freebsd.org Wed Aug 15 05:03:55 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 0853710728A5; Wed, 15 Aug 2018 05:03:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FA3378378; Wed, 15 Aug 2018 05:03:54 +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 7B63F25BDB; Wed, 15 Aug 2018 05:03:54 +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 w7F53sad077146; Wed, 15 Aug 2018 05:03:54 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F53s4c077145; Wed, 15 Aug 2018 05:03:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808150503.w7F53s4c077145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 15 Aug 2018 05:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337831 - stable/11/contrib/wpa/src/rsn_supp X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/contrib/wpa/src/rsn_supp X-SVN-Commit-Revision: 337831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 05:03:55 -0000 Author: delphij Date: Wed Aug 15 05:03:54 2018 New Revision: 337831 URL: https://svnweb.freebsd.org/changeset/base/337831 Log: MFC r337819 (cy@): MFV r337818: WPA: Ignore unauthenticated encrypted EAPOL-Key data Approved by: so Security: CVE-2018-14526 Security: FreeBSD-SA-18:11.hostapd Modified: stable/11/contrib/wpa/src/rsn_supp/wpa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/wpa/src/rsn_supp/wpa.c ============================================================================== --- stable/11/contrib/wpa/src/rsn_supp/wpa.c Wed Aug 15 03:03:01 2018 (r337830) +++ stable/11/contrib/wpa/src/rsn_supp/wpa.c Wed Aug 15 05:03:54 2018 (r337831) @@ -2072,6 +2072,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_a if ((sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) { + /* + * Only decrypt the Key Data field if the frame's authenticity + * was verified. When using AES-SIV (FILS), the MIC flag is not + * set, so this check should only be performed if mic_len != 0 + * which is the case in this code branch. + */ + if (!(key_info & WPA_KEY_INFO_MIC)) { + wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, + "WPA: Ignore EAPOL-Key with encrypted but unauthenticated data"); + goto out; + } if (wpa_supplicant_decrypt_key_data(sm, key, ver, key_data, &key_data_len)) goto out; From owner-svn-src-all@freebsd.org Wed Aug 15 05: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 A92FD1072924; Wed, 15 Aug 2018 05:05:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4FD784BA; Wed, 15 Aug 2018 05:05: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 3C4CB25BDC; Wed, 15 Aug 2018 05:05: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 w7F5532j077251; Wed, 15 Aug 2018 05:05:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F5535x077250; Wed, 15 Aug 2018 05:05:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808150505.w7F5535x077250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 15 Aug 2018 05:05:03 +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: r337832 - stable/10/contrib/wpa/src/rsn_supp X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/contrib/wpa/src/rsn_supp X-SVN-Commit-Revision: 337832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 05:05:03 -0000 Author: delphij Date: Wed Aug 15 05:05:02 2018 New Revision: 337832 URL: https://svnweb.freebsd.org/changeset/base/337832 Log: Fix unauthenticated EAPOL-Key decryption vulnerability. [SA-18:11.hostapd] Approved by: so Modified: stable/10/contrib/wpa/src/rsn_supp/wpa.c Modified: stable/10/contrib/wpa/src/rsn_supp/wpa.c ============================================================================== --- stable/10/contrib/wpa/src/rsn_supp/wpa.c Wed Aug 15 05:03:54 2018 (r337831) +++ stable/10/contrib/wpa/src/rsn_supp/wpa.c Wed Aug 15 05:05:02 2018 (r337832) @@ -1829,6 +1829,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_a if (sm->proto == WPA_PROTO_RSN && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) { + /* + * Only decrypt the Key Data field if the frame's authenticity + * was verified. When using AES-SIV (FILS), the MIC flag is not + * set, so this check should only be performed if mic_len != 0 + * which is the case in this code branch. + */ + if (!(key_info & WPA_KEY_INFO_MIC)) { + wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, + "WPA: Ignore EAPOL-Key with encrypted but unauthenticated data"); + goto out; + } if (wpa_supplicant_decrypt_key_data(sm, key, ver)) goto out; extra_len = WPA_GET_BE16(key->key_data_length); From owner-svn-src-all@freebsd.org Wed Aug 15 06:42: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 08B15107801A; Wed, 15 Aug 2018 06:42:33 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEBDF7D717; Wed, 15 Aug 2018 06:42: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 8FFE126BD6; Wed, 15 Aug 2018 06:42: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 w7F6gW3F028334; Wed, 15 Aug 2018 06:42:32 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F6gWBK028332; Wed, 15 Aug 2018 06:42:32 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808150642.w7F6gWBK028332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 15 Aug 2018 06:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337833 - head/sys/fs/cd9660 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/fs/cd9660 X-SVN-Commit-Revision: 337833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 06:42:33 -0000 Author: tsoome Date: Wed Aug 15 06:42:31 2018 New Revision: 337833 URL: https://svnweb.freebsd.org/changeset/base/337833 Log: cd9660 pointer sign issues and missing __packed attribute The isonum_* functions are defined to take unsigend char* as an argument, but the structure fields are defined as char. Change to u_char where needed. Probably the full structure should be changed, but I'm not sure about the side affects. While there, add __packed attribute. Differential Revision: https://reviews.freebsd.org/D16564 Modified: head/sys/fs/cd9660/cd9660_rrip.h head/sys/fs/cd9660/iso.h Modified: head/sys/fs/cd9660/cd9660_rrip.h ============================================================================== --- head/sys/fs/cd9660/cd9660_rrip.h Wed Aug 15 05:05:02 2018 (r337832) +++ head/sys/fs/cd9660/cd9660_rrip.h Wed Aug 15 06:42:31 2018 (r337833) @@ -133,7 +133,7 @@ typedef struct { typedef struct { ISO_SUSP_HEADER h; - char location [ISODCL ( 4, 11)]; - char offset [ISODCL ( 12, 19)]; - char length [ISODCL ( 20, 27)]; + u_char location [ISODCL ( 4, 11)]; + u_char offset [ISODCL ( 12, 19)]; + u_char length [ISODCL ( 20, 27)]; } ISO_RRIP_CONT; Modified: head/sys/fs/cd9660/iso.h ============================================================================== --- head/sys/fs/cd9660/iso.h Wed Aug 15 05:05:02 2018 (r337832) +++ head/sys/fs/cd9660/iso.h Wed Aug 15 06:42:31 2018 (r337833) @@ -61,7 +61,7 @@ struct iso_volume_descriptor { #define ISO_SIERRA_ID "CDROM" struct iso_primary_descriptor { - char type [ISODCL ( 1, 1)]; /* 711 */ + u_char type [ISODCL ( 1, 1)]; /* 711 */ char id [ISODCL ( 2, 6)]; char version [ISODCL ( 7, 7)]; /* 711 */ char unused1 [ISODCL ( 8, 8)]; @@ -72,7 +72,7 @@ struct iso_primary_descriptor { char unused3 [ISODCL ( 89, 120)]; char volume_set_size [ISODCL (121, 124)]; /* 723 */ char volume_sequence_number [ISODCL (125, 128)]; /* 723 */ - char logical_block_size [ISODCL (129, 132)]; /* 723 */ + u_char logical_block_size [ISODCL (129, 132)]; /* 723 */ char path_table_size [ISODCL (133, 140)]; /* 733 */ char type_l_path_table [ISODCL (141, 144)]; /* 731 */ char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */ @@ -94,7 +94,7 @@ struct iso_primary_descriptor { char unused4 [ISODCL (883, 883)]; char application_data [ISODCL (884, 1395)]; char unused5 [ISODCL (1396, 2048)]; -}; +} __packed; #define ISO_DEFAULT_BLOCK_SHIFT 11 #define ISO_DEFAULT_BLOCK_SIZE (1 << ISO_DEFAULT_BLOCK_SHIFT) @@ -115,7 +115,7 @@ struct iso_supplementary_descriptor { char escape [ISODCL ( 89, 120)]; char volume_set_size [ISODCL (121, 124)]; /* 723 */ char volume_sequence_number [ISODCL (125, 128)]; /* 723 */ - char logical_block_size [ISODCL (129, 132)]; /* 723 */ + u_char logical_block_size [ISODCL (129, 132)]; /* 723 */ char path_table_size [ISODCL (133, 140)]; /* 733 */ char type_l_path_table [ISODCL (141, 144)]; /* 731 */ char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */ @@ -152,7 +152,7 @@ struct iso_sierra_primary_descriptor { char unused3 [ISODCL ( 97, 128)]; char volume_set_size [ISODCL (129, 132)]; /* 723 */ char volume_sequence_number [ISODCL (133, 136)]; /* 723 */ - char logical_block_size [ISODCL (137, 140)]; /* 723 */ + u_char logical_block_size [ISODCL (137, 140)]; /* 723 */ char path_table_size [ISODCL (141, 148)]; /* 733 */ char type_l_path_table [ISODCL (149, 152)]; /* 731 */ char opt_type_l_path_table [ISODCL (153, 156)]; /* 731 */ @@ -177,18 +177,18 @@ struct iso_sierra_primary_descriptor { }; struct iso_directory_record { - char length [ISODCL (1, 1)]; /* 711 */ - char ext_attr_length [ISODCL (2, 2)]; /* 711 */ + u_char length [ISODCL (1, 1)]; /* 711 */ + u_char ext_attr_length [ISODCL (2, 2)]; /* 711 */ u_char extent [ISODCL (3, 10)]; /* 733 */ u_char size [ISODCL (11, 18)]; /* 733 */ - char date [ISODCL (19, 25)]; /* 7 by 711 */ - char flags [ISODCL (26, 26)]; - char file_unit_size [ISODCL (27, 27)]; /* 711 */ - char interleave [ISODCL (28, 28)]; /* 711 */ - char volume_sequence_number [ISODCL (29, 32)]; /* 723 */ - char name_len [ISODCL (33, 33)]; /* 711 */ + u_char date [ISODCL (19, 25)]; /* 7 by 711 */ + u_char flags [ISODCL (26, 26)]; + u_char file_unit_size [ISODCL (27, 27)]; /* 711 */ + u_char interleave [ISODCL (28, 28)]; /* 711 */ + u_char volume_sequence_number [ISODCL (29, 32)]; /* 723 */ + u_char name_len [ISODCL (33, 33)]; /* 711 */ char name [1]; /* XXX */ -}; +} __packed; /* can't take sizeof(iso_directory_record), because of possible alignment of the last entry (34 instead of 33) */ #define ISO_DIRECTORY_RECORD_SIZE 33 From owner-svn-src-all@freebsd.org Wed Aug 15 07:36: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 26AF81078C50; Wed, 15 Aug 2018 07:36:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 C4C417E923; Wed, 15 Aug 2018 07:36:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [51.52.172.98]) by mail.baldwin.cx (Postfix) with ESMTPSA id CADA210AFCD; Wed, 15 Aug 2018 03:36:06 -0400 (EDT) Subject: Re: svn commit: r337674 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808120209.w7C297Ub018593@repo.freebsd.org> From: John Baldwin Message-ID: Date: Wed, 15 Aug 2018 07:45:02 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808120209.w7C297Ub018593@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 15 Aug 2018 03:36:36 -0400 (EDT) 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.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 07:36:38 -0000 On 8/12/18 3:09 AM, Matt Macy wrote: > Author: mmacy > Date: Sun Aug 12 02:09:06 2018 > New Revision: 337674 > URL: https://svnweb.freebsd.org/changeset/base/337674 > > Log: > Restore legacy dnode_phys layout on tier 2 arches > > Evidently gcc4 doesn't support anonymous union members It does. We use it in 'struct mbuf'. It does require -fms-extensions which we enable for kernel builds. Perhaps ZFS is missing this flag due to using custom build flags and/or rules? -- John Baldwin From owner-svn-src-all@freebsd.org Wed Aug 15 08:45: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 676C8107A026; Wed, 15 Aug 2018 08:45:05 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21E8F807D8; Wed, 15 Aug 2018 08:45:05 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 940541D878; Wed, 15 Aug 2018 08:45:04 +0000 (UTC) Date: Wed, 15 Aug 2018 08:45:04 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337773 - in head/sys/amd64: amd64 include Message-ID: <20180815084503.GA96451@FreeBSD.org> References: <201808141637.w7EGbFpZ087559@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201808141637.w7EGbFpZ087559@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 08:45:05 -0000 On Tue, Aug 14, 2018 at 04:37:15PM +0000, Konstantin Belousov wrote: > New Revision: 337773 > URL: https://svnweb.freebsd.org/changeset/base/337773 > > Log: > amd64: ensure that curproc->p_vmspace pmap always matches PCPU > curpmap. > > When performing context switch on a machine without PCID, if current > %cr3 equals to the new pmap %cr3, which is typical for kernel_pmap > vs. kernel process, I overlooked to update PCPU curpmap value. Remove > check for %cr3 not equal to pm_cr3 for doing the update. It is > believed that this case cannot happen at all, due to other changes in > this revision. > ... > - } else if (cr3 != pmap->pm_cr3) { > + } else { > load_cr3(pmap->pm_cr3); If this case cannot happen at all, would it make sense to assert it? ./danfe From owner-svn-src-all@freebsd.org Wed Aug 15 08:45: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 BE07E107A02E; Wed, 15 Aug 2018 08:45:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7447E807DB; Wed, 15 Aug 2018 08:45:06 +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 3CD9527F37; Wed, 15 Aug 2018 08:45:06 +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 w7F8j61N089300; Wed, 15 Aug 2018 08:45:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7F8j56b089298; Wed, 15 Aug 2018 08:45:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808150845.w7F8j56b089298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 15 Aug 2018 08:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337834 - in head: sbin/init stand/man X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: sbin/init stand/man X-SVN-Commit-Revision: 337834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 08:45:07 -0000 Author: trasz Date: Wed Aug 15 08:45:05 2018 New Revision: 337834 URL: https://svnweb.freebsd.org/changeset/base/337834 Log: Add SECURITY section to loader(8). Reviewed by: bcr, jilles, imp (earlier version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16700 Modified: head/sbin/init/init.8 head/stand/man/loader.8 Modified: head/sbin/init/init.8 ============================================================================== --- head/sbin/init/init.8 Wed Aug 15 06:42:31 2018 (r337833) +++ head/sbin/init/init.8 Wed Aug 15 08:45:05 2018 (r337834) @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd August 14, 2018 +.Dd August 15, 2018 .Dt INIT 8 .Os .Sh NAME @@ -86,6 +86,15 @@ The password check is skipped if the .Em console is marked as .Dq secure . +Note that the password check does not protect from variables +such as +.Va init_script +being set from the +.Xr loader 8 +command line; see the +.Sx SECURITY +section of +.Xr loader 8 . .Pp If the system security level (see .Xr security 7 ) Modified: head/stand/man/loader.8 ============================================================================== --- head/stand/man/loader.8 Wed Aug 15 06:42:31 2018 (r337833) +++ head/stand/man/loader.8 Wed Aug 15 08:45:05 2018 (r337834) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2018 +.Dd August 15, 2018 .Dt LOADER 8 .Os .Sh NAME @@ -945,6 +945,42 @@ version at compile time. .Nm version. .El +.Sh SECURITY +Access to the +.Nm +command line provides several ways of compromising system security, +including, but not limited to: +.Pp +.Bl -bullet -compact +.It +Booting from removable storage, by setting the +.Va currdev +or +.Va loaddev +variables +.It +Executing binary of choice, by setting the +.Va init_path +or +.Va init_script +variables +.It +Overriding ACPI DSDT to inject arbitrary code into the ACPI subsystem +.El +.Pp +One can prevent unauthorized access +to the +.Nm +command line by setting the +.Va password , +or setting +.Va autoboot_delay +to -1. +See +.Xr loader.conf 5 +for details. +In order for this to be effective, one should also configure the firmware +(BIOS or UEFI) to prevent booting from unauthorized devices. .Sh FILES .Bl -tag -width /usr/share/examples/bootforth/ -compact .It Pa /boot/loader From owner-svn-src-all@freebsd.org Wed Aug 15 09:09: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 A1424107AE63; Wed, 15 Aug 2018 09:09:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id DAFB78167B; Wed, 15 Aug 2018 09:09:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id B692B1A1DE2; Wed, 15 Aug 2018 19:09:34 +1000 (AEST) Date: Wed, 15 Aug 2018 19:09:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337674 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys In-Reply-To: Message-ID: <20180815174659.X2616@besplex.bde.org> References: <201808120209.w7C297Ub018593@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DZtnkrlW c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=obyNhTc-XXDjlMljpWoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 09:09:38 -0000 On Wed, 15 Aug 2018, John Baldwin wrote: > On 8/12/18 3:09 AM, Matt Macy wrote: >> >> Log: >> Restore legacy dnode_phys layout on tier 2 arches >> >> Evidently gcc4 doesn't support anonymous union members Even gcc3 supports anonomous union members. Maybe even gcc1. They are a standard gcc feature unless turned off by requesting a stricter standard. Kernel builds are misconfigured by requesting the stricter standard C99 with -std=c99. clang is too broken to support this, but gcc4 -std=c99 resembles a C99 compiler so it doesn't allow anonymous unions. > It does. We use it in 'struct mbuf'. It does require > -fms-extensions which we enable for kernel builds. Perhaps ZFS is > missing this flag due to using custom build flags and/or rules? -fms-extensions is a wart on a bug. After misconfiguring kernel builds using -std=c99, -fms-extensions is misused to add some extensions. It gives many unwanted ms extensions together with extra gcc anonymous unions and some unneeded but harmless extensions for gcc anonymous unions. It doesn't give all gcc extensions AFAIK, so it is surprising that -std=c99 doesn't break more than it does. Very little code compiles with strict C99 compilers. It takes -pedantic as well as well as a -std directive to get nearer to strictness for the requested standard. Apparently not using pedantic, together with using the correct spelling for __asm() and __volatile, hides most of the problems. However, __extension__ is usually not used, so many of the problems should not be hidden. kern.mk enforces its broken standard using CSTD=c99 instead of CSTD?=c99, and then has a lot of garbage ifdefs to support the even more unusable standards k&r, c89, c90, c94 and c95. All these bugs are missing in userland. bsd.sys.mk defaults to the correct standard gnu99 but doesn't enforce it. It uses CSTD?=gnu99. This is followed the same ifdefs. These ifdefs are silly instead of garbage for userland. In theory, the user can request plain k&r, though support for it has rotted and is not needed for for FreeBSD sources. Even the c90 support is unlikely to work. There is no direct support for the more useful standard gnu89. Except for k&r, all the ifdef does is encrypt the standard name into iso-speak. E.g., -std=c99 becomes -std=iso9899:1999, to make CFLAGS and thus make -n output less readable. In the kern.mk, the forced -std=c99 turns into -std=iso-mumble, so might as well be hard-coded as the latter. The -fms-extensions wart is mishandled differently: - in system mk files, it is added to CFLAGS in kern.pre.mk and kmod.mk. - again the addition is unconditional, except it is only done for gcc. clang -std=c99 is apparently so broken that it allows all ms extensions, not just anonymous unions. - in kern.pre.mk, -fms-extensions is added on the same line as -fno-common and an actual gcc4-specific flag -finline-limit. -fno-common is not added anywhere for clang, and clang is not incompatible enough to force it, so clang restores old bugs involving common variables (separate compilation units can have "int x;" or even "int x[1];" and "int x[2];", and the error is not detected). - in kmod.mk, -fms-extensions is on a line by itself, and -fno-common is not broken for clang by mixing it into an unrelated gcc section. The gcc inline flags are on separate lines and merely have style bugs (excessive line splitting for related things, and inconsistent whitespace). Userland is again much better. The fms-extensions wart is missing from all user mk files. Ordinary gcc extensions given by gnu99 (and probably also gnu89) are apparently enough for the much larger userland. It is much larger since it needs to work for ports and also for any extensions in used in kernel headers. E.g., the extensive use of anonymous unions in is not under _KERNEL, so userland must understand it. And userland does understand it since it uses the correct standard gnu99. The wrong CSTD implemented in bsd.sys.mk too, but was quickly backed out since userland has larger test coverage so the bug was obvious. Some history of it there: r115902 in 2003-06-06: default to gnu99 and note than c99 doesn't work since it kills alloca r115942 in 2003-06-07: default to c99 on most arches r116316 in 2003-06-13: default to gnu99 on all arches except i386, since c99 kills alloca on amd65 r116330 in 2003-06-14: don't default to anything, as before this round of churning (only use CSTD if it is already set) r116342 in 2003-06-14: remove all CSTD support r161214 in 2006-08-11: restore CSTD support to almost what it was in r116330 r188801 in 2009-03-14: restore CSTD support to almost what it was in in r115902 (default to the correct standard of gnu89) The userland bugs in this were little more than style bugs except for using the wrong standard. I used to thing that it was a style bug for mk files to set the C standard at all, but it is now clear that unportable code in system headers needs to set the C standard to not actually standard. -std=c99 plus -fgnu99-extensions would be a better way of spelling this than -std-gnu99. The zfs bug might only show up for gcc, by using the broken -std=c99 since it is set very globally in kern.mk, but somehow not using the wart in special rules. But CDDL_CFLAGS uses ${CFLAGS} so it should have everything. Bruce From owner-svn-src-all@freebsd.org Wed Aug 15 10:45:25 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 ACABB107DEE4; Wed, 15 Aug 2018 10:45:25 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 849CE84C78; Wed, 15 Aug 2018 10:45:25 +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 675901354; Wed, 15 Aug 2018 10:45:25 +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 w7FAjPBm050800; Wed, 15 Aug 2018 10:45:25 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FAjPGo050799; Wed, 15 Aug 2018 10:45:25 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201808151045.w7FAjPGo050799@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: Wed, 15 Aug 2018 10:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337835 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 337835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 10:45:25 -0000 Author: 0mp (ports committer) Date: Wed Aug 15 10:45:24 2018 New Revision: 337835 URL: https://svnweb.freebsd.org/changeset/base/337835 Log: make.conf(5): Note that src.conf should not be used for ports and documentation. Reviewed by: bcr, kevans, krion, matthew Approved by: krion (mentor) Differential Revision: https://reviews.freebsd.org/D15177 Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Wed Aug 15 08:45:05 2018 (r337834) +++ head/share/man/man5/make.conf.5 Wed Aug 15 10:45:24 2018 (r337835) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 11, 2018 +.Dd August 15, 2018 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -104,6 +104,13 @@ option of .Xr make 1 or in .Xr environ 7 . +In the case of world and kernel builds it is possible to put these variables +into +.Xr src.conf 5 +instead of +.Nm . +This way the environment for documentation and ports builds is not polluted +by unrelated variables. .Pp The following lists provide a name and short description for each variable you can use during the indicated builds. From owner-svn-src-all@freebsd.org Wed Aug 15 11:39: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 7D6581080516; Wed, 15 Aug 2018 11:39:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27743870B5; Wed, 15 Aug 2018 11:39:14 +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 09B081B6B; Wed, 15 Aug 2018 11:39:14 +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 w7FBdDDT076431; Wed, 15 Aug 2018 11:39:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FBdDj3076430; Wed, 15 Aug 2018 11:39:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808151139.w7FBdDj3076430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 15 Aug 2018 11:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337836 - head/stand/man X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/stand/man X-SVN-Commit-Revision: 337836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 11:39:14 -0000 Author: trasz Date: Wed Aug 15 11:39:13 2018 New Revision: 337836 URL: https://svnweb.freebsd.org/changeset/base/337836 Log: Improve formatting. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/stand/man/loader.8 Modified: head/stand/man/loader.8 ============================================================================== --- head/stand/man/loader.8 Wed Aug 15 10:45:24 2018 (r337835) +++ head/stand/man/loader.8 Wed Aug 15 11:39:13 2018 (r337836) @@ -951,7 +951,7 @@ Access to the command line provides several ways of compromising system security, including, but not limited to: .Pp -.Bl -bullet -compact +.Bl -bullet .It Booting from removable storage, by setting the .Va currdev From owner-svn-src-all@freebsd.org Wed Aug 15 12:12:22 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 3070F1081F27; Wed, 15 Aug 2018 12:12:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAB42890FC; Wed, 15 Aug 2018 12:12:21 +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 BD49821BC; Wed, 15 Aug 2018 12:12:21 +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 w7FCCLlE095700; Wed, 15 Aug 2018 12:12:21 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FCCLJe095699; Wed, 15 Aug 2018 12:12:21 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808151212.w7FCCLJe095699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 15 Aug 2018 12:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337837 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 12:12:22 -0000 Author: trasz Date: Wed Aug 15 12:12:21 2018 New Revision: 337837 URL: https://svnweb.freebsd.org/changeset/base/337837 Log: In the help message at the mountroot prompt, suggest something that actually works and matches the bsdinstall(8) default. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Wed Aug 15 11:39:13 2018 (r337836) +++ head/sys/kern/vfs_mountroot.c Wed Aug 15 12:12:21 2018 (r337837) @@ -508,7 +508,7 @@ parse_dir_ask(char **conf) printf(" and with the specified (optional) option list.\n"); printf("\n"); printf(" eg. ufs:/dev/da0s1a\n"); - printf(" zfs:tank\n"); + printf(" zfs:zroot/ROOT/default\n"); printf(" cd9660:/dev/cd0 ro\n"); printf(" (which is equivalent to: "); printf("mount -t cd9660 -o ro /dev/cd0 /)\n"); From owner-svn-src-all@freebsd.org Wed Aug 15 12:48: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 50C5510832CC; Wed, 15 Aug 2018 12:48:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07C118A741; Wed, 15 Aug 2018 12:48:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD54A26B7; Wed, 15 Aug 2018 12:48: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 w7FCmnBH012184; Wed, 15 Aug 2018 12:48:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FCmnfQ012183; Wed, 15 Aug 2018 12:48:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808151248.w7FCmnfQ012183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Aug 2018 12:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337838 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 337838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 12:48:50 -0000 Author: kib Date: Wed Aug 15 12:48:49 2018 New Revision: 337838 URL: https://svnweb.freebsd.org/changeset/base/337838 Log: Fix early EFIRT on PCID machines after r337773. Ensure that the valid PCID state is created for proc0 pmap, since it might be used by efirt enter() before first context switch on the BSP. Sponsored by: The FreeBSD Foundation MFC after: 6 days Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Aug 15 12:12:21 2018 (r337837) +++ head/sys/amd64/amd64/pmap.c Wed Aug 15 12:48:49 2018 (r337838) @@ -1188,8 +1188,16 @@ pmap_bootstrap(vm_paddr_t *firstaddr) kernel_pmap->pm_pcids[i].pm_pcid = PMAP_PCID_KERN; kernel_pmap->pm_pcids[i].pm_gen = 1; } - PCPU_SET(pcid_next, PMAP_PCID_KERN + 1); + + /* + * PMAP_PCID_KERN + 1 is used for initialization of + * proc0 pmap. The pmap' pcid state might be used by + * EFIRT entry before first context switch, so it + * needs to be valid. + */ + PCPU_SET(pcid_next, PMAP_PCID_KERN + 2); PCPU_SET(pcid_gen, 1); + /* * pcpu area for APs is zeroed during AP startup. * pc_pcid_next and pc_pcid_gen are initialized by AP @@ -2651,8 +2659,8 @@ pmap_pinit0(pmap_t pmap) bzero(&pmap->pm_stats, sizeof pmap->pm_stats); pmap->pm_flags = pmap_flags; CPU_FOREACH(i) { - pmap->pm_pcids[i].pm_pcid = PMAP_PCID_NONE; - pmap->pm_pcids[i].pm_gen = 0; + pmap->pm_pcids[i].pm_pcid = PMAP_PCID_KERN + 1; + pmap->pm_pcids[i].pm_gen = 1; if (!pti) { __pcpu[i].pc_kcr3 = PMAP_NO_CR3; __pcpu[i].pc_ucr3 = PMAP_NO_CR3; From owner-svn-src-all@freebsd.org Wed Aug 15 13:03:02 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 70F1D1083B95; Wed, 15 Aug 2018 13:03:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 271C28B523; Wed, 15 Aug 2018 13:03:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E23F729FC; Wed, 15 Aug 2018 13:03:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FD31om022277; Wed, 15 Aug 2018 13:03:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FD3121022276; Wed, 15 Aug 2018 13:03:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151303.w7FD3121022276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 13:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337839 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 337839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 13:03:02 -0000 Author: andrew Date: Wed Aug 15 13:03:01 2018 New Revision: 337839 URL: https://svnweb.freebsd.org/changeset/base/337839 Log: Remove the VIRT armv7 kernel config. It is supported by GENERIC. Sponsored by: DARPA, AFRL Deleted: head/sys/arm/conf/VIRT From owner-svn-src-all@freebsd.org Wed Aug 15 13:05: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 2E9C41083D20; Wed, 15 Aug 2018 13:05:06 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D84FA8B7A2; Wed, 15 Aug 2018 13:05:05 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B98C429FF; Wed, 15 Aug 2018 13:05:05 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FD55fR022435; Wed, 15 Aug 2018 13:05:05 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FD54QJ022431; Wed, 15 Aug 2018 13:05:04 GMT (envelope-from will@FreeBSD.org) Message-Id: <201808151305.w7FD54QJ022431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Wed, 15 Aug 2018 13:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337840 - in head: cddl/usr.bin/ztest cddl/usr.bin/ztest/tests etc/mtree X-SVN-Group: head X-SVN-Commit-Author: will X-SVN-Commit-Paths: in head: cddl/usr.bin/ztest cddl/usr.bin/ztest/tests etc/mtree X-SVN-Commit-Revision: 337840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 13:05:06 -0000 Author: will Date: Wed Aug 15 13:05:04 2018 New Revision: 337840 URL: https://svnweb.freebsd.org/changeset/base/337840 Log: zfs: add ztest to the kyua test suite. This program is currently failing, and has been for >6 months on HEAD. Ideally, this should be run 24x7 in CI, to discover hard-to-find bugs that only manifest with concurrent i/o. Requested by: lwhsu, mmacy Added: head/cddl/usr.bin/ztest/tests/ head/cddl/usr.bin/ztest/tests/Makefile (contents, props changed) head/cddl/usr.bin/ztest/tests/ztest.sh (contents, props changed) Modified: head/cddl/usr.bin/ztest/Makefile head/etc/mtree/BSD.tests.dist Modified: head/cddl/usr.bin/ztest/Makefile ============================================================================== --- head/cddl/usr.bin/ztest/Makefile Wed Aug 15 13:03:01 2018 (r337839) +++ head/cddl/usr.bin/ztest/Makefile Wed Aug 15 13:05:04 2018 (r337840) @@ -25,4 +25,7 @@ CSTD= c99 # it without debugging. CFLAGS+= -g -DDEBUG=1 -Wno-format +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Added: head/cddl/usr.bin/ztest/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.bin/ztest/tests/Makefile Wed Aug 15 13:05:04 2018 (r337840) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.include + +ATF_TESTS_SH+= ztest + +.include Added: head/cddl/usr.bin/ztest/tests/ztest.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.bin/ztest/tests/ztest.sh Wed Aug 15 13:05:04 2018 (r337840) @@ -0,0 +1,52 @@ +# +# Test Case: ztest +# $FreeBSD$ +# +atf_test_case ztest +ztest_head() +{ + atf_set "descr" "Run ztest" + atf_set "timeout" 900 + atf_set "require.config" "rt_long" +} + +ztest_body() +{ + ARGS="-VVVVV -f ${TMPDIR:-/tmp}" + if atf_config_has ztest_extra_args; then + ARGS="${ARGS} $(atf_config_get ztest_extra_args)" + fi + ztest ${ARGS} + if [ $? != 0 ]; then + echo "failing" + save_ztest_artifacts + atf_fail "Testcase failed" + else + echo "passing" + atf_pass + fi +} + +# +# ATF Test Program Init Function +# +atf_init_test_cases() +{ + atf_add_test_case ztest +} + +save_ztest_artifacts() +{ + # If artifacts_dir is defined, save test artifacts for + # post-mortem analysis + if atf_config_has artifacts_dir; then + TC_ARTIFACTS_DIR=`atf_config_get artifacts_dir`/cddl/usr.bin/ztest/$(atf_get ident) + mkdir -p $TC_ARTIFACTS_DIR + TC_CORE_DIR=/var/crash + if atf_config_has core_dir; then + TC_CORE_DIR=`atf_config_get core_dir` + fi + mv *ztest*.core* $TC_ARTIFACTS_DIR || true + mv ${TC_CORE_DIR}/*ztest*.core* $TC_ARTIFACTS_DIR || true + fi +} Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Aug 15 13:03:01 2018 (r337839) +++ head/etc/mtree/BSD.tests.dist Wed Aug 15 13:05:04 2018 (r337840) @@ -67,6 +67,8 @@ usr.bin ctfconvert .. + ztest + .. .. usr.sbin dtrace From owner-svn-src-all@freebsd.org Wed Aug 15 13:13: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 DEBA510842F0; Wed, 15 Aug 2018 13:13:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9049D8BF8C; Wed, 15 Aug 2018 13:13:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 560E92B95; Wed, 15 Aug 2018 13:13:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FDDKGA027593; Wed, 15 Aug 2018 13:13:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FDDJAl027590; Wed, 15 Aug 2018 13:13:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151313.w7FDDJAl027590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 13:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337841 - in head/sys/arm: conf mv/discovery mv/orion ralink X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: conf mv/discovery mv/orion ralink X-SVN-Commit-Revision: 337841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 13:13:21 -0000 Author: andrew Date: Wed Aug 15 13:13:19 2018 New Revision: 337841 URL: https://svnweb.freebsd.org/changeset/base/337841 Log: Remove PHYSADDR from kernel configurations that don't need it. The only place we need to set it is when we also have FLASHADDR set. Sponsored by: DARPA, AFRL Modified: head/sys/arm/conf/NOTES head/sys/arm/mv/discovery/std.db78xxx head/sys/arm/mv/orion/std.db88f5xxx head/sys/arm/ralink/std.ralink Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Wed Aug 15 13:05:04 2018 (r337840) +++ head/sys/arm/conf/NOTES Wed Aug 15 13:13:19 2018 (r337841) @@ -10,8 +10,6 @@ files "../mv/kirkwood/files.kirkwood" files "../mv/orion/files.db88f5xxx" files "../mv/orion/files.ts7800" -options PHYSADDR=0x00000000 - makeoptions CONF_CFLAGS+="-march=armv5te" makeoptions LDFLAGS="-zmuldefs" makeoptions KERNPHYSADDR=0x00000000 Modified: head/sys/arm/mv/discovery/std.db78xxx ============================================================================== --- head/sys/arm/mv/discovery/std.db78xxx Wed Aug 15 13:05:04 2018 (r337840) +++ head/sys/arm/mv/discovery/std.db78xxx Wed Aug 15 13:13:19 2018 (r337841) @@ -6,4 +6,3 @@ files "../mv/discovery/files.db78xxx" makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 options KERNVIRTADDR=0xc0900000 -options PHYSADDR=0x00000000 Modified: head/sys/arm/mv/orion/std.db88f5xxx ============================================================================== --- head/sys/arm/mv/orion/std.db88f5xxx Wed Aug 15 13:05:04 2018 (r337840) +++ head/sys/arm/mv/orion/std.db88f5xxx Wed Aug 15 13:13:19 2018 (r337841) @@ -6,4 +6,3 @@ files "../mv/orion/files.db88f5xxx" makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 options KERNVIRTADDR=0xc0900000 -options PHYSADDR=0x00000000 Modified: head/sys/arm/ralink/std.ralink ============================================================================== --- head/sys/arm/ralink/std.ralink Wed Aug 15 13:05:04 2018 (r337840) +++ head/sys/arm/ralink/std.ralink Wed Aug 15 13:13:19 2018 (r337841) @@ -8,4 +8,3 @@ options INTRNG makeoptions KERNPHYSADDR=0x40000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNVIRTADDR=0xc0000000 -options PHYSADDR=0x40000000 From owner-svn-src-all@freebsd.org Wed Aug 15 13:19:16 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 7A0A910844E1; Wed, 15 Aug 2018 13:19:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30E508C3CF; Wed, 15 Aug 2018 13:19:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 136282B9F; Wed, 15 Aug 2018 13:19:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FDJF48028200; Wed, 15 Aug 2018 13:19:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FDJFbn028195; Wed, 15 Aug 2018 13:19:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151319.w7FDJFbn028195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 13:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337842 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 337842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 13:19:16 -0000 Author: andrew Date: Wed Aug 15 13:19:15 2018 New Revision: 337842 URL: https://svnweb.freebsd.org/changeset/base/337842 Log: Set the Execute Never flags in EFI device memory as required by the ARMv8 spec. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/efirt_machdep.c Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Wed Aug 15 13:13:19 2018 (r337841) +++ head/sys/arm64/arm64/efirt_machdep.c Wed Aug 15 13:19:15 2018 (r337842) @@ -162,7 +162,7 @@ bool efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) { struct efi_md *p; - pt_entry_t *l3; + pt_entry_t *l3, l3_attr; vm_offset_t va; uint64_t idx; int i, mode; @@ -218,12 +218,17 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int } printf("MAP %lx mode %x pages %lu\n", p->md_phys, mode, p->md_pages); + + l3_attr = ATTR_DEFAULT | ATTR_IDX(mode) | ATTR_AP(ATTR_AP_RW) | + L3_PAGE; + if (mode == VM_MEMATTR_DEVICE) + l3_attr |= ATTR_UXN | ATTR_PXN; + VM_OBJECT_WLOCK(obj_1t1_pt); for (va = p->md_phys, idx = 0; idx < p->md_pages; idx++, va += PAGE_SIZE) { l3 = efi_1t1_l3(va); - *l3 = va | ATTR_DEFAULT | ATTR_IDX(mode) | - ATTR_AP(ATTR_AP_RW) | L3_PAGE; + *l3 = va | l3_attr; } VM_OBJECT_WUNLOCK(obj_1t1_pt); } From owner-svn-src-all@freebsd.org Wed Aug 15 13:22: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 9FEE91084818; Wed, 15 Aug 2018 13:22:49 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 2B7C48C9B4; Wed, 15 Aug 2018 13:22:49 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-wr1-f41.google.com with SMTP id u12-v6so1125043wrr.4; Wed, 15 Aug 2018 06:22:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FpUhUO4NskHbgnSNrahN+ChnUQoOfmsjYOktQdkCQpM=; b=MLHDQo//WDe5lBc2D14VuYx8W5271ECMdqTGMNLruYN7yX/BHcnwJ6lf7z2HN8I1K4 ZlIWrVIEOyvabZPWY+RATb2aZK35stIbntjIimfjSey+aP8AF9TAUqUs3jS1RK7sgriF inuFG+F58yunrH+/yXpbS2AUedUOrUUEEztduTbmYvH1S9q0Vcz3JVIANYuDH6eNC7Eu ur/ChJ2mLN1zDjy78BPBbPdB5mB85qfPqiJmQBkP7Y9lHQgpPgPn1wLmjvDnbI8EEFjM QjQZEQgA7rWv8Wq53eSTMJBeGvecLzlk6ZUSyb3yorfL7oJq24pP1xZ9irTp6cfo9jyh dfXw== X-Gm-Message-State: AOUpUlEcIVcxpb36oWUAmYH3Co70PDVAs6mk2/rRg4XES3jTJDEFToiy WlsVTDNXlqgDpM1QrdCHsabUe/sguk0= X-Google-Smtp-Source: AA+uWPxNGwOwS07+A+2/F2eLxf2LG68oMjI3FIreMPAHo/a9niQtCZaiL5RjPieAWU1B1WMm9tmJtQ== X-Received: by 2002:adf:9086:: with SMTP id i6-v6mr17085761wri.271.1534339361798; Wed, 15 Aug 2018 06:22:41 -0700 (PDT) Received: from e5500 (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id v5-v6sm17043518wru.60.2018.08.15.06.22.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Aug 2018 06:22:41 -0700 (PDT) Date: Wed, 15 Aug 2018 14:22:33 +0100 From: Mateusz Piotrowski <0mp@FreeBSD.org> To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337821 - in head/contrib/amd: . hlfsd Message-ID: <20180815142233.4cf711e5@e5500> In-Reply-To: <20180814221139.GA15272@jarvis> References: <201808142033.w7EKXmQB016507@repo.freebsd.org> <20180814221139.GA15272@jarvis> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; i386-portbld-freebsd11.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 13:22:49 -0000 On Wed, 15 Aug 2018 00:11:40 +0200 Mariusz Zaborski wrote: >On Tue, Aug 14, 2018 at 08:33:48PM +0000, Mateusz Piotrowski wrote: >> Author: 0mp (ports committer) >> Date: Tue Aug 14 20:33:48 2018 >> New Revision: 337821 >> URL: https://svnweb.freebsd.org/changeset/base/337821 >> >> Modified: head/contrib/amd/hlfsd/hlfsd.8 >> ============================================================================== >> --- head/contrib/amd/hlfsd/hlfsd.8 Tue Aug 14 20:26:54 2018 (r337820) >> +++ head/contrib/amd/hlfsd/hlfsd.8 Tue Aug 14 20:33:48 2018 (r337821) >Please bump the date. There's no need to do so according to the FDP. It's just a trivial patch. From owner-svn-src-all@freebsd.org Wed Aug 15 13:40:17 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 63FA2108509E; Wed, 15 Aug 2018 13:40:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19AA78D2B8; Wed, 15 Aug 2018 13:40:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EADA72EC7; Wed, 15 Aug 2018 13:40:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FDeGLW038629; Wed, 15 Aug 2018 13:40:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FDeGHM038625; Wed, 15 Aug 2018 13:40:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151340.w7FDeGHM038625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 13:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337843 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 337843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 13:40:17 -0000 Author: andrew Date: Wed Aug 15 13:40:16 2018 New Revision: 337843 URL: https://svnweb.freebsd.org/changeset/base/337843 Log: Start to remove XScale support from the ARMv4/v5 pmap. Support for XScale has been removed from the kernel so we can remove it from here to help simplify the code. Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/pmap-v4.c head/sys/arm/arm/vm_machdep.c head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Wed Aug 15 13:19:15 2018 (r337842) +++ head/sys/arm/arm/pmap-v4.c Wed Aug 15 13:40:16 2018 (r337843) @@ -406,10 +406,6 @@ static struct rwlock pvh_global_lock; void pmap_copy_page_offs_generic(vm_paddr_t a_phys, vm_offset_t a_offs, vm_paddr_t b_phys, vm_offset_t b_offs, int cnt); -#if ARM_MMU_XSCALE == 1 -void pmap_copy_page_offs_xscale(vm_paddr_t a_phys, vm_offset_t a_offs, - vm_paddr_t b_phys, vm_offset_t b_offs, int cnt); -#endif /* * This list exists for the benefit of pmap_map_chunk(). It keeps track @@ -501,177 +497,7 @@ pmap_pte_init_generic(void) #endif /* ARM_MMU_GENERIC != 0 */ -#if ARM_MMU_XSCALE == 1 -#if (ARM_NMMUS > 1) || defined (CPU_XSCALE_CORE3) -static u_int xscale_use_minidata; -#endif - -void -pmap_pte_init_xscale(void) -{ - uint32_t auxctl; - int write_through = 0; - - pte_l1_s_cache_mode = L1_S_B|L1_S_C|L1_S_XSCALE_P; - pte_l1_s_cache_mask = L1_S_CACHE_MASK_xscale; - - pte_l2_l_cache_mode = L2_B|L2_C; - pte_l2_l_cache_mask = L2_L_CACHE_MASK_xscale; - - pte_l2_s_cache_mode = L2_B|L2_C; - pte_l2_s_cache_mask = L2_S_CACHE_MASK_xscale; - - pte_l1_s_cache_mode_pt = L1_S_C; - pte_l2_l_cache_mode_pt = L2_C; - pte_l2_s_cache_mode_pt = L2_C; -#ifdef XSCALE_CACHE_READ_WRITE_ALLOCATE - /* - * The XScale core has an enhanced mode where writes that - * miss the cache cause a cache line to be allocated. This - * is significantly faster than the traditional, write-through - * behavior of this case. - */ - pte_l1_s_cache_mode |= L1_S_XSCALE_TEX(TEX_XSCALE_X); - pte_l2_l_cache_mode |= L2_XSCALE_L_TEX(TEX_XSCALE_X); - pte_l2_s_cache_mode |= L2_XSCALE_T_TEX(TEX_XSCALE_X); -#endif /* XSCALE_CACHE_READ_WRITE_ALLOCATE */ -#ifdef XSCALE_CACHE_WRITE_THROUGH - /* - * Some versions of the XScale core have various bugs in - * their cache units, the work-around for which is to run - * the cache in write-through mode. Unfortunately, this - * has a major (negative) impact on performance. So, we - * go ahead and run fast-and-loose, in the hopes that we - * don't line up the planets in a way that will trip the - * bugs. - * - * However, we give you the option to be slow-but-correct. - */ - write_through = 1; -#elif defined(XSCALE_CACHE_WRITE_BACK) - /* force write back cache mode */ - write_through = 0; -#elif defined(CPU_XSCALE_PXA2X0) - /* - * Intel PXA2[15]0 processors are known to have a bug in - * write-back cache on revision 4 and earlier (stepping - * A[01] and B[012]). Fixed for C0 and later. - */ - { - uint32_t id, type; - - id = cpu_ident(); - type = id & ~(CPU_ID_XSCALE_COREREV_MASK|CPU_ID_REVISION_MASK); - - if (type == CPU_ID_PXA250 || type == CPU_ID_PXA210) { - if ((id & CPU_ID_REVISION_MASK) < 5) { - /* write through for stepping A0-1 and B0-2 */ - write_through = 1; - } - } - } -#endif /* XSCALE_CACHE_WRITE_THROUGH */ - - if (write_through) { - pte_l1_s_cache_mode = L1_S_C; - pte_l2_l_cache_mode = L2_C; - pte_l2_s_cache_mode = L2_C; - } - -#if (ARM_NMMUS > 1) - xscale_use_minidata = 1; -#endif - - pte_l2_s_prot_u = L2_S_PROT_U_xscale; - pte_l2_s_prot_w = L2_S_PROT_W_xscale; - pte_l2_s_prot_mask = L2_S_PROT_MASK_xscale; - - pte_l1_s_proto = L1_S_PROTO_xscale; - pte_l1_c_proto = L1_C_PROTO_xscale; - pte_l2_s_proto = L2_S_PROTO_xscale; - -#ifdef CPU_XSCALE_CORE3 - pmap_copy_page_func = pmap_copy_page_generic; - pmap_copy_page_offs_func = pmap_copy_page_offs_generic; - pmap_zero_page_func = pmap_zero_page_generic; - xscale_use_minidata = 0; - /* Make sure it is L2-cachable */ - pte_l1_s_cache_mode |= L1_S_XSCALE_TEX(TEX_XSCALE_T); - pte_l1_s_cache_mode_pt = pte_l1_s_cache_mode &~ L1_S_XSCALE_P; - pte_l2_l_cache_mode |= L2_XSCALE_L_TEX(TEX_XSCALE_T) ; - pte_l2_l_cache_mode_pt = pte_l1_s_cache_mode; - pte_l2_s_cache_mode |= L2_XSCALE_T_TEX(TEX_XSCALE_T); - pte_l2_s_cache_mode_pt = pte_l2_s_cache_mode; - -#else - pmap_copy_page_func = pmap_copy_page_xscale; - pmap_copy_page_offs_func = pmap_copy_page_offs_xscale; - pmap_zero_page_func = pmap_zero_page_xscale; -#endif - - /* - * Disable ECC protection of page table access, for now. - */ - __asm __volatile("mrc p15, 0, %0, c1, c0, 1" : "=r" (auxctl)); - auxctl &= ~XSCALE_AUXCTL_P; - __asm __volatile("mcr p15, 0, %0, c1, c0, 1" : : "r" (auxctl)); -} - /* - * xscale_setup_minidata: - * - * Set up the mini-data cache clean area. We require the - * caller to allocate the right amount of physically and - * virtually contiguous space. - */ -extern vm_offset_t xscale_minidata_clean_addr; -extern vm_size_t xscale_minidata_clean_size; /* already initialized */ -void -xscale_setup_minidata(vm_offset_t l1pt, vm_offset_t va, vm_paddr_t pa) -{ - pd_entry_t *pde = (pd_entry_t *) l1pt; - pt_entry_t *pte; - vm_size_t size; - uint32_t auxctl; - - xscale_minidata_clean_addr = va; - - /* Round it to page size. */ - size = (xscale_minidata_clean_size + L2_S_OFFSET) & L2_S_FRAME; - - for (; size != 0; - va += L2_S_SIZE, pa += L2_S_SIZE, size -= L2_S_SIZE) { - pte = (pt_entry_t *) kernel_pt_lookup( - pde[L1_IDX(va)] & L1_C_ADDR_MASK); - if (pte == NULL) - panic("xscale_setup_minidata: can't find L2 table for " - "VA 0x%08x", (u_int32_t) va); - pte[l2pte_index(va)] = - L2_S_PROTO | pa | L2_S_PROT(PTE_KERNEL, VM_PROT_READ) | - L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X); - } - - /* - * Configure the mini-data cache for write-back with - * read/write-allocate. - * - * NOTE: In order to reconfigure the mini-data cache, we must - * make sure it contains no valid data! In order to do that, - * we must issue a global data cache invalidate command! - * - * WE ASSUME WE ARE RUNNING UN-CACHED WHEN THIS ROUTINE IS CALLED! - * THIS IS VERY IMPORTANT! - */ - - /* Invalidate data and mini-data. */ - __asm __volatile("mcr p15, 0, %0, c7, c6, 0" : : "r" (0)); - __asm __volatile("mrc p15, 0, %0, c1, c0, 1" : "=r" (auxctl)); - auxctl = (auxctl & ~XSCALE_AUXCTL_MD_MASK) | XSCALE_AUXCTL_MD_WB_RWA; - __asm __volatile("mcr p15, 0, %0, c1, c0, 1" : : "r" (auxctl)); -} -#endif - -/* * Allocate an L1 translation table for the specified pmap. * This is called at pmap creation time. */ @@ -3984,78 +3810,7 @@ pmap_zero_page_generic(vm_paddr_t phys, int off, int s } #endif /* ARM_MMU_GENERIC != 0 */ -#if ARM_MMU_XSCALE == 1 -void -pmap_zero_page_xscale(vm_paddr_t phys, int off, int size) -{ - - if (_arm_bzero && size >= _min_bzero_size && - _arm_bzero((void *)(phys + off), size, IS_PHYSICAL) == 0) - return; - - mtx_lock(&cmtx); - /* - * Hook in the page, zero it, and purge the cache for that - * zeroed page. Invalidate the TLB as needed. - */ - *cdst_pte = L2_S_PROTO | phys | - L2_S_PROT(PTE_KERNEL, VM_PROT_WRITE) | - L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X); /* mini-data */ - PTE_SYNC(cdst_pte); - cpu_tlb_flushD_SE(cdstp); - cpu_cpwait(); - if (off || size != PAGE_SIZE) - bzero((void *)(cdstp + off), size); - else - bzero_page(cdstp); - mtx_unlock(&cmtx); - xscale_cache_clean_minidata(); -} - /* - * Change the PTEs for the specified kernel mappings such that they - * will use the mini data cache instead of the main data cache. - */ -void -pmap_use_minicache(vm_offset_t va, vm_size_t size) -{ - struct l2_bucket *l2b; - pt_entry_t *ptep, *sptep, pte; - vm_offset_t next_bucket, eva; - -#if (ARM_NMMUS > 1) || defined(CPU_XSCALE_CORE3) - if (xscale_use_minidata == 0) - return; -#endif - - eva = va + size; - - while (va < eva) { - next_bucket = L2_NEXT_BUCKET(va); - if (next_bucket > eva) - next_bucket = eva; - - l2b = pmap_get_l2_bucket(kernel_pmap, va); - - sptep = ptep = &l2b->l2b_kva[l2pte_index(va)]; - - while (va < next_bucket) { - pte = *ptep; - if (!l2pte_minidata(pte)) { - cpu_dcache_wbinv_range(va, PAGE_SIZE); - cpu_tlb_flushD_SE(va); - *ptep = pte & ~L2_B; - } - ptep++; - va += PAGE_SIZE; - } - PTE_SYNC_RANGE(sptep, (u_int)(ptep - sptep)); - } - cpu_cpwait(); -} -#endif /* ARM_MMU_XSCALE == 1 */ - -/* * pmap_zero_page zeros the specified hardware page by mapping * the page into KVM and using bzero to clear its contents. */ @@ -4251,72 +4006,6 @@ pmap_copy_page_offs_generic(vm_paddr_t a_phys, vm_offs cpu_l2cache_wbinv_range(cdstp + b_offs, cnt); } #endif /* ARM_MMU_GENERIC != 0 */ - -#if ARM_MMU_XSCALE == 1 -void -pmap_copy_page_xscale(vm_paddr_t src, vm_paddr_t dst) -{ -#if 0 - /* XXX: Only needed for pmap_clean_page(), which is commented out. */ - struct vm_page *src_pg = PHYS_TO_VM_PAGE(src); -#endif - - /* - * Clean the source page. Hold the source page's lock for - * the duration of the copy so that no other mappings can - * be created while we have a potentially aliased mapping. - */ -#if 0 - /* - * XXX: Not needed while we call cpu_dcache_wbinv_all() in - * pmap_copy_page(). - */ - (void) pmap_clean_page(TAILQ_FIRST(&src_pg->md.pv_list), TRUE); -#endif - /* - * Map the pages into the page hook points, copy them, and purge - * the cache for the appropriate page. Invalidate the TLB - * as required. - */ - mtx_lock(&cmtx); - *csrc_pte = L2_S_PROTO | src | - L2_S_PROT(PTE_KERNEL, VM_PROT_READ) | - L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X); /* mini-data */ - PTE_SYNC(csrc_pte); - *cdst_pte = L2_S_PROTO | dst | - L2_S_PROT(PTE_KERNEL, VM_PROT_WRITE) | - L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X); /* mini-data */ - PTE_SYNC(cdst_pte); - cpu_tlb_flushD_SE(csrcp); - cpu_tlb_flushD_SE(cdstp); - cpu_cpwait(); - bcopy_page(csrcp, cdstp); - mtx_unlock(&cmtx); - xscale_cache_clean_minidata(); -} - -void -pmap_copy_page_offs_xscale(vm_paddr_t a_phys, vm_offset_t a_offs, - vm_paddr_t b_phys, vm_offset_t b_offs, int cnt) -{ - - mtx_lock(&cmtx); - *csrc_pte = L2_S_PROTO | a_phys | - L2_S_PROT(PTE_KERNEL, VM_PROT_READ) | - L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X); - PTE_SYNC(csrc_pte); - *cdst_pte = L2_S_PROTO | b_phys | - L2_S_PROT(PTE_KERNEL, VM_PROT_WRITE) | - L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X); - PTE_SYNC(cdst_pte); - cpu_tlb_flushD_SE(csrcp); - cpu_tlb_flushD_SE(cdstp); - cpu_cpwait(); - bcopy((char *)csrcp + a_offs, (char *)cdstp + b_offs, cnt); - mtx_unlock(&cmtx); - xscale_cache_clean_minidata(); -} -#endif /* ARM_MMU_XSCALE == 1 */ void pmap_copy_page(vm_page_t src, vm_page_t dst) Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Wed Aug 15 13:19:15 2018 (r337842) +++ head/sys/arm/arm/vm_machdep.c Wed Aug 15 13:40:16 2018 (r337843) @@ -105,11 +105,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t /* Point the pcb to the top of the stack */ pcb2 = (struct pcb *) (td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1; -#ifdef __XSCALE__ -#ifndef CPU_XSCALE_CORE3 - pmap_use_minicache(td2->td_kstack, td2->td_kstack_pages * PAGE_SIZE); -#endif -#endif #ifdef VFP /* Store actual state of VFP */ if (curthread == td1) { @@ -311,12 +306,6 @@ cpu_thread_alloc(struct thread *td) * the ARM EABI. */ td->td_frame = (struct trapframe *)((caddr_t)td->td_pcb) - 1; - -#ifdef __XSCALE__ -#ifndef CPU_XSCALE_CORE3 - pmap_use_minicache(td->td_kstack, td->td_kstack_pages * PAGE_SIZE); -#endif -#endif } void Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Wed Aug 15 13:19:15 2018 (r337842) +++ head/sys/arm/include/pmap-v4.h Wed Aug 15 13:40:16 2018 (r337843) @@ -464,16 +464,6 @@ void pmap_zero_page_generic(vm_paddr_t, int, int); void pmap_pte_init_generic(void); #endif /* ARM_MMU_GENERIC != 0 */ -#if ARM_MMU_XSCALE == 1 -void pmap_copy_page_xscale(vm_paddr_t, vm_paddr_t); -void pmap_zero_page_xscale(vm_paddr_t, int, int); - -void pmap_pte_init_xscale(void); - -void xscale_setup_minidata(vm_offset_t, vm_offset_t, vm_offset_t); - -void pmap_use_minicache(vm_offset_t, vm_size_t); -#endif /* ARM_MMU_XSCALE == 1 */ #if defined(CPU_XSCALE_81342) #define ARM_HAVE_SUPERSECTIONS #endif From owner-svn-src-all@freebsd.org Wed Aug 15 13:42:22 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 D650F1085245; Wed, 15 Aug 2018 13:42:22 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CC518D672; Wed, 15 Aug 2018 13:42:22 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E2893057; Wed, 15 Aug 2018 13:42:22 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FDgMSZ043379; Wed, 15 Aug 2018 13:42:22 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FDgMTh043378; Wed, 15 Aug 2018 13:42:22 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808151342.w7FDgMTh043378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 15 Aug 2018 13:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337844 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 337844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 13:42:23 -0000 Author: loos Date: Wed Aug 15 13:42:22 2018 New Revision: 337844 URL: https://svnweb.freebsd.org/changeset/base/337844 Log: The interface name must be sanitized before the search to match the existing netgraph node. Fixes the search (and use) of VLANs with dot notation. Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/netgraph/ng_ether.c Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Wed Aug 15 13:40:16 2018 (r337843) +++ head/sys/netgraph/ng_ether.c Wed Aug 15 13:42:22 2018 (r337844) @@ -314,7 +314,8 @@ ng_ether_attach(struct ifnet *ifp) * eiface nodes, which may be problematic due to naming * clashes. */ - if ((node = ng_name2noderef(NULL, ifp->if_xname)) != NULL) { + ng_ether_sanitize_ifname(ifp->if_xname, name); + if ((node = ng_name2noderef(NULL, name)) != NULL) { NG_NODE_UNREF(node); return; } @@ -341,7 +342,6 @@ ng_ether_attach(struct ifnet *ifp) priv->hwassist = ifp->if_hwassist; /* Try to give the node the same name as the interface */ - ng_ether_sanitize_ifname(ifp->if_xname, name); if (ng_name_node(node, name) != 0) log(LOG_WARNING, "%s: can't name node %s\n", __func__, name); } From owner-svn-src-all@freebsd.org Wed Aug 15 13:49: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 D1DAE10853F9; Wed, 15 Aug 2018 13:49:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 850388D95D; Wed, 15 Aug 2018 13:49:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6214A306E; Wed, 15 Aug 2018 13:49:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FDn0qU043722; Wed, 15 Aug 2018 13:49:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FDn03G043720; Wed, 15 Aug 2018 13:49:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151349.w7FDn03G043720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 13:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337845 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 337845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 13:49:01 -0000 Author: andrew Date: Wed Aug 15 13:48:59 2018 New Revision: 337845 URL: https://svnweb.freebsd.org/changeset/base/337845 Log: Remove checks for now unsupported CPU_* values in arm headers. Sponsored by: DARPA, AFRL Modified: head/sys/arm/include/intr.h head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Wed Aug 15 13:42:22 2018 (r337844) +++ head/sys/arm/include/intr.h Wed Aug 15 13:48:59 2018 (r337845) @@ -68,14 +68,9 @@ int intr_pic_ipi_setup(u_int, const char *, intr_ipi_h #else /* INTRNG */ /* XXX move to std.* files? */ -#ifdef CPU_XSCALE_81342 -#define NIRQ 128 -#elif defined(CPU_XSCALE_PXA2X0) -#include -#define NIRQ IRQ_GPIO_MAX -#elif defined(SOC_MV_DISCOVERY) +#if defined(SOC_MV_DISCOVERY) #define NIRQ 96 -#elif defined(CPU_ARM9) || defined(SOC_MV_KIRKWOOD) +#elif defined(SOC_MV_KIRKWOOD) #define NIRQ 64 #elif defined(CPU_CORTEXA) #define NIRQ 1020 Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Wed Aug 15 13:42:22 2018 (r337844) +++ head/sys/arm/include/pmap-v4.h Wed Aug 15 13:48:59 2018 (r337845) @@ -57,19 +57,13 @@ * some theoretical support for multiple MMU types in a single kernel, there are * no actual working configurations that use that feature. */ -#if (defined(CPU_ARM9) || defined(CPU_ARM9E) || defined(CPU_FA526)) +#if defined(CPU_ARM9E) #define ARM_MMU_GENERIC 1 #else #define ARM_MMU_GENERIC 0 #endif -#if (defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_81342)) -#define ARM_MMU_XSCALE 1 -#else -#define ARM_MMU_XSCALE 0 -#endif - -#define ARM_NMMUS (ARM_MMU_GENERIC + ARM_MMU_XSCALE) +#define ARM_NMMUS (ARM_MMU_GENERIC) #if ARM_NMMUS == 0 && !defined(KLD_MODULE) && defined(_KERNEL) #error ARM_NMMUS is 0 #endif @@ -338,19 +332,6 @@ extern int pmap_needs_pte_sync; #define L1_S_PROTO L1_S_PROTO_generic #define L1_C_PROTO L1_C_PROTO_generic #define L2_S_PROTO L2_S_PROTO_generic - -#elif ARM_MMU_XSCALE == 1 -#define L2_S_PROT_U L2_S_PROT_U_xscale -#define L2_S_PROT_W L2_S_PROT_W_xscale -#define L2_S_PROT_MASK L2_S_PROT_MASK_xscale - -#define L1_S_CACHE_MASK L1_S_CACHE_MASK_xscale -#define L2_L_CACHE_MASK L2_L_CACHE_MASK_xscale -#define L2_S_CACHE_MASK L2_S_CACHE_MASK_xscale - -#define L1_S_PROTO L1_S_PROTO_xscale -#define L1_C_PROTO L1_C_PROTO_xscale -#define L2_S_PROTO L2_S_PROTO_xscale #endif /* ARM_NMMUS > 1 */ From owner-svn-src-all@freebsd.org Wed Aug 15 13:52: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 779B81085600; Wed, 15 Aug 2018 13:52:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DA378DD5D; Wed, 15 Aug 2018 13:52:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA7E931FA; Wed, 15 Aug 2018 13:52:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FDqV0I048516; Wed, 15 Aug 2018 13:52:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FDqVcI048515; Wed, 15 Aug 2018 13:52:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151352.w7FDqVcI048515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 13:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337846 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 337846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 13:52:32 -0000 Author: andrew Date: Wed Aug 15 13:52:31 2018 New Revision: 337846 URL: https://svnweb.freebsd.org/changeset/base/337846 Log: Remove the ARMv5 pmap function pointers. These were to support XScale so are now unused. Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/pmap-v4.c Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Wed Aug 15 13:48:59 2018 (r337845) +++ head/sys/arm/arm/pmap-v4.c Wed Aug 15 13:52:31 2018 (r337846) @@ -260,12 +260,6 @@ pt_entry_t pte_l1_s_proto; pt_entry_t pte_l1_c_proto; pt_entry_t pte_l2_s_proto; -void (*pmap_copy_page_func)(vm_paddr_t, vm_paddr_t); -void (*pmap_copy_page_offs_func)(vm_paddr_t a_phys, - vm_offset_t a_offs, vm_paddr_t b_phys, vm_offset_t b_offs, - int cnt); -void (*pmap_zero_page_func)(vm_paddr_t, int, int); - /* * Crashdump maps. */ @@ -489,10 +483,6 @@ pmap_pte_init_generic(void) pte_l1_s_proto = L1_S_PROTO_generic; pte_l1_c_proto = L1_C_PROTO_generic; pte_l2_s_proto = L2_S_PROTO_generic; - - pmap_copy_page_func = pmap_copy_page_generic; - pmap_copy_page_offs_func = pmap_copy_page_offs_generic; - pmap_zero_page_func = pmap_zero_page_generic; } #endif /* ARM_MMU_GENERIC != 0 */ @@ -3817,7 +3807,7 @@ pmap_zero_page_generic(vm_paddr_t phys, int off, int s void pmap_zero_page(vm_page_t m) { - pmap_zero_page_func(VM_PAGE_TO_PHYS(m), 0, PAGE_SIZE); + pmap_zero_page_generic(VM_PAGE_TO_PHYS(m), 0, PAGE_SIZE); } @@ -3831,7 +3821,7 @@ void pmap_zero_page_area(vm_page_t m, int off, int size) { - pmap_zero_page_func(VM_PAGE_TO_PHYS(m), off, size); + pmap_zero_page_generic(VM_PAGE_TO_PHYS(m), off, size); } @@ -4017,7 +4007,7 @@ pmap_copy_page(vm_page_t src, vm_page_t dst) _arm_memcpy((void *)VM_PAGE_TO_PHYS(dst), (void *)VM_PAGE_TO_PHYS(src), PAGE_SIZE, IS_PHYSICAL) == 0) return; - pmap_copy_page_func(VM_PAGE_TO_PHYS(src), VM_PAGE_TO_PHYS(dst)); + pmap_copy_page_generic(VM_PAGE_TO_PHYS(src), VM_PAGE_TO_PHYS(dst)); } /* @@ -4045,7 +4035,7 @@ pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, b_pg = mb[b_offset >> PAGE_SHIFT]; b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); - pmap_copy_page_offs_func(VM_PAGE_TO_PHYS(a_pg), a_pg_offset, + pmap_copy_page_offs_generic(VM_PAGE_TO_PHYS(a_pg), a_pg_offset, VM_PAGE_TO_PHYS(b_pg), b_pg_offset, cnt); xfersize -= cnt; a_offset += cnt; From owner-svn-src-all@freebsd.org Wed Aug 15 14:19:09 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 45AFB105534E; Wed, 15 Aug 2018 14:19:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFF4F8F0C1; Wed, 15 Aug 2018 14:19:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B71AD38AD; Wed, 15 Aug 2018 14:19:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FEJ8oL058976; Wed, 15 Aug 2018 14:19:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FEJ8rK058973; Wed, 15 Aug 2018 14:19:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151419.w7FEJ8rK058973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 14:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337847 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 337847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 14:19:09 -0000 Author: andrew Date: Wed Aug 15 14:19:07 2018 New Revision: 337847 URL: https://svnweb.freebsd.org/changeset/base/337847 Log: Remove ARM_MMU_GENERIC, it's the only ARMV4/v5 MMU we support. Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/pmap-v4.c head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Wed Aug 15 13:52:31 2018 (r337846) +++ head/sys/arm/arm/pmap-v4.c Wed Aug 15 14:19:07 2018 (r337847) @@ -447,7 +447,6 @@ kernel_pt_lookup(vm_paddr_t pa) return (0); } -#if ARM_MMU_GENERIC != 0 void pmap_pte_init_generic(void) { @@ -485,8 +484,6 @@ pmap_pte_init_generic(void) pte_l2_s_proto = L2_S_PROTO_generic; } -#endif /* ARM_MMU_GENERIC != 0 */ - /* * Allocate an L1 translation table for the specified pmap. * This is called at pmap creation time. @@ -3771,7 +3768,6 @@ pmap_remove(pmap_t pm, vm_offset_t sva, vm_offset_t ev * StrongARM accesses to non-cached pages are non-burst making writing * _any_ bulk data very slow. */ -#if ARM_MMU_GENERIC != 0 || defined(CPU_XSCALE_CORE3) void pmap_zero_page_generic(vm_paddr_t phys, int off, int size) { @@ -3798,7 +3794,6 @@ pmap_zero_page_generic(vm_paddr_t phys, int off, int s mtx_unlock(&cmtx); } -#endif /* ARM_MMU_GENERIC != 0 */ /* * pmap_zero_page zeros the specified hardware page by mapping @@ -3930,7 +3925,6 @@ pmap_clean_page(struct pv_entry *pv, boolean_t is_src) * hook points. The same comment regarding cachability as in * pmap_zero_page also applies here. */ -#if ARM_MMU_GENERIC != 0 || defined (CPU_XSCALE_CORE3) void pmap_copy_page_generic(vm_paddr_t src, vm_paddr_t dst) { @@ -3995,7 +3989,6 @@ pmap_copy_page_offs_generic(vm_paddr_t a_phys, vm_offs cpu_l2cache_inv_range(csrcp + a_offs, cnt); cpu_l2cache_wbinv_range(cdstp + b_offs, cnt); } -#endif /* ARM_MMU_GENERIC != 0 */ void pmap_copy_page(vm_page_t src, vm_page_t dst) Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Wed Aug 15 13:52:31 2018 (r337846) +++ head/sys/arm/include/pmap-v4.h Wed Aug 15 14:19:07 2018 (r337847) @@ -53,22 +53,6 @@ #include /* - * Define the MMU types we support based on the cpu types. While the code has - * some theoretical support for multiple MMU types in a single kernel, there are - * no actual working configurations that use that feature. - */ -#if defined(CPU_ARM9E) -#define ARM_MMU_GENERIC 1 -#else -#define ARM_MMU_GENERIC 0 -#endif - -#define ARM_NMMUS (ARM_MMU_GENERIC) -#if ARM_NMMUS == 0 && !defined(KLD_MODULE) && defined(_KERNEL) -#error ARM_NMMUS is 0 -#endif - -/* * Pte related macros */ #define PTE_NOCACHE 1 @@ -306,21 +290,6 @@ extern int pmap_needs_pte_sync; */ #define L2_AP(x) (L2_AP0(x) | L2_AP1(x) | L2_AP2(x) | L2_AP3(x)) -#if ARM_NMMUS > 1 -/* More than one MMU class configured; use variables. */ -#define L2_S_PROT_U pte_l2_s_prot_u -#define L2_S_PROT_W pte_l2_s_prot_w -#define L2_S_PROT_MASK pte_l2_s_prot_mask - -#define L1_S_CACHE_MASK pte_l1_s_cache_mask -#define L2_L_CACHE_MASK pte_l2_l_cache_mask -#define L2_S_CACHE_MASK pte_l2_s_cache_mask - -#define L1_S_PROTO pte_l1_s_proto -#define L1_C_PROTO pte_l1_c_proto -#define L2_S_PROTO pte_l2_s_proto - -#elif ARM_MMU_GENERIC != 0 #define L2_S_PROT_U L2_S_PROT_U_generic #define L2_S_PROT_W L2_S_PROT_W_generic #define L2_S_PROT_MASK L2_S_PROT_MASK_generic @@ -333,8 +302,6 @@ extern int pmap_needs_pte_sync; #define L1_C_PROTO L1_C_PROTO_generic #define L2_S_PROTO L2_S_PROTO_generic -#endif /* ARM_NMMUS > 1 */ - #if defined(CPU_XSCALE_81342) #define CPU_XSCALE_CORE3 #define PMAP_NEEDS_PTE_SYNC 1 @@ -438,12 +405,10 @@ extern void (*pmap_copy_page_offs_func)(vm_paddr_t a_p vm_offset_t a_offs, vm_paddr_t b_phys, vm_offset_t b_offs, int cnt); extern void (*pmap_zero_page_func)(vm_paddr_t, int, int); -#if ARM_MMU_GENERIC != 0 || defined(CPU_XSCALE_81342) void pmap_copy_page_generic(vm_paddr_t, vm_paddr_t); void pmap_zero_page_generic(vm_paddr_t, int, int); void pmap_pte_init_generic(void); -#endif /* ARM_MMU_GENERIC != 0 */ #if defined(CPU_XSCALE_81342) #define ARM_HAVE_SUPERSECTIONS From owner-svn-src-all@freebsd.org Wed Aug 15 14:29: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 B9FBB1055876; Wed, 15 Aug 2018 14:29:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EB8C8F7AF; Wed, 15 Aug 2018 14:29:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BBCD3B1F; Wed, 15 Aug 2018 14:29:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FET5oL064143; Wed, 15 Aug 2018 14:29:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FET4rK064141; Wed, 15 Aug 2018 14:29:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151429.w7FET4rK064141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 14:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337848 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 337848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 14:29:05 -0000 Author: andrew Date: Wed Aug 15 14:29:04 2018 New Revision: 337848 URL: https://svnweb.freebsd.org/changeset/base/337848 Log: Remove arm pmap variables that are only ever set and never read. Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/pmap-v4.c head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Wed Aug 15 14:19:07 2018 (r337847) +++ head/sys/arm/arm/pmap-v4.c Wed Aug 15 14:29:04 2018 (r337848) @@ -252,14 +252,6 @@ pt_entry_t pte_l2_s_cache_mode; pt_entry_t pte_l2_s_cache_mode_pt; pt_entry_t pte_l2_s_cache_mask; -pt_entry_t pte_l2_s_prot_u; -pt_entry_t pte_l2_s_prot_w; -pt_entry_t pte_l2_s_prot_mask; - -pt_entry_t pte_l1_s_proto; -pt_entry_t pte_l1_c_proto; -pt_entry_t pte_l2_s_proto; - /* * Crashdump maps. */ @@ -474,14 +466,6 @@ pmap_pte_init_generic(void) pte_l2_l_cache_mode_pt = L2_C; pte_l2_s_cache_mode_pt = L2_C; } - - pte_l2_s_prot_u = L2_S_PROT_U_generic; - pte_l2_s_prot_w = L2_S_PROT_W_generic; - pte_l2_s_prot_mask = L2_S_PROT_MASK_generic; - - pte_l1_s_proto = L1_S_PROTO_generic; - pte_l1_c_proto = L1_C_PROTO_generic; - pte_l2_s_proto = L2_S_PROTO_generic; } /* Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Wed Aug 15 14:19:07 2018 (r337847) +++ head/sys/arm/include/pmap-v4.h Wed Aug 15 14:29:04 2018 (r337848) @@ -392,14 +392,6 @@ extern pt_entry_t pte_l1_s_cache_mode_pt; extern pt_entry_t pte_l2_l_cache_mode_pt; extern pt_entry_t pte_l2_s_cache_mode_pt; -extern pt_entry_t pte_l2_s_prot_u; -extern pt_entry_t pte_l2_s_prot_w; -extern pt_entry_t pte_l2_s_prot_mask; - -extern pt_entry_t pte_l1_s_proto; -extern pt_entry_t pte_l1_c_proto; -extern pt_entry_t pte_l2_s_proto; - extern void (*pmap_copy_page_func)(vm_paddr_t, vm_paddr_t); extern void (*pmap_copy_page_offs_func)(vm_paddr_t a_phys, vm_offset_t a_offs, vm_paddr_t b_phys, vm_offset_t b_offs, int cnt); From owner-svn-src-all@freebsd.org Wed Aug 15 14:41:28 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 C2A421055F3A; Wed, 15 Aug 2018 14:41:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7743D90028; Wed, 15 Aug 2018 14:41:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59E793D15; Wed, 15 Aug 2018 14:41:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FEfRXL071954; Wed, 15 Aug 2018 14:41:27 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FEfP2u071943; Wed, 15 Aug 2018 14:41:25 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808151441.w7FEfP2u071943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 15 Aug 2018 14:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337849 - in head: bin/csh bin/sh etc etc/root X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: bin/csh bin/sh etc etc/root X-SVN-Commit-Revision: 337849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 14:41:28 -0000 Author: brd Date: Wed Aug 15 14:41:24 2018 New Revision: 337849 URL: https://svnweb.freebsd.org/changeset/base/337849 Log: Move all sh and csh files into bin/sh/ or bin/csh/ This simplifies pkgbase by migrating these to CONFS so they are properly tagged as config files. Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D16708 Added: head/bin/csh/csh.cshrc - copied unchanged from r337848, head/etc/csh.cshrc head/bin/csh/csh.login - copied unchanged from r337848, head/etc/csh.login head/bin/csh/csh.logout - copied unchanged from r337848, head/etc/csh.logout head/bin/csh/dot.cshrc - copied unchanged from r337848, head/etc/root/dot.cshrc head/bin/csh/dot.login - copied unchanged from r337848, head/etc/root/dot.login head/bin/sh/dot.profile - copied unchanged from r337848, head/etc/root/dot.profile head/bin/sh/profile - copied unchanged from r337848, head/etc/profile Deleted: head/etc/csh.cshrc head/etc/csh.login head/etc/csh.logout head/etc/profile head/etc/root/dot.cshrc head/etc/root/dot.login head/etc/root/dot.profile Modified: head/bin/csh/Makefile head/bin/sh/Makefile head/etc/Makefile Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Wed Aug 15 14:29:04 2018 (r337848) +++ head/bin/csh/Makefile Wed Aug 15 14:41:24 2018 (r337849) @@ -8,6 +8,11 @@ .include +CONFGROUPS= ETC ROOT +ETC= csh.cshrc csh.login csh.logout +ROOT= dot.cshrc +ROOTDIR= /root +ROOTNAME= .cshrc PACKAGE=runtime TCSHDIR= ${SRCTOP}/contrib/tcsh .PATH: ${TCSHDIR} @@ -44,7 +49,8 @@ MLINKS= csh.1 tcsh.1 LIBADD= termcapw crypt -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ + /root/.cshrc /.cshrc CLEANFILES= ${GENHDRS} gethost csh.1 @@ -147,5 +153,12 @@ tc.const.h: tc.const.c sh.char.h config.h config_f.h s sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \ sort >> ${.TARGET} @echo '#endif /* _h_tc_const */' >> ${.TARGET} + +beforeinstall: + rm -f ${DESTDIR}/.cshrc + +afterinstallconfig: + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .include Copied: head/bin/csh/csh.cshrc (from r337848, head/etc/csh.cshrc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/csh/csh.cshrc Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/csh.cshrc) @@ -0,0 +1,3 @@ +# $FreeBSD$ +# +# System-wide .cshrc file for csh(1). Copied: head/bin/csh/csh.login (from r337848, head/etc/csh.login) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/csh/csh.login Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/csh.login) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# +# System-wide .login file for csh(1). +# Uncomment this to give you the default 4.2 behavior, where disk +# information is shown in K-Blocks +# setenv BLOCKSIZE K +# +# For the setting of languages and character sets please see +# login.conf(5) and in particular the charset and lang options. +# For full locales list check /usr/share/locale/* +# +# Check system messages +# msgs -q +# Allow terminal messages +# mesg y Copied: head/bin/csh/csh.logout (from r337848, head/etc/csh.logout) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/csh/csh.logout Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/csh.logout) @@ -0,0 +1,3 @@ +# $FreeBSD$ +# +# System-wide .logout file for csh(1). Copied: head/bin/csh/dot.cshrc (from r337848, head/etc/root/dot.cshrc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/csh/dot.cshrc Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/root/dot.cshrc) @@ -0,0 +1,43 @@ +# $FreeBSD$ +# +# .cshrc - csh resource script, read at beginning of execution by each shell +# +# see also csh(1), environ(7). +# more examples available at /usr/share/examples/csh/ +# + +alias h history 25 +alias j jobs -l +alias la ls -aF +alias lf ls -FA +alias ll ls -lAF + +# A righteous umask +umask 22 + +set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) + +setenv EDITOR vi +setenv PAGER less +setenv BLOCKSIZE K + +if ($?prompt) then + # An interactive shell -- set some stuff up + set prompt = "%N@%m:%~ %# " + set promptchars = "%#" + + set filec + set history = 1000 + set savehist = (1000 merge) + set autolist = ambiguous + # Use history to aid expansion + set autoexpand + set autorehash + set mail = (/var/mail/$USER) + if ( $?tcsh ) then + bindkey "^W" backward-delete-word + bindkey -k up history-search-backward + bindkey -k down history-search-forward + endif + +endif Copied: head/bin/csh/dot.login (from r337848, head/etc/root/dot.login) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/csh/dot.login Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/root/dot.login) @@ -0,0 +1,12 @@ +# $FreeBSD$ +# +# .login - csh login script, read by login shell, after `.cshrc' at login. +# +# See also csh(1), environ(7). +# + +# Query terminal size; useful for serial lines. +if ( -x /usr/bin/resizewin ) /usr/bin/resizewin -z + +# Uncomment to display a random cookie on each login. +# if ( -x /usr/bin/fortune ) /usr/bin/fortune -s Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Wed Aug 15 14:29:04 2018 (r337848) +++ head/bin/sh/Makefile Wed Aug 15 14:41:24 2018 (r337849) @@ -3,6 +3,9 @@ .include +CONFS= dot.profile profile +CONFSDIR_dot.profile= /root +CONFSNAME_dot.profile= .profile PACKAGE=runtime PROG= sh INSTALLFLAGS= -S @@ -34,6 +37,7 @@ WFORMAT=0 CLEANFILES+= mknodes mksyntax CLEANFILES+= ${GENSRCS} ${GENHDRS} +LINKS= /root/.profile /.profile build-tools: mknodes mksyntax @@ -59,5 +63,8 @@ token.h: mktokens HAS_TESTS= SUBDIR.${MK_TESTS}+= tests + +beforeinstall: + rm -f ${DESTDIR}/.profile .include Copied: head/bin/sh/dot.profile (from r337848, head/etc/root/dot.profile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/dot.profile Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/root/dot.profile) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin +export PATH +HOME=/root +export HOME +TERM=${TERM:-xterm} +export TERM +PAGER=less +export PAGER + +# Query terminal size; useful for serial lines. +if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi + +# Uncomment to display a random cookie on each login. +# if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune -s ; fi Copied: head/bin/sh/profile (from r337848, head/etc/profile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/profile Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/profile) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# +# System-wide .profile file for sh(1). +# +# Uncomment this to give you the default 4.2 behavior, where disk +# information is shown in K-Blocks +# BLOCKSIZE=K; export BLOCKSIZE +# +# For the setting of languages and character sets please see +# login.conf(5) and in particular the charset and lang options. +# For full locales list check /usr/share/locale/* +# You should also read the setlocale(3) man page for information +# on how to achieve more precise control of locale settings. +# +# Check system messages +# msgs -q +# Allow terminal messages +# mesg y Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Aug 15 14:29:04 2018 (r337848) +++ head/etc/Makefile Wed Aug 15 14:41:24 2018 (r337849) @@ -33,7 +33,6 @@ BIN1= crontab \ networks \ nsswitch.conf \ phones \ - profile \ protocols \ rc.bsdextended \ rc.firewall \ @@ -88,10 +87,6 @@ SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf BIN1+= rc.sendmail .endif -.if ${MK_TCSH} != "no" -BIN1+= csh.cshrc csh.login csh.logout -.endif - .if ${MK_WIRELESS} != "no" BIN1+= regdomain.xml .endif @@ -145,10 +140,6 @@ distribution: ${DESTDIR}/etc/services; .endif -.if ${MK_TCSH} == "no" - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd -.endif - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .if defined(NO_ROOT) ( \ echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \ @@ -190,20 +181,7 @@ distribution: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ dot.k5login ${DESTDIR}/root/.k5login; .endif - cd ${.CURDIR}/root; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dot.profile ${DESTDIR}/root/.profile; \ - rm -f ${DESTDIR}/.profile; \ - ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile -.if ${MK_TCSH} != "no" - cd ${.CURDIR}/root; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dot.cshrc ${DESTDIR}/root/.cshrc; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dot.login ${DESTDIR}/root/.login; \ - rm -f ${DESTDIR}/.cshrc; \ - ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc -.endif + .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail From owner-svn-src-all@freebsd.org Wed Aug 15 14:45:02 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 CA98310584D3; Wed, 15 Aug 2018 14:45:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 805E690472; Wed, 15 Aug 2018 14:45:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47F1B3E6D; Wed, 15 Aug 2018 14:45:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FEj2Rs074532; Wed, 15 Aug 2018 14:45:02 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FEj1js074530; Wed, 15 Aug 2018 14:45:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151445.w7FEj1js074530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 14:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337850 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 337850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 14:45:03 -0000 Author: andrew Date: Wed Aug 15 14:45:01 2018 New Revision: 337850 URL: https://svnweb.freebsd.org/changeset/base/337850 Log: Make code and data only used within the arm pmap code as static. Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/pmap-v4.c head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Wed Aug 15 14:41:24 2018 (r337849) +++ head/sys/arm/arm/pmap-v4.c Wed Aug 15 14:45:01 2018 (r337850) @@ -240,17 +240,17 @@ static void pmap_init_l1(struct l1_ttable *, pd_entry * them (though, they shouldn't). */ -pt_entry_t pte_l1_s_cache_mode; -pt_entry_t pte_l1_s_cache_mode_pt; -pt_entry_t pte_l1_s_cache_mask; +static pt_entry_t pte_l1_s_cache_mode; +static pt_entry_t pte_l1_s_cache_mode_pt; +static pt_entry_t pte_l1_s_cache_mask; -pt_entry_t pte_l2_l_cache_mode; -pt_entry_t pte_l2_l_cache_mode_pt; -pt_entry_t pte_l2_l_cache_mask; +static pt_entry_t pte_l2_l_cache_mode; +static pt_entry_t pte_l2_l_cache_mode_pt; +static pt_entry_t pte_l2_l_cache_mask; -pt_entry_t pte_l2_s_cache_mode; -pt_entry_t pte_l2_s_cache_mode_pt; -pt_entry_t pte_l2_s_cache_mask; +static pt_entry_t pte_l2_s_cache_mode; +static pt_entry_t pte_l2_s_cache_mode_pt; +static pt_entry_t pte_l2_s_cache_mask; /* * Crashdump maps. @@ -3752,7 +3752,7 @@ pmap_remove(pmap_t pm, vm_offset_t sva, vm_offset_t ev * StrongARM accesses to non-cached pages are non-burst making writing * _any_ bulk data very slow. */ -void +static void pmap_zero_page_generic(vm_paddr_t phys, int off, int size) { @@ -3909,7 +3909,7 @@ pmap_clean_page(struct pv_entry *pv, boolean_t is_src) * hook points. The same comment regarding cachability as in * pmap_zero_page also applies here. */ -void +static void pmap_copy_page_generic(vm_paddr_t src, vm_paddr_t dst) { #if 0 Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Wed Aug 15 14:41:24 2018 (r337849) +++ head/sys/arm/include/pmap-v4.h Wed Aug 15 14:45:01 2018 (r337850) @@ -379,27 +379,6 @@ do { \ cpu_drain_writebuf(); \ } while (/*CONSTCOND*/0) -extern pt_entry_t pte_l1_s_cache_mode; -extern pt_entry_t pte_l1_s_cache_mask; - -extern pt_entry_t pte_l2_l_cache_mode; -extern pt_entry_t pte_l2_l_cache_mask; - -extern pt_entry_t pte_l2_s_cache_mode; -extern pt_entry_t pte_l2_s_cache_mask; - -extern pt_entry_t pte_l1_s_cache_mode_pt; -extern pt_entry_t pte_l2_l_cache_mode_pt; -extern pt_entry_t pte_l2_s_cache_mode_pt; - -extern void (*pmap_copy_page_func)(vm_paddr_t, vm_paddr_t); -extern void (*pmap_copy_page_offs_func)(vm_paddr_t a_phys, - vm_offset_t a_offs, vm_paddr_t b_phys, vm_offset_t b_offs, int cnt); -extern void (*pmap_zero_page_func)(vm_paddr_t, int, int); - -void pmap_copy_page_generic(vm_paddr_t, vm_paddr_t); -void pmap_zero_page_generic(vm_paddr_t, int, int); - void pmap_pte_init_generic(void); #if defined(CPU_XSCALE_81342) From owner-svn-src-all@freebsd.org Wed Aug 15 14:52: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 A29DF10588E3; Wed, 15 Aug 2018 14:52:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EE2A90AB7; Wed, 15 Aug 2018 14:52:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29B464050; Wed, 15 Aug 2018 14:52:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FEqvSs079478; Wed, 15 Aug 2018 14:52:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FEquCq079477; Wed, 15 Aug 2018 14:52:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151452.w7FEquCq079477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 14:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337851 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 337851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 14:52:57 -0000 Author: andrew Date: Wed Aug 15 14:52:56 2018 New Revision: 337851 URL: https://svnweb.freebsd.org/changeset/base/337851 Log: Remove ARM_HAVE_SUPERSECTIONS. It was only supported on some XScale CPUs. Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/pmap-v4.c head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Wed Aug 15 14:45:01 2018 (r337850) +++ head/sys/arm/arm/pmap-v4.c Wed Aug 15 14:52:56 2018 (r337851) @@ -2369,36 +2369,6 @@ pmap_remove_pages(pmap_t pmap) * Low level mapping routines..... ***************************************************/ -#ifdef ARM_HAVE_SUPERSECTIONS -/* Map a super section into the KVA. */ - -void -pmap_kenter_supersection(vm_offset_t va, uint64_t pa, int flags) -{ - pd_entry_t pd = L1_S_PROTO | L1_S_SUPERSEC | (pa & L1_SUP_FRAME) | - (((pa >> 32) & 0xf) << 20) | L1_S_PROT(PTE_KERNEL, - VM_PROT_READ|VM_PROT_WRITE) | L1_S_DOM(PMAP_DOMAIN_KERNEL); - struct l1_ttable *l1; - vm_offset_t va0, va_end; - - KASSERT(((va | pa) & L1_SUP_OFFSET) == 0, - ("Not a valid super section mapping")); - if (flags & SECTION_CACHE) - pd |= pte_l1_s_cache_mode; - else if (flags & SECTION_PT) - pd |= pte_l1_s_cache_mode_pt; - va0 = va & L1_SUP_FRAME; - va_end = va + L1_SUP_SIZE; - SLIST_FOREACH(l1, &l1_list, l1_link) { - va = va0; - for (; va < va_end; va += L1_S_SIZE) { - l1->l1_kva[L1_IDX(va)] = pd; - PTE_SYNC(&l1->l1_kva[L1_IDX(va)]); - } - } -} -#endif - /* Map a section into the KVA. */ void Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Wed Aug 15 14:45:01 2018 (r337850) +++ head/sys/arm/include/pmap-v4.h Wed Aug 15 14:52:56 2018 (r337851) @@ -381,10 +381,6 @@ do { \ void pmap_pte_init_generic(void); -#if defined(CPU_XSCALE_81342) -#define ARM_HAVE_SUPERSECTIONS -#endif - #define PTE_KERNEL 0 #define PTE_USER 1 #define l1pte_valid(pde) ((pde) != 0) @@ -433,10 +429,6 @@ void vector_page_setprot(int); #define SECTION_CACHE 0x1 #define SECTION_PT 0x2 void pmap_kenter_section(vm_offset_t, vm_paddr_t, int flags); -#ifdef ARM_HAVE_SUPERSECTIONS -void pmap_kenter_supersection(vm_offset_t, uint64_t, int flags); -#endif - void pmap_postinit(void); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Wed Aug 15 14:53: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 E54C81058950; Wed, 15 Aug 2018 14:53:43 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B54690C0B; Wed, 15 Aug 2018 14:53:43 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D6924052; Wed, 15 Aug 2018 14:53:43 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FErhkD079571; Wed, 15 Aug 2018 14:53:43 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FErgK5079568; Wed, 15 Aug 2018 14:53:42 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808151453.w7FErgK5079568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 15 Aug 2018 14:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337852 - in head: etc secure/usr.bin/ssh secure/usr.sbin/sshd X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc secure/usr.bin/ssh secure/usr.sbin/sshd X-SVN-Commit-Revision: 337852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 14:53:44 -0000 Author: brd Date: Wed Aug 15 14:53:42 2018 New Revision: 337852 URL: https://svnweb.freebsd.org/changeset/base/337852 Log: Move ssh config file handling into the ssh Makefiles. This helps with pkgbase by using CONFS and tagging these as config files. Approved by: allanjude (mentor), des Differential Revision: https://reviews.freebsd.org/D16678 Modified: head/etc/Makefile head/secure/usr.bin/ssh/Makefile head/secure/usr.sbin/sshd/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Aug 15 14:52:56 2018 (r337851) +++ head/etc/Makefile Wed Aug 15 14:53:42 2018 (r337852) @@ -74,11 +74,6 @@ BIN1+= hosts.lpd printcap BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc .endif -.if ${MK_OPENSSH} != "no" -SSH= ${SRCTOP}/crypto/openssh/ssh_config \ - ${SRCTOP}/crypto/openssh/sshd_config \ - ${SRCTOP}/crypto/openssh/moduli -.endif .if ${MK_OPENSSL} != "no" SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf .endif @@ -167,10 +162,6 @@ distribution: .endif .if ${MK_SENDMAIL} != "no" ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution -.endif -.if ${MK_OPENSSH} != "no" - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${SSH} ${DESTDIR}/etc/ssh .endif .if ${MK_OPENSSL} != "no" cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ Modified: head/secure/usr.bin/ssh/Makefile ============================================================================== --- head/secure/usr.bin/ssh/Makefile Wed Aug 15 14:52:56 2018 (r337851) +++ head/secure/usr.bin/ssh/Makefile Wed Aug 15 14:53:42 2018 (r337852) @@ -2,6 +2,8 @@ .include +CONFS= ssh_config +CONFSDIR= /etc/ssh PROG= ssh LINKS= ${BINDIR}/ssh ${BINDIR}/slogin MAN= ssh.1 ssh_config.5 Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Wed Aug 15 14:52:56 2018 (r337851) +++ head/secure/usr.sbin/sshd/Makefile Wed Aug 15 14:53:42 2018 (r337852) @@ -2,6 +2,8 @@ .include +CONFS= moduli sshd_config +CONFSDIR= /etc/ssh PROG= sshd SRCS= sshd.c auth-rhosts.c auth-passwd.c \ audit.c audit-bsm.c audit-linux.c platform.c \ From owner-svn-src-all@freebsd.org Wed Aug 15 14:57: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 B505E1058B82; Wed, 15 Aug 2018 14:57:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6673F90EB9; Wed, 15 Aug 2018 14:57:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 435114059; Wed, 15 Aug 2018 14:57:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FEvZUR079846; Wed, 15 Aug 2018 14:57:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FEvYkF079844; Wed, 15 Aug 2018 14:57:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808151457.w7FEvYkF079844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Aug 2018 14:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337853 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 337853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 14:57:35 -0000 Author: andrew Date: Wed Aug 15 14:57:34 2018 New Revision: 337853 URL: https://svnweb.freebsd.org/changeset/base/337853 Log: Remove pmap_kenter_section from the arm pmap. It's unused. Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/pmap-v4.c head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Wed Aug 15 14:53:42 2018 (r337852) +++ head/sys/arm/arm/pmap-v4.c Wed Aug 15 14:57:34 2018 (r337853) @@ -2371,25 +2371,6 @@ pmap_remove_pages(pmap_t pmap) /* Map a section into the KVA. */ -void -pmap_kenter_section(vm_offset_t va, vm_offset_t pa, int flags) -{ - pd_entry_t pd = L1_S_PROTO | pa | L1_S_PROT(PTE_KERNEL, - VM_PROT_READ|VM_PROT_WRITE) | L1_S_DOM(PMAP_DOMAIN_KERNEL); - struct l1_ttable *l1; - - KASSERT(((va | pa) & L1_S_OFFSET) == 0, - ("Not a valid section mapping")); - if (flags & SECTION_CACHE) - pd |= pte_l1_s_cache_mode; - else if (flags & SECTION_PT) - pd |= pte_l1_s_cache_mode_pt; - SLIST_FOREACH(l1, &l1_list, l1_link) { - l1->l1_kva[L1_IDX(va)] = pd; - PTE_SYNC(&l1->l1_kva[L1_IDX(va)]); - } -} - /* * Make a temporary mapping for a physical address. This is only intended * to be used for panic dumps. Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Wed Aug 15 14:53:42 2018 (r337852) +++ head/sys/arm/include/pmap-v4.h Wed Aug 15 14:57:34 2018 (r337853) @@ -428,7 +428,6 @@ void vector_page_setprot(int); #define SECTION_CACHE 0x1 #define SECTION_PT 0x2 -void pmap_kenter_section(vm_offset_t, vm_paddr_t, int flags); void pmap_postinit(void); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Wed Aug 15 15:27: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 96CF5105BBFF for ; Wed, 15 Aug 2018 15:27:07 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc2f.google.com (mail-yw1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) (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 2D9E0924CF for ; Wed, 15 Aug 2018 15:27:07 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc2f.google.com with SMTP id y203-v6so1072274ywd.9 for ; Wed, 15 Aug 2018 08:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KcBtfm6PxdvrsUpdh0LzH6ks7DQ05WUDemYlI7j+9Zc=; b=Z/INKkzj6GCynIXkXWBHdexwoYeZGDP0V1dKSUV97PJd3dJZnYsFeBAhmXFSMnC+bv VQcAi2YNRD0ZRcyv0RciE1nFqVZVQNQNxFAWl21YVXbKXzIWIg/f2Av54dIaXOutQg5H 6Vp8j9MOmMZb1CgOGRFok17SMxtQLHvVsP/5UWi2LLSlKL7IHm09V20JMhYgPHzpJ+8w wZQE0CZUNx5myw5bPCA5Ah4qIeJxyiK0tbnfZkC32U+Sdu6rFpTajUZilusYQd0fIr2k Ql8PnsthpgT1zmRGhFOBw/TbVJk+FdShJUiyUZbCSyU/mS7G1tOjZ3kf7gE/ALPLd1Fp DF+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KcBtfm6PxdvrsUpdh0LzH6ks7DQ05WUDemYlI7j+9Zc=; b=dmuxO7ogkdMBmNRUfCe8RjDPnfmf4QOp+UxeJLUZ577CiTjrHVxaZHIu6k9DOb3wle xJM53ZrbMdg4SitIyrdTYhTvLCnKSDdStghHGvD7dC7DzPUQrkyQJTDRvgi7ipNsP7Ub eJYI0iL1G2WCsaG5DlFG63htsHK39fm7FjIfTtpoTdmVr0zwIhm1yaLNkiP+4Oy/S0tV entCyK2wxhX1tTma2cK4Dfw72hSGWwU7KSimB2WBa1ReLCI2w/JW1Nw5OOk28A/sE1Je E9A+sp4EhkMdR3XFLZl3s2f3yvkrZ4BfFEUp8j2Lr4xNR0YBWWCAaQLVPBAqJPxDP/+p ADrw== X-Gm-Message-State: AOUpUlHX5uZTsCDhAnfmrPGqsseCN3kpJScE0jlESqfV4R6YvTVL5w2G AKhSQZGylRU89dv4Y/fXRYeUaeHZZ3Ay9uj3C5R4pw== X-Google-Smtp-Source: AA+uWPx4oZ78GqvmjWTiwWbUwHqkuc9JblPwnWbdNLYgXTKfSAtI454R4Ra6ixsSmi6r6KWMmc5P8l30SgZ/QKWm0RI= X-Received: by 2002:a25:949:: with SMTP id u9-v6mr14275046ybm.300.1534346826608; Wed, 15 Aug 2018 08:27:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:f205:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 08:27:06 -0700 (PDT) In-Reply-To: <201808151441.w7FEfP2u071943@repo.freebsd.org> References: <201808151441.w7FEfP2u071943@repo.freebsd.org> From: Oliver Pinter Date: Wed, 15 Aug 2018 17:27:06 +0200 Message-ID: Subject: Re: svn commit: r337849 - in head: bin/csh bin/sh etc etc/root To: Brad Davis Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 15:27:07 -0000 On Wednesday, August 15, 2018, Brad Davis wrote: > Author: brd > Date: Wed Aug 15 14:41:24 2018 > New Revision: 337849 > URL: https://svnweb.freebsd.org/changeset/base/337849 > > Log: > Move all sh and csh files into bin/sh/ or bin/csh/ > > This simplifies pkgbase by migrating these to CONFS so they are properly > tagged as config files. > > Approved by: will (mentor) > Differential Revision: https://reviews.freebsd.org/D16708 > > Added: > head/bin/csh/csh.cshrc > - copied unchanged from r337848, head/etc/csh.cshrc > head/bin/csh/csh.login > - copied unchanged from r337848, head/etc/csh.login > head/bin/csh/csh.logout > - copied unchanged from r337848, head/etc/csh.logout > head/bin/csh/dot.cshrc > - copied unchanged from r337848, head/etc/root/dot.cshrc > head/bin/csh/dot.login > - copied unchanged from r337848, head/etc/root/dot.login > head/bin/sh/dot.profile > - copied unchanged from r337848, head/etc/root/dot.profile > head/bin/sh/profile > - copied unchanged from r337848, head/etc/profile > Deleted: > head/etc/csh.cshrc > head/etc/csh.login > head/etc/csh.logout > head/etc/profile > head/etc/root/dot.cshrc > head/etc/root/dot.login > head/etc/root/dot.profile > Modified: > head/bin/csh/Makefile > head/bin/sh/Makefile > head/etc/Makefile > > Modified: head/bin/csh/Makefile > ============================================================ > ================== > --- head/bin/csh/Makefile Wed Aug 15 14:29:04 2018 (r337848) > +++ head/bin/csh/Makefile Wed Aug 15 14:41:24 2018 (r337849) > @@ -8,6 +8,11 @@ > > .include > > +CONFGROUPS= ETC ROOT > +ETC= csh.cshrc csh.login csh.logout > +ROOT= dot.cshrc > +ROOTDIR= /root > +ROOTNAME= .cshrc > PACKAGE=runtime > TCSHDIR= ${SRCTOP}/contrib/tcsh > .PATH: ${TCSHDIR} > @@ -44,7 +49,8 @@ MLINKS= csh.1 tcsh.1 > > LIBADD= termcapw crypt > > -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ > + /root/.cshrc /.cshrc > > CLEANFILES= ${GENHDRS} gethost csh.1 > > @@ -147,5 +153,12 @@ tc.const.h: tc.const.c sh.char.h config.h config_f.h s > sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \ > sort >> ${.TARGET} > @echo '#endif /* _h_tc_const */' >> ${.TARGET} > + > +beforeinstall: > + rm -f ${DESTDIR}/.cshrc > + > +afterinstallconfig: > + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd Why? If afterinstallconfig called unconditionally after install, then why changing all of the csh entries to sh? The old behavior was almost the same, but only when WITHOUT_CSH was specified. Fixme if I'm wrong. > + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > .include > > Copied: head/bin/csh/csh.cshrc (from r337848, head/etc/csh.cshrc) > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/csh.cshrc Wed Aug 15 14:41:24 2018 (r337849, > copy of r337848, head/etc/csh.cshrc) > @@ -0,0 +1,3 @@ > +# $FreeBSD$ > +# > +# System-wide .cshrc file for csh(1). > > Copied: head/bin/csh/csh.login (from r337848, head/etc/csh.login) > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/csh.login Wed Aug 15 14:41:24 2018 (r337849, > copy of r337848, head/etc/csh.login) > @@ -0,0 +1,15 @@ > +# $FreeBSD$ > +# > +# System-wide .login file for csh(1). > +# Uncomment this to give you the default 4.2 behavior, where disk > +# information is shown in K-Blocks > +# setenv BLOCKSIZE K > +# > +# For the setting of languages and character sets please see > +# login.conf(5) and in particular the charset and lang options. > +# For full locales list check /usr/share/locale/* > +# > +# Check system messages > +# msgs -q > +# Allow terminal messages > +# mesg y > > Copied: head/bin/csh/csh.logout (from r337848, head/etc/csh.logout) > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/csh.logout Wed Aug 15 14:41:24 2018 (r337849, > copy of r337848, head/etc/csh.logout) > @@ -0,0 +1,3 @@ > +# $FreeBSD$ > +# > +# System-wide .logout file for csh(1). > > Copied: head/bin/csh/dot.cshrc (from r337848, head/etc/root/dot.cshrc) > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/dot.cshrc Wed Aug 15 14:41:24 2018 (r337849, > copy of r337848, head/etc/root/dot.cshrc) > @@ -0,0 +1,43 @@ > +# $FreeBSD$ > +# > +# .cshrc - csh resource script, read at beginning of execution by each > shell > +# > +# see also csh(1), environ(7). > +# more examples available at /usr/share/examples/csh/ > +# > + > +alias h history 25 > +alias j jobs -l > +alias la ls -aF > +alias lf ls -FA > +alias ll ls -lAF > + > +# A righteous umask > +umask 22 > + > +set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin > $HOME/bin) > + > +setenv EDITOR vi > +setenv PAGER less > +setenv BLOCKSIZE K > + > +if ($?prompt) then > + # An interactive shell -- set some stuff up > + set prompt = "%N@%m:%~ %# " > + set promptchars = "%#" > + > + set filec > + set history = 1000 > + set savehist = (1000 merge) > + set autolist = ambiguous > + # Use history to aid expansion > + set autoexpand > + set autorehash > + set mail = (/var/mail/$USER) > + if ( $?tcsh ) then > + bindkey "^W" backward-delete-word > + bindkey -k up history-search-backward > + bindkey -k down history-search-forward > + endif > + > +endif > > Copied: head/bin/csh/dot.login (from r337848, head/etc/root/dot.login) > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/dot.login Wed Aug 15 14:41:24 2018 (r337849, > copy of r337848, head/etc/root/dot.login) > @@ -0,0 +1,12 @@ > +# $FreeBSD$ > +# > +# .login - csh login script, read by login shell, after `.cshrc' at login. > +# > +# See also csh(1), environ(7). > +# > + > +# Query terminal size; useful for serial lines. > +if ( -x /usr/bin/resizewin ) /usr/bin/resizewin -z > + > +# Uncomment to display a random cookie on each login. > +# if ( -x /usr/bin/fortune ) /usr/bin/fortune -s > > Modified: head/bin/sh/Makefile > ============================================================ > ================== > --- head/bin/sh/Makefile Wed Aug 15 14:29:04 2018 (r337848) > +++ head/bin/sh/Makefile Wed Aug 15 14:41:24 2018 (r337849) > @@ -3,6 +3,9 @@ > > .include > > +CONFS= dot.profile profile > +CONFSDIR_dot.profile= /root > +CONFSNAME_dot.profile= .profile > PACKAGE=runtime > PROG= sh > INSTALLFLAGS= -S > @@ -34,6 +37,7 @@ WFORMAT=0 > > CLEANFILES+= mknodes mksyntax > CLEANFILES+= ${GENSRCS} ${GENHDRS} > +LINKS= /root/.profile /.profile > > build-tools: mknodes mksyntax > > @@ -59,5 +63,8 @@ token.h: mktokens > > HAS_TESTS= > SUBDIR.${MK_TESTS}+= tests > + > +beforeinstall: > + rm -f ${DESTDIR}/.profile > > .include > > Copied: head/bin/sh/dot.profile (from r337848, head/etc/root/dot.profile) > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/sh/dot.profile Wed Aug 15 14:41:24 2018 (r337849, > copy of r337848, head/etc/root/dot.profile) > @@ -0,0 +1,16 @@ > +# $FreeBSD$ > +# > +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin > +export PATH > +HOME=/root > +export HOME > +TERM=${TERM:-xterm} > +export TERM > +PAGER=less > +export PAGER > + > +# Query terminal size; useful for serial lines. > +if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > + > +# Uncomment to display a random cookie on each login. > +# if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune -s ; fi > > Copied: head/bin/sh/profile (from r337848, head/etc/profile) > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/sh/profile Wed Aug 15 14:41:24 2018 (r337849, copy of > r337848, head/etc/profile) > @@ -0,0 +1,18 @@ > +# $FreeBSD$ > +# > +# System-wide .profile file for sh(1). > +# > +# Uncomment this to give you the default 4.2 behavior, where disk > +# information is shown in K-Blocks > +# BLOCKSIZE=K; export BLOCKSIZE > +# > +# For the setting of languages and character sets please see > +# login.conf(5) and in particular the charset and lang options. > +# For full locales list check /usr/share/locale/* > +# You should also read the setlocale(3) man page for information > +# on how to achieve more precise control of locale settings. > +# > +# Check system messages > +# msgs -q > +# Allow terminal messages > +# mesg y > > Modified: head/etc/Makefile > ============================================================ > ================== > --- head/etc/Makefile Wed Aug 15 14:29:04 2018 (r337848) > +++ head/etc/Makefile Wed Aug 15 14:41:24 2018 (r337849) > @@ -33,7 +33,6 @@ BIN1= crontab \ > networks \ > nsswitch.conf \ > phones \ > - profile \ > protocols \ > rc.bsdextended \ > rc.firewall \ > @@ -88,10 +87,6 @@ SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf > BIN1+= rc.sendmail > .endif > > -.if ${MK_TCSH} != "no" > -BIN1+= csh.cshrc csh.login csh.logout > -.endif > - > .if ${MK_WIRELESS} != "no" > BIN1+= regdomain.xml > .endif > @@ -145,10 +140,6 @@ distribution: > ${DESTDIR}/etc/services; > .endif > > -.if ${MK_TCSH} == "no" > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > -.endif > - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > .if defined(NO_ROOT) > ( \ > echo "./etc/login.conf.db type=file mode=0644 uname=root > gname=wheel"; \ > @@ -190,20 +181,7 @@ distribution: > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > dot.k5login ${DESTDIR}/root/.k5login; > .endif > - cd ${.CURDIR}/root; \ > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > - dot.profile ${DESTDIR}/root/.profile; \ > - rm -f ${DESTDIR}/.profile; \ > - ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile > -.if ${MK_TCSH} != "no" > - cd ${.CURDIR}/root; \ > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > - dot.cshrc ${DESTDIR}/root/.cshrc; \ > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > - dot.login ${DESTDIR}/root/.login; \ > - rm -f ${DESTDIR}/.cshrc; \ > - ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc > -.endif > + > .if ${MK_MAIL} != "no" > cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > ${ETCMAIL} ${DESTDIR}/etc/mail > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Wed Aug 15 15:37: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 DB59A105BFDC; Wed, 15 Aug 2018 15:37:18 +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 2791692AC8; Wed, 15 Aug 2018 15:37:17 +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 w7FFbDhs048176; Wed, 15 Aug 2018 08:37:13 -0700 (PDT) (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 w7FFbDie048175; Wed, 15 Aug 2018 08:37:13 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151537.w7FFbDie048175@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: To: Kyle Evans Date: Wed, 15 Aug 2018 08:37:13 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 15:37:19 -0000 [ Charset UTF-8 unsupported, converting... ] > On Tue, Aug 14, 2018 at 8:41 PM, Rodney W. Grimes > wrote: > >> Author: kevans > >> Date: Wed Aug 15 01:29:02 2018 > >> New Revision: 337826 > >> URL: https://svnweb.freebsd.org/changeset/base/337826 > >> > >> Log: > >> MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment > >> > >> COLORTERM is the de facto standard, while CLICOLOR is generally specific to > >> FreeBSD and ls(1). > > > > I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" > > Seems that the defaults for xfce terminal is to have COLORTERM. > > > > Hmm? No one's pointed me at any such complaints, and I've not seen any > seen pass by -- neither in response to the initial commit mail, or on > -current@ It was not in a public forum. And it was just yesterday, so it takes times for these things to trickle out and be noticed. Just be aware, this change is gona have a few shocked users as it proliferates. My 'changes' that are made take 1 to 2 years before the mass user community notices there over all effects. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 15:40: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 7BF3A1065199; Wed, 15 Aug 2018 15:40:12 +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 F24EE92CAF; Wed, 15 Aug 2018 15:40:11 +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 w7FFeABc048196; Wed, 15 Aug 2018 08:40:10 -0700 (PDT) (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 w7FFeAFC048195; Wed, 15 Aug 2018 08:40:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151540.w7FFeAFC048195@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: <201808151537.w7FFbDie048175@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Wed, 15 Aug 2018 08:40:10 -0700 (PDT) CC: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 15:40:12 -0000 > [ Charset UTF-8 unsupported, converting... ] > > On Tue, Aug 14, 2018 at 8:41 PM, Rodney W. Grimes > > wrote: > > >> Author: kevans > > >> Date: Wed Aug 15 01:29:02 2018 > > >> New Revision: 337826 > > >> URL: https://svnweb.freebsd.org/changeset/base/337826 > > >> > > >> Log: > > >> MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment > > >> > > >> COLORTERM is the de facto standard, while CLICOLOR is generally specific to > > >> FreeBSD and ls(1). > > > > > > I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" > > > Seems that the defaults for xfce terminal is to have COLORTERM. > > > > > > > Hmm? No one's pointed me at any such complaints, and I've not seen any > > seen pass by -- neither in response to the initial commit mail, or on > > -current@ > > It was not in a public forum. And it was just yesterday, so it > takes times for these things to trickle out and be noticed. > Just be aware, this change is gona have a few shocked users as > it proliferates. > > My 'changes' that are made take 1 to 2 years before the mass user My -> Many > community notices there over all effects. > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 15:44: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 BEE231065547; Wed, 15 Aug 2018 15:44:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71A6593155; Wed, 15 Aug 2018 15:44:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 529034881; Wed, 15 Aug 2018 15:44:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FFiVjZ006296; Wed, 15 Aug 2018 15:44:31 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FFiVFe006295; Wed, 15 Aug 2018 15:44:31 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808151544.w7FFiVFe006295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 15 Aug 2018 15:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337854 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 15:44:31 -0000 Author: loos Date: Wed Aug 15 15:44:30 2018 New Revision: 337854 URL: https://svnweb.freebsd.org/changeset/base/337854 Log: Late style follow up on r312770. Submitted by: glebius X-MFC with: r312770 MFC after: 3 days Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Aug 15 14:57:34 2018 (r337853) +++ head/sys/netinet/in.c Wed Aug 15 15:44:30 2018 (r337854) @@ -620,8 +620,7 @@ in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifne in_ifadown(&ia->ia_ifa, 1); if (ia->ia_ifa.ifa_carp) - (*carp_detach_p)(&ia->ia_ifa, - (cmd == SIOCDIFADDR) ? false : true); + (*carp_detach_p)(&ia->ia_ifa, cmd == SIOCAIFADDR); /* * If this is the last IPv4 address configured on this From owner-svn-src-all@freebsd.org Wed Aug 15 15:52: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 238A81065B99; Wed, 15 Aug 2018 15:52:31 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9FA89371A; Wed, 15 Aug 2018 15:52:30 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: brd/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id AA52B1585B; Wed, 15 Aug 2018 15:52:30 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 868DB219E6; Wed, 15 Aug 2018 11:52:30 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute5.internal (MEProxy); Wed, 15 Aug 2018 11:52:30 -0400 X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 270FB9E4F6; Wed, 15 Aug 2018 11:52:30 -0400 (EDT) Message-Id: <1534348350.561748.1475140704.59C82FD0@webmail.messagingengine.com> From: Brad Davis To: Oliver Pinter Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-9a5384d7 References: <201808151441.w7FEfP2u071943@repo.freebsd.org> Subject: Re: svn commit: r337849 - in head: bin/csh bin/sh etc etc/root Date: Wed, 15 Aug 2018 09:52:30 -0600 In-Reply-To: X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 15:52:31 -0000 On Wed, Aug 15, 2018, at 9:27 AM, Oliver Pinter wrote: >=20 >=20 > On Wednesday, August 15, 2018, Brad Davis wrote: >> Author: brd >> Date: Wed Aug 15 14:41:24 2018 >> New Revision: 337849 >> URL: https://svnweb.freebsd.org/changeset/base/337849 >>=20=20 >> Log: >> =C2=A0 Move all sh and csh files into bin/sh/ or bin/csh/ >>=20=20 >> =C2=A0 This simplifies pkgbase by migrating these to CONFS so they are = properly >> =C2=A0 tagged as config files. >>=20=20 >> =C2=A0 Approved by:=C2=A0 will (mentor) >> =C2=A0 Differential Revision:=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://review= s.freebsd.org/D16708 >>=20=20 >> Added: >> =C2=A0 head/bin/csh/csh.cshrc >> =C2=A0 =C2=A0 =C2=A0- copied unchanged from r337848, head/etc/csh.cshrc >> =C2=A0 head/bin/csh/csh.login >> =C2=A0 =C2=A0 =C2=A0- copied unchanged from r337848, head/etc/csh.login >> =C2=A0 head/bin/csh/csh.logout >> =C2=A0 =C2=A0 =C2=A0- copied unchanged from r337848, head/etc/csh.logout >> =C2=A0 head/bin/csh/dot.cshrc >> =C2=A0 =C2=A0 =C2=A0- copied unchanged from r337848, head/etc/root/dot.= cshrc >> =C2=A0 head/bin/csh/dot.login >> =C2=A0 =C2=A0 =C2=A0- copied unchanged from r337848, head/etc/root/dot.= login >> =C2=A0 head/bin/sh/dot.profile >> =C2=A0 =C2=A0 =C2=A0- copied unchanged from r337848, head/etc/root/dot.= profile >> =C2=A0 head/bin/sh/profile >> =C2=A0 =C2=A0 =C2=A0- copied unchanged from r337848, head/etc/profile >> Deleted: >> =C2=A0 head/etc/csh.cshrc >> =C2=A0 head/etc/csh.login >> =C2=A0 head/etc/csh.logout >> =C2=A0 head/etc/profile >> =C2=A0 head/etc/root/dot.cshrc >> =C2=A0 head/etc/root/dot.login >> =C2=A0 head/etc/root/dot.profile >> Modified: >> =C2=A0 head/bin/csh/Makefile >> =C2=A0 head/bin/sh/Makefile >> =C2=A0 head/etc/Makefile >>=20=20 >> Modified: head/bin/csh/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >> --- head/bin/csh/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0Wed Aug 15 14:29:04= 2018=C2=A0 =C2=A0 =C2=A0 =C2=A0 (r337848) >> +++ head/bin/csh/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0Wed Aug 15 14:41:24= 2018=C2=A0 =C2=A0 =C2=A0 =C2=A0 (r337849) >> @@ -8,6 +8,11 @@ >>=20=20 >> =C2=A0.include >>=20=20 >> +CONFGROUPS=3D=C2=A0 =C2=A0 ETC ROOT >> +ETC=3D=C2=A0 =C2=A0csh.cshrc csh.login csh.logout >> +ROOT=3D=C2=A0 dot.cshrc >> +ROOTDIR=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0/root >> +ROOTNAME=3D=C2=A0 =C2=A0 =C2=A0 .cshrc >> =C2=A0PACKAGE=3Druntime >> =C2=A0TCSHDIR=3D ${SRCTOP}/contrib/tcsh >> =C2=A0.PATH: ${TCSHDIR} >> @@ -44,7 +49,8 @@ MLINKS=3D csh.1 tcsh.1 >>=20=20 >> =C2=A0LIBADD=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 termcapw crypt >>=20=20 >> -LINKS=3D ${BINDIR}/csh ${BINDIR}/tcsh >> +LINKS=3D ${BINDIR}/csh ${BINDIR}/tcsh \ >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0/root/.cshrc /.cshrc >>=20=20 >> =C2=A0CLEANFILES=3D ${GENHDRS} gethost csh.1 >>=20=20 >> @@ -147,5 +153,12 @@ tc.const.h: tc.const.c sh.char.h config.h config_f= .h s >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sed -e 's/Char \([a-zA-Z0-9_]= *\)\(.*\)/extern Char \1[];/' | \ >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sort >> ${.TARGET} >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo '#endif /* _h_tc_const */' >> ${.TARG= ET} >> + >> +beforeinstall: >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0rm -f ${DESTDIR}/.cshrc >> + >> +afterinstallconfig: >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDI= R}/etc/master.passwd >=20 > Why? If afterinstallconfig called unconditionally after install, then why= changing all of the csh entries to sh? >=20 > The old behavior was almost the same, but only when WITHOUT_CSH was speci= fied.=C2=A0 >=20 > Fixme if I'm wrong.=C2=A0 You are correct, I have opened: https://reviews.freebsd.org/D16725 Regards, Brad Davis From owner-svn-src-all@freebsd.org Wed Aug 15 16:04: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 B9A8E106605B; Wed, 15 Aug 2018 16:04:57 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (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 4F8A993E38; Wed, 15 Aug 2018 16:04:57 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x234.google.com with SMTP id s7-v6so2370101itb.4; Wed, 15 Aug 2018 09:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=01Aq6Eda2ZZALZ39NfssddgnbxfhnvNqDMiW5mCkdj4=; b=OOFB3vAotPWTFmFiXxqMO1U0dw9bGe2OOqLngqNrZ7mYxdz1fVpv3It2gA8AGi1BP7 86iVB9FUtfXfmf85QGK+jsEqm9jTM3gE0cqZdDr1TIsNFvLbT+98mjoFGMxTSW/5cIm9 94LPa7xrAxXJ2gPAdetKJTRcnnp2cumaDevSIrYA9hlL5+EqN//mERDYitxuWVuHDpVa M91E/bHeaCDN6V5XhqA94PNJY+eI07eN0ehuXkHQOLydwocWMSwAS1vgc9811o1mf1nu 3ysw4Mv023TUEuNSBEeNnU4U9VrCJbiRVKzv2iEkGQJVdx7iJukrGw+iMfXFOlytB2Fg d+Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=01Aq6Eda2ZZALZ39NfssddgnbxfhnvNqDMiW5mCkdj4=; b=gbkduo8AUiixncyvztmbnZL1U54Y2RUbQ7yo5bnKe78LZv/VqONNB3sVtTIBEYYUUd trS3e7CplHyh0o+r3c0oZOa7K4pMNMrQkD0a0P6OKdYDaT7BTFqKg1FxQinbhAIx7u0E ZZUmcrvIYl+r5ijo8a34adbpVby24b4Z0leRPlAWDiBlu/7YW0VYX3BP6Yba2FHFJcjr 67Bok1Grje7YF0SsGNlZQyj0F8Efe6klRS5qL54h/Yiko1/WbZa4vfdgIpbzucM4yjZb 7RP3S7zIp8m+991D+kfxHYEnLdX9c20woM4RJEWsCffID8BK/cb2qmLNCV1Rb2PNiA4P UdGQ== X-Gm-Message-State: AOUpUlFPNd2beT6ghfkrcRZPE8LFzx0D5nz3HzxHmMhcBfp1hxxnTed7 1FwRdWAeqpvUN28yU41inwK+JaAtB6+XBybXjwVsDw== X-Google-Smtp-Source: AA+uWPxRbooc+jk3Rp4w+zTefZc90dKZvf0mQNiVV6P6rot8aUrY2A8JWhlx7WNKuZPkcqJ3zwO+wtk2+jnNKhzcofM= X-Received: by 2002:a24:4d8d:: with SMTP id l135-v6mr18216462itb.49.1534349096454; Wed, 15 Aug 2018 09:04:56 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 2002:a6b:4a08:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 09:04:35 -0700 (PDT) In-Reply-To: <201808150141.w7F1ft69045150@pdx.rh.CN85.dnsmgr.net> References: <201808150129.w7F1T23r064553@repo.freebsd.org> <201808150141.w7F1ft69045150@pdx.rh.CN85.dnsmgr.net> From: Ed Maste Date: Wed, 15 Aug 2018 12:04:35 -0400 X-Google-Sender-Auth: Mv695Y4xkcOCdETcll1p3Y6q_hM Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: "Rodney W. Grimes" Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:04:57 -0000 On 14 August 2018 at 21:41, Rodney W. Grimes wrote: >> Author: kevans >> Date: Wed Aug 15 01:29:02 2018 >> New Revision: 337826 >> URL: https://svnweb.freebsd.org/changeset/base/337826 >> >> Log: >> MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment >> >> COLORTERM is the de facto standard, while CLICOLOR is generally specific to >> FreeBSD and ls(1). > > I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" > Seems that the defaults for xfce terminal is to have COLORTERM. If xfce's default is to request colour via the de-facto environment variable then we should generally honour it -- the answer to the %&*@(#$@) question is "you did, via your terminal's default." From owner-svn-src-all@freebsd.org Wed Aug 15 16:07: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 E60111066169; Wed, 15 Aug 2018 16:07:30 +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 6E51093FF1; Wed, 15 Aug 2018 16: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 w7FG7SLS048318; Wed, 15 Aug 2018 09:07:28 -0700 (PDT) (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 w7FG7Smo048317; Wed, 15 Aug 2018 09:07:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151607.w7FG7Smo048317@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: To: Ed Maste Date: Wed, 15 Aug 2018 09:07:27 -0700 (PDT) CC: "Rodney W. Grimes" , Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:07:31 -0000 [ Charset UTF-8 unsupported, converting... ] > On 14 August 2018 at 21:41, Rodney W. Grimes > wrote: > >> Author: kevans > >> Date: Wed Aug 15 01:29:02 2018 > >> New Revision: 337826 > >> URL: https://svnweb.freebsd.org/changeset/base/337826 > >> > >> Log: > >> MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment > >> > >> COLORTERM is the de facto standard, while CLICOLOR is generally specific to > >> FreeBSD and ls(1). > > > > I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" > > Seems that the defaults for xfce terminal is to have COLORTERM. > > If xfce's default is to request colour via the de-facto environment > variable then we should generally honour it -- the answer to the > %&*@(#$@) question is "you did, via your terminal's default." And I pointed that out to them, but it is kinda a POLA, people have had to take explicit action to get colorls, that is no longer true and that suprises them when they see it. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 16:12: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 3A2E010663AE; Wed, 15 Aug 2018 16:12:14 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E515B94486; Wed, 15 Aug 2018 16:12:13 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC1344C6F; Wed, 15 Aug 2018 16:12:13 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FGCDYo021406; Wed, 15 Aug 2018 16:12:13 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FGCD0e021405; Wed, 15 Aug 2018 16:12:13 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808151612.w7FGCD0e021405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 15 Aug 2018 16:12:13 +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: r337855 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: loos X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 337855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:12:14 -0000 Author: loos Date: Wed Aug 15 16:12:13 2018 New Revision: 337855 URL: https://svnweb.freebsd.org/changeset/base/337855 Log: MFC r312953: The stf(4) interface name does not conform with the default naming convention for interfaces, because only one stf(4) interface can exist in the system. This disallow the use of unit numbers different than 0, however, it is possible to create the clone without specify the unit number (wildcard). In the wildcard case we must update the interface name before return. This fix an infinite recursion in pf code that keeps track of network interfaces and groups: 1 - a group for the cloned type of the interface is added (stf in this case); 2 - the system will now try to add an interface named stf (instead of stf0) to stf group; 3 - when pfi_kif_attach() tries to search for an already existing 'stf' interface, the 'stf' group is returned and thus the group is added as an interface of itself; This will now cause a crash at the first attempt to traverse the groups which the stf interface belongs (which loops over itself). Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/net/if_stf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_stf.c ============================================================================== --- stable/11/sys/net/if_stf.c Wed Aug 15 15:44:30 2018 (r337854) +++ stable/11/sys/net/if_stf.c Wed Aug 15 16:12:13 2018 (r337855) @@ -202,10 +202,16 @@ stf_clone_match(struct if_clone *ifc, const char *name static int stf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) { - int err, unit; + char *dp; + int err, unit, wildcard; struct stf_softc *sc; struct ifnet *ifp; + err = ifc_name2unit(name, &unit); + if (err != 0) + return (err); + wildcard = (unit < 0); + /* * We can only have one unit, but since unit allocation is * already locked, we use it to keep from allocating extra @@ -229,7 +235,20 @@ stf_clone_create(struct if_clone *ifc, char *name, siz /* * Set the name manually rather then using if_initname because * we don't conform to the default naming convention for interfaces. + * In the wildcard case, we need to update the name. */ + if (wildcard) { + for (dp = name; *dp != '\0'; dp++); + if (snprintf(dp, len - (dp-name), "%d", unit) > + len - (dp-name) - 1) { + /* + * This can only be a programmer error and + * there's no straightforward way to recover if + * it happens. + */ + panic("if_clone_create(): interface name too long"); + } + } strlcpy(ifp->if_xname, name, IFNAMSIZ); ifp->if_dname = stfname; ifp->if_dunit = IF_DUNIT_NONE; From owner-svn-src-all@freebsd.org Wed Aug 15 16:17: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 164811066472; Wed, 15 Aug 2018 16:17:00 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0914946CD; Wed, 15 Aug 2018 16:16:59 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A31564D96; Wed, 15 Aug 2018 16:16:59 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FGGxmd021638; Wed, 15 Aug 2018 16:16:59 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FGGxX8021637; Wed, 15 Aug 2018 16:16:59 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808151616.w7FGGxX8021637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 15 Aug 2018 16:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337856 - stable/11/sys/dev/vmware/vmxnet3 X-SVN-Group: stable-11 X-SVN-Commit-Author: loos X-SVN-Commit-Paths: stable/11/sys/dev/vmware/vmxnet3 X-SVN-Commit-Revision: 337856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:17:00 -0000 Author: loos Date: Wed Aug 15 16:16:59 2018 New Revision: 337856 URL: https://svnweb.freebsd.org/changeset/base/337856 Log: MFC r313911: Spell VMXNET3_LEGACY_TX correctly. Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmxvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- stable/11/sys/dev/vmware/vmxnet3/if_vmxvar.h Wed Aug 15 16:12:13 2018 (r337855) +++ stable/11/sys/dev/vmware/vmxnet3/if_vmxvar.h Wed Aug 15 16:16:59 2018 (r337856) @@ -131,7 +131,7 @@ struct vmxnet3_txq_stats { struct vmxnet3_txqueue { struct mtx vxtxq_mtx; struct vmxnet3_softc *vxtxq_sc; -#ifndef VMXNET3_TX_LEGACY +#ifndef VMXNET3_LEGACY_TX struct buf_ring *vxtxq_br; #endif int vxtxq_id; @@ -142,7 +142,7 @@ struct vmxnet3_txqueue { struct vmxnet3_txq_stats vxtxq_stats; struct vmxnet3_txq_shared *vxtxq_ts; struct sysctl_oid_list *vxtxq_sysctl; -#ifndef VMXNET3_TX_LEGACY +#ifndef VMXNET3_LEGACY_TX struct task vxtxq_defrtask; #endif char vxtxq_name[16]; From owner-svn-src-all@freebsd.org Wed Aug 15 16:22: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 DB9DC10666E2; Wed, 15 Aug 2018 16:22:13 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DB0594ADC; Wed, 15 Aug 2018 16:22:13 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5495D4F14; Wed, 15 Aug 2018 16:22:13 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FGMDET024457; Wed, 15 Aug 2018 16:22:13 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FGMCN7024455; Wed, 15 Aug 2018 16:22:12 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808151622.w7FGMCN7024455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 15 Aug 2018 16:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337857 - in head: bin/csh bin/sh etc X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: bin/csh bin/sh etc X-SVN-Commit-Revision: 337857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:22:14 -0000 Author: brd Date: Wed Aug 15 16:22:12 2018 New Revision: 337857 URL: https://svnweb.freebsd.org/changeset/base/337857 Log: Fix build after r337849 This moves the symlink creation to after where the files are installed. This also inverts the shell change so that it only happens if MK_TCSH is on. Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D16725 Modified: head/bin/csh/Makefile head/bin/sh/Makefile head/etc/master.passwd Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Wed Aug 15 16:16:59 2018 (r337856) +++ head/bin/csh/Makefile Wed Aug 15 16:22:12 2018 (r337857) @@ -49,8 +49,7 @@ MLINKS= csh.1 tcsh.1 LIBADD= termcapw crypt -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ - /root/.cshrc /.cshrc +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh CLEANFILES= ${GENHDRS} gethost csh.1 @@ -158,7 +157,7 @@ beforeinstall: rm -f ${DESTDIR}/.cshrc afterinstallconfig: - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd + sed -i "" -e 's;/bin/sh;/bin/csh;' ${DESTDIR}/etc/master.passwd pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .include Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Wed Aug 15 16:16:59 2018 (r337856) +++ head/bin/sh/Makefile Wed Aug 15 16:22:12 2018 (r337857) @@ -37,7 +37,6 @@ WFORMAT=0 CLEANFILES+= mknodes mksyntax CLEANFILES+= ${GENSRCS} ${GENHDRS} -LINKS= /root/.profile /.profile build-tools: mknodes mksyntax @@ -66,5 +65,8 @@ SUBDIR.${MK_TESTS}+= tests beforeinstall: rm -f ${DESTDIR}/.profile + +afterinstallconfig: + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile .include Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) @@ -1,6 +1,6 @@ # $FreeBSD$ # -root::0:0::0:0:Charlie &:/root:/bin/csh +root::0:0::0:0:Charlie &:/root:/bin/sh toor:*:0:0::0:0:Bourne-again Superuser:/root: daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin operator:*:2:5::0:0:System &:/:/usr/sbin/nologin From owner-svn-src-all@freebsd.org Wed Aug 15 16:26: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 739AD10667CE; Wed, 15 Aug 2018 16:26:11 +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 B1AA794D0C; Wed, 15 Aug 2018 16:26:10 +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 w7FGQ8TR048423; Wed, 15 Aug 2018 09:26:08 -0700 (PDT) (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 w7FGQ8rB048422; Wed, 15 Aug 2018 09:26:08 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151626.w7FGQ8rB048422@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337849 - in head: bin/csh bin/sh etc etc/root In-Reply-To: <201808151441.w7FEfP2u071943@repo.freebsd.org> To: Brad Davis Date: Wed, 15 Aug 2018 09:26:08 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:26:11 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: brd > Date: Wed Aug 15 14:41:24 2018 > New Revision: 337849 > URL: https://svnweb.freebsd.org/changeset/base/337849 > > Log: > Move all sh and csh files into bin/sh/ or bin/csh/ > > This simplifies pkgbase by migrating these to CONFS so they are properly > tagged as config files. This makes some other changes to the state of the system beyond just moving these files to work with installconf. Someone pointed at some of it, I commented some on your review, further issues in this reply. One issue in review figured out and is a none issue. > > Approved by: will (mentor) > Differential Revision: https://reviews.freebsd.org/D16708 > > Added: > head/bin/csh/csh.cshrc > - copied unchanged from r337848, head/etc/csh.cshrc > head/bin/csh/csh.login > - copied unchanged from r337848, head/etc/csh.login > head/bin/csh/csh.logout > - copied unchanged from r337848, head/etc/csh.logout > head/bin/csh/dot.cshrc > - copied unchanged from r337848, head/etc/root/dot.cshrc > head/bin/csh/dot.login > - copied unchanged from r337848, head/etc/root/dot.login > head/bin/sh/dot.profile > - copied unchanged from r337848, head/etc/root/dot.profile > head/bin/sh/profile > - copied unchanged from r337848, head/etc/profile > Deleted: > head/etc/csh.cshrc > head/etc/csh.login > head/etc/csh.logout > head/etc/profile > head/etc/root/dot.cshrc > head/etc/root/dot.login > head/etc/root/dot.profile > Modified: > head/bin/csh/Makefile > head/bin/sh/Makefile > head/etc/Makefile > > Modified: head/bin/csh/Makefile > ============================================================================== > --- head/bin/csh/Makefile Wed Aug 15 14:29:04 2018 (r337848) > +++ head/bin/csh/Makefile Wed Aug 15 14:41:24 2018 (r337849) > @@ -8,6 +8,11 @@ > > .include > > +CONFGROUPS= ETC ROOT > +ETC= csh.cshrc csh.login csh.logout > +ROOT= dot.cshrc > +ROOTDIR= /root > +ROOTNAME= .cshrc > PACKAGE=runtime > TCSHDIR= ${SRCTOP}/contrib/tcsh > .PATH: ${TCSHDIR} > @@ -44,7 +49,8 @@ MLINKS= csh.1 tcsh.1 > > LIBADD= termcapw crypt > > -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ > + /root/.cshrc /.cshrc > > CLEANFILES= ${GENHDRS} gethost csh.1 > > @@ -147,5 +153,12 @@ tc.const.h: tc.const.c sh.char.h config.h config_f.h s > sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \ > sort >> ${.TARGET} > @echo '#endif /* _h_tc_const */' >> ${.TARGET} > + > +beforeinstall: > + rm -f ${DESTDIR}/.cshrc This target runs on ANY "install", this just blew away a custom /.cshrc file and I did not ask this to be done. Should this be in a target called beforeinstallconfig:? > + > +afterinstallconfig: > + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd Ok, found out where this comes into play, this is for MK_TCSH knob, which is pushed up a level in the Makefile above, so this no longer needs if {MK_TCSH} protection. Your review already fixes the reversal, so OK now. Though I think it would be better to leave the edit in the way it was done before (change csh to sh) in the src/bin/sh/Makefile iff ${MK_TCSH} == no, this leaving the src/etc/master.passwd file untouched by these changes. And ONLY needing the special edit if someone builds without tcsh. > > .include > > Copied: head/bin/csh/csh.cshrc (from r337848, head/etc/csh.cshrc) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/csh.cshrc Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/csh.cshrc) > @@ -0,0 +1,3 @@ > +# $FreeBSD$ > +# > +# System-wide .cshrc file for csh(1). > > Copied: head/bin/csh/csh.login (from r337848, head/etc/csh.login) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/csh.login Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/csh.login) > @@ -0,0 +1,15 @@ > +# $FreeBSD$ > +# > +# System-wide .login file for csh(1). > +# Uncomment this to give you the default 4.2 behavior, where disk > +# information is shown in K-Blocks > +# setenv BLOCKSIZE K > +# > +# For the setting of languages and character sets please see > +# login.conf(5) and in particular the charset and lang options. > +# For full locales list check /usr/share/locale/* > +# > +# Check system messages > +# msgs -q > +# Allow terminal messages > +# mesg y > > Copied: head/bin/csh/csh.logout (from r337848, head/etc/csh.logout) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/csh.logout Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/csh.logout) > @@ -0,0 +1,3 @@ > +# $FreeBSD$ > +# > +# System-wide .logout file for csh(1). > > Copied: head/bin/csh/dot.cshrc (from r337848, head/etc/root/dot.cshrc) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/dot.cshrc Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/root/dot.cshrc) > @@ -0,0 +1,43 @@ > +# $FreeBSD$ > +# > +# .cshrc - csh resource script, read at beginning of execution by each shell > +# > +# see also csh(1), environ(7). > +# more examples available at /usr/share/examples/csh/ > +# > + > +alias h history 25 > +alias j jobs -l > +alias la ls -aF > +alias lf ls -FA > +alias ll ls -lAF > + > +# A righteous umask > +umask 22 > + > +set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) > + > +setenv EDITOR vi > +setenv PAGER less > +setenv BLOCKSIZE K > + > +if ($?prompt) then > + # An interactive shell -- set some stuff up > + set prompt = "%N@%m:%~ %# " > + set promptchars = "%#" > + > + set filec > + set history = 1000 > + set savehist = (1000 merge) > + set autolist = ambiguous > + # Use history to aid expansion > + set autoexpand > + set autorehash > + set mail = (/var/mail/$USER) > + if ( $?tcsh ) then > + bindkey "^W" backward-delete-word > + bindkey -k up history-search-backward > + bindkey -k down history-search-forward > + endif > + > +endif > > Copied: head/bin/csh/dot.login (from r337848, head/etc/root/dot.login) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/csh/dot.login Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/root/dot.login) > @@ -0,0 +1,12 @@ > +# $FreeBSD$ > +# > +# .login - csh login script, read by login shell, after `.cshrc' at login. > +# > +# See also csh(1), environ(7). > +# > + > +# Query terminal size; useful for serial lines. > +if ( -x /usr/bin/resizewin ) /usr/bin/resizewin -z > + > +# Uncomment to display a random cookie on each login. > +# if ( -x /usr/bin/fortune ) /usr/bin/fortune -s > > Modified: head/bin/sh/Makefile > ============================================================================== > --- head/bin/sh/Makefile Wed Aug 15 14:29:04 2018 (r337848) > +++ head/bin/sh/Makefile Wed Aug 15 14:41:24 2018 (r337849) > @@ -3,6 +3,9 @@ > > .include > > +CONFS= dot.profile profile > +CONFSDIR_dot.profile= /root > +CONFSNAME_dot.profile= .profile > PACKAGE=runtime > PROG= sh > INSTALLFLAGS= -S > @@ -34,6 +37,7 @@ WFORMAT=0 > > CLEANFILES+= mknodes mksyntax > CLEANFILES+= ${GENSRCS} ${GENHDRS} > +LINKS= /root/.profile /.profile > > build-tools: mknodes mksyntax > > @@ -59,5 +63,8 @@ token.h: mktokens > > HAS_TESTS= > SUBDIR.${MK_TESTS}+= tests > + > +beforeinstall: > + rm -f ${DESTDIR}/.profile As above, beforeinstallconfig??? > .include > > Copied: head/bin/sh/dot.profile (from r337848, head/etc/root/dot.profile) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/sh/dot.profile Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/root/dot.profile) > @@ -0,0 +1,16 @@ > +# $FreeBSD$ > +# > +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin > +export PATH > +HOME=/root > +export HOME > +TERM=${TERM:-xterm} > +export TERM > +PAGER=less > +export PAGER > + > +# Query terminal size; useful for serial lines. > +if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > + > +# Uncomment to display a random cookie on each login. > +# if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune -s ; fi > > Copied: head/bin/sh/profile (from r337848, head/etc/profile) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/sh/profile Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/profile) > @@ -0,0 +1,18 @@ > +# $FreeBSD$ > +# > +# System-wide .profile file for sh(1). > +# > +# Uncomment this to give you the default 4.2 behavior, where disk > +# information is shown in K-Blocks > +# BLOCKSIZE=K; export BLOCKSIZE > +# > +# For the setting of languages and character sets please see > +# login.conf(5) and in particular the charset and lang options. > +# For full locales list check /usr/share/locale/* > +# You should also read the setlocale(3) man page for information > +# on how to achieve more precise control of locale settings. > +# > +# Check system messages > +# msgs -q > +# Allow terminal messages > +# mesg y > > Modified: head/etc/Makefile > ============================================================================== > --- head/etc/Makefile Wed Aug 15 14:29:04 2018 (r337848) > +++ head/etc/Makefile Wed Aug 15 14:41:24 2018 (r337849) > @@ -33,7 +33,6 @@ BIN1= crontab \ > networks \ > nsswitch.conf \ > phones \ > - profile \ > protocols \ > rc.bsdextended \ > rc.firewall \ > @@ -88,10 +87,6 @@ SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf > BIN1+= rc.sendmail > .endif > > -.if ${MK_TCSH} != "no" > -BIN1+= csh.cshrc csh.login csh.logout > -.endif > - > .if ${MK_WIRELESS} != "no" > BIN1+= regdomain.xml > .endif > @@ -145,10 +140,6 @@ distribution: > ${DESTDIR}/etc/services; > .endif > > -.if ${MK_TCSH} == "no" > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > -.endif > - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > .if defined(NO_ROOT) > ( \ > echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \ > @@ -190,20 +181,7 @@ distribution: > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > dot.k5login ${DESTDIR}/root/.k5login; > .endif > - cd ${.CURDIR}/root; \ > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > - dot.profile ${DESTDIR}/root/.profile; \ > - rm -f ${DESTDIR}/.profile; \ > - ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile > -.if ${MK_TCSH} != "no" > - cd ${.CURDIR}/root; \ > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > - dot.cshrc ${DESTDIR}/root/.cshrc; \ > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > - dot.login ${DESTDIR}/root/.login; \ > - rm -f ${DESTDIR}/.cshrc; \ > - ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc > -.endif > + > .if ${MK_MAIL} != "no" > cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > ${ETCMAIL} ${DESTDIR}/etc/mail > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 16:27: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 1C15410668BA; Wed, 15 Aug 2018 16:27:53 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C388394F48; Wed, 15 Aug 2018 16:27:52 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A656C4F42; Wed, 15 Aug 2018 16:27:52 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FGRqGS027265; Wed, 15 Aug 2018 16:27:52 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FGRqHZ027264; Wed, 15 Aug 2018 16:27:52 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808151627.w7FGRqHZ027264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 15 Aug 2018 16:27: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: r337858 - stable/11/sys/dev/sdhci X-SVN-Group: stable-11 X-SVN-Commit-Author: loos X-SVN-Commit-Paths: stable/11/sys/dev/sdhci X-SVN-Commit-Revision: 337858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:27:53 -0000 Author: loos Date: Wed Aug 15 16:27:52 2018 New Revision: 337858 URL: https://svnweb.freebsd.org/changeset/base/337858 Log: MFC r317800: Add support for the no-1-8-v and wp-inverted properties in generic SDHCI FDT glue. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/dev/sdhci/sdhci_fdt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_fdt.c Wed Aug 15 16:22:12 2018 (r337857) +++ stable/11/sys/dev/sdhci/sdhci_fdt.c Wed Aug 15 16:27:52 2018 (r337858) @@ -70,6 +70,9 @@ struct sdhci_fdt_softc { int num_slots; /* Number of slots on this controller*/ struct sdhci_slot slots[MAX_SLOTS]; struct resource *mem_res[MAX_SLOTS]; /* Memory resource */ + + bool wp_inverted; /* WP pin is inverted */ + bool no_18v; /* No 1.8V support */ }; static uint8_t @@ -110,8 +113,13 @@ static uint32_t sdhci_fdt_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct sdhci_fdt_softc *sc = device_get_softc(dev); + uint32_t val32; - return (bus_read_4(sc->mem_res[slot->num], off)); + val32 = bus_read_4(sc->mem_res[slot->num], off); + if (off == SDHCI_CAPABILITIES && sc->no_18v) + val32 &= ~SDHCI_CAN_VDD_180; + + return (val32); } static void @@ -152,6 +160,14 @@ sdhci_fdt_intr(void *arg) } static int +sdhci_fdt_get_ro(device_t bus, device_t dev) +{ + struct sdhci_fdt_softc *sc = device_get_softc(bus); + + return (sdhci_generic_get_ro(bus, dev) ^ sc->wp_inverted); +} + +static int sdhci_fdt_probe(device_t dev) { struct sdhci_fdt_softc *sc = device_get_softc(dev); @@ -182,6 +198,10 @@ sdhci_fdt_probe(device_t dev) sc->num_slots = cid; if ((OF_getencprop(node, "max-frequency", &cid, sizeof(cid))) > 0) sc->max_clk = cid; + if (OF_hasprop(node, "no-1-8-v")) + sc->no_18v = true; + if (OF_hasprop(node, "wp-inverted")) + sc->wp_inverted = true; return (0); } @@ -279,7 +299,7 @@ static device_method_t sdhci_fdt_methods[] = { /* mmcbr_if */ DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), DEVMETHOD(mmcbr_request, sdhci_generic_request), - DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), + DEVMETHOD(mmcbr_get_ro, sdhci_fdt_get_ro), DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), From owner-svn-src-all@freebsd.org Wed Aug 15 16:34: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 F1E9B1066CAA; Wed, 15 Aug 2018 16:34:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8668954F0; Wed, 15 Aug 2018 16:34:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 891B350D6; Wed, 15 Aug 2018 16:34:31 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FGYVLR032001; Wed, 15 Aug 2018 16:34:31 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FGYVPt032000; Wed, 15 Aug 2018 16:34:31 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808151634.w7FGYVPt032000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 15 Aug 2018 16:34: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: r337859 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: loos X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 337859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:34:32 -0000 Author: loos Date: Wed Aug 15 16:34:31 2018 New Revision: 337859 URL: https://svnweb.freebsd.org/changeset/base/337859 Log: MFC r321649: Remove the unused mutex since r273220. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/net/if_stf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_stf.c ============================================================================== --- stable/11/sys/net/if_stf.c Wed Aug 15 16:27:52 2018 (r337858) +++ stable/11/sys/net/if_stf.c Wed Aug 15 16:34:31 2018 (r337859) @@ -139,7 +139,6 @@ SYSCTL_INT(_net_link_stf, OID_AUTO, permit_rfc1918, CT struct stf_softc { struct ifnet *sc_ifp; - struct mtx sc_ro_mtx; u_int sc_fibnum; const struct encaptab *encap_cookie; }; @@ -147,10 +146,6 @@ struct stf_softc { static const char stfname[] = "stf"; -/* - * Note that mutable fields in the softc are not currently locked. - * We do lock sc_ro in stf_output though. - */ static MALLOC_DEFINE(M_STF, stfname, "6to4 Tunnel Interface"); static const int ip_stf_ttl = 40; @@ -253,7 +248,6 @@ stf_clone_create(struct if_clone *ifc, char *name, siz ifp->if_dname = stfname; ifp->if_dunit = IF_DUNIT_NONE; - mtx_init(&(sc)->sc_ro_mtx, "stf ro", NULL, MTX_DEF); sc->encap_cookie = encap_attach_func(AF_INET, IPPROTO_IPV6, stf_encapcheck, &in_stf_protosw, sc); if (sc->encap_cookie == NULL) { @@ -280,7 +274,6 @@ stf_clone_destroy(struct if_clone *ifc, struct ifnet * err = encap_detach(sc->encap_cookie); KASSERT(err == 0, ("Unexpected error detaching encap_cookie")); - mtx_destroy(&(sc)->sc_ro_mtx); bpfdetach(ifp); if_detach(ifp); if_free(ifp); From owner-svn-src-all@freebsd.org Wed Aug 15 16:35: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 AD79D1066D65; Wed, 15 Aug 2018 16:35:34 +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 271D395678; Wed, 15 Aug 2018 16:35:33 +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 w7FGZWsR048469; Wed, 15 Aug 2018 09:35:32 -0700 (PDT) (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 w7FGZWfh048468; Wed, 15 Aug 2018 09:35:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151635.w7FGZWfh048468@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc In-Reply-To: <201808151622.w7FGMCN7024455@repo.freebsd.org> To: Brad Davis Date: Wed, 15 Aug 2018 09:35:32 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:35:34 -0000 > Author: brd > Date: Wed Aug 15 16:22:12 2018 > New Revision: 337857 > URL: https://svnweb.freebsd.org/changeset/base/337857 > > Log: > Fix build after r337849 > > This moves the symlink creation to after where the files are installed. > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > Approved by: will (mentor) > Differential Revision: https://reviews.freebsd.org/D16725 > > Modified: > head/bin/csh/Makefile > head/bin/sh/Makefile > head/etc/master.passwd > > Modified: head/bin/csh/Makefile > ============================================================================== > --- head/bin/csh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > +++ head/bin/csh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > @@ -49,8 +49,7 @@ MLINKS= csh.1 tcsh.1 > > LIBADD= termcapw crypt > > -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ > - /root/.cshrc /.cshrc > +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > > CLEANFILES= ${GENHDRS} gethost csh.1 > > @@ -158,7 +157,7 @@ beforeinstall: > rm -f ${DESTDIR}/.cshrc > > afterinstallconfig: > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > + sed -i "" -e 's;/bin/sh;/bin/csh;' ${DESTDIR}/etc/master.passwd > pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > .include > > Modified: head/bin/sh/Makefile > ============================================================================== > --- head/bin/sh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > +++ head/bin/sh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > @@ -37,7 +37,6 @@ WFORMAT=0 > > CLEANFILES+= mknodes mksyntax > CLEANFILES+= ${GENSRCS} ${GENHDRS} > -LINKS= /root/.profile /.profile > > build-tools: mknodes mksyntax > > @@ -66,5 +65,8 @@ SUBDIR.${MK_TESTS}+= tests > > beforeinstall: > rm -f ${DESTDIR}/.profile Still unconditionally removing /.profile, but only replacing it when installconfig: is run. > + > +afterinstallconfig: > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile > > .include > > Modified: head/etc/master.passwd > ============================================================================== > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > @@ -1,6 +1,6 @@ > # $FreeBSD$ > # > -root::0:0::0:0:Charlie &:/root:/bin/csh > +root::0:0::0:0:Charlie &:/root:/bin/sh I strongly object to this change to master.passwd, and feel it should be worked around if in anyway possible. I have pointed out in the review ways to not have to make this change. > toor:*:0:0::0:0:Bourne-again Superuser:/root: > daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > operator:*:2:5::0:0:System &:/:/usr/sbin/nologin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 16:36: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 4D99C1066E32; Wed, 15 Aug 2018 16:36:30 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 044819584C; Wed, 15 Aug 2018 16:36:30 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D94FD50DA; Wed, 15 Aug 2018 16:36:29 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FGaTXp032133; Wed, 15 Aug 2018 16:36:29 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FGaTBQ032132; Wed, 15 Aug 2018 16:36:29 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201808151636.w7FGaTBQ032132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 15 Aug 2018 16:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337860 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 337860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 16:36:30 -0000 Author: loos Date: Wed Aug 15 16:36:29 2018 New Revision: 337860 URL: https://svnweb.freebsd.org/changeset/base/337860 Log: Fix a typo in comment. MFC after: 3 days X-MFC with: r321316 Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/netpfil/ipfw/ip_dn_io.c Modified: head/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_io.c Wed Aug 15 16:34:31 2018 (r337859) +++ head/sys/netpfil/ipfw/ip_dn_io.c Wed Aug 15 16:36:29 2018 (r337860) @@ -809,7 +809,7 @@ dummynet_send(struct mbuf *m) ether_demux(m->m_pkthdr.rcvif, m); break; - case DIR_OUT | PROTO_LAYER2: /* N_TO_ETH_OUT: */ + case DIR_OUT | PROTO_LAYER2: /* DN_TO_ETH_OUT: */ ether_output_frame(ifp, m); break; From owner-svn-src-all@freebsd.org Wed Aug 15 17:17: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 E2C0E106925E; Wed, 15 Aug 2018 17:17:09 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22BEA9738D; Wed, 15 Aug 2018 17:17:09 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.5] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 6972D1606D; Wed, 15 Aug 2018 17:17:08 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.10.0.180812 Date: Wed, 15 Aug 2018 10:17:05 -0700 Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc From: Ravi Pokala To: Brad Davis , , , Message-ID: <3E8B8322-9A8A-4EC0-95C6-7180659E9723@panasas.com> Thread-Topic: svn commit: r337857 - in head: bin/csh bin/sh etc References: <201808151622.w7FGMCN7024455@repo.freebsd.org> In-Reply-To: <201808151622.w7FGMCN7024455@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:17:10 -0000 Brad, -----Original Message----- From: on behalf of Brad Davis Date: 2018-08-15, Wednesday at 09:22 To: , , Subject: svn commit: r337857 - in head: bin/csh bin/sh etc > Author: brd > Date: Wed Aug 15 16:22:12 2018 > New Revision: 337857 > URL: https://svnweb.freebsd.org/changeset/base/337857 > > Log: > Fix build after r337849 > > This moves the symlink creation to after where the files are installed. > > This also inverts the shell change so that it only happens if MK_TCSH is on. ... > Modified: head/etc/master.passwd > ============================================================================== > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > @@ -1,6 +1,6 @@ > # $FreeBSD$ > # > -root::0:0::0:0:Charlie &:/root:/bin/csh > +root::0:0::0:0:Charlie &:/root:/bin/sh > toor:*:0:0::0:0:Bourne-again Superuser:/root: > daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > operator:*:2:5::0:0:System &:/:/usr/sbin/nologin Woah! Changing the root shell wasn't mentioned in the change description, has nothing to do with fixing r337849, and is a *HUGE* POLA violation. At the very least, a change of this magnitude needs public discussion, and even if the community agreed, it would also require an UPDATING message and relnote. Please revert this change to master.passwd immediately. -Ravi (rpokala@) From owner-svn-src-all@freebsd.org Wed Aug 15 17:18: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 0C9CE106936F; Wed, 15 Aug 2018 17:18:57 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACF8B9752B; Wed, 15 Aug 2018 17:18:56 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: brd/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 899F71606E; Wed, 15 Aug 2018 17:18:56 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 500A521DEC; Wed, 15 Aug 2018 13:18:56 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute5.internal (MEProxy); Wed, 15 Aug 2018 13:18:56 -0400 X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 3851541D5; Wed, 15 Aug 2018 13:18:55 -0400 (EDT) Message-Id: <1534353535.920234.1475238264.523AA6C6@webmail.messagingengine.com> From: Brad Davis To: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-9a5384d7 Date: Wed, 15 Aug 2018 11:18:55 -0600 Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc References: <201808151622.w7FGMCN7024455@repo.freebsd.org> <3E8B8322-9A8A-4EC0-95C6-7180659E9723@panasas.com> In-Reply-To: <3E8B8322-9A8A-4EC0-95C6-7180659E9723@panasas.com> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:18:57 -0000 On Wed, Aug 15, 2018, at 11:17 AM, Ravi Pokala wrote: > Brad, > > -----Original Message----- > From: on behalf of Brad Davis > > Date: 2018-08-15, Wednesday at 09:22 > To: , , head@freebsd.org> > Subject: svn commit: r337857 - in head: bin/csh bin/sh etc > > > Author: brd > > Date: Wed Aug 15 16:22:12 2018 > > New Revision: 337857 > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > Log: > > Fix build after r337849 > > > > This moves the symlink creation to after where the files are installed. > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > ... > > Modified: head/etc/master.passwd > > ============================================================================== > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > @@ -1,6 +1,6 @@ > > # $FreeBSD$ > > # > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > toor:*:0:0::0:0:Bourne-again Superuser:/root: > > daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > > operator:*:2:5::0:0:System &:/:/usr/sbin/nologin > > Woah! Changing the root shell wasn't mentioned in the change > description, has nothing to do with fixing r337849, and is a *HUGE* POLA > violation. At the very least, a change of this magnitude needs public > discussion, and even if the community agreed, it would also require an > UPDATING message and relnote. > > Please revert this change to master.passwd immediately. Hi Ravi, Please, look closer. It doesn't change what is actually installed in either case, it just inverts the logic. Regards, Brad Davis From owner-svn-src-all@freebsd.org Wed Aug 15 17:29: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 D3D5E106986A; Wed, 15 Aug 2018 17:29:50 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8412397BE9; Wed, 15 Aug 2018 17:29:50 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: brd/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 6032E1616B; Wed, 15 Aug 2018 17:29:50 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 418EB21D1F; Wed, 15 Aug 2018 13:29:50 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute5.internal (MEProxy); Wed, 15 Aug 2018 13:29:50 -0400 X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id C27F241A1; Wed, 15 Aug 2018 13:29:49 -0400 (EDT) Message-Id: <1534354189.922513.1475252728.321B67FB@webmail.messagingengine.com> From: Brad Davis To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-9a5384d7 Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc Date: Wed, 15 Aug 2018 11:29:49 -0600 In-Reply-To: <201808151635.w7FGZWfh048468@pdx.rh.CN85.dnsmgr.net> References: <201808151635.w7FGZWfh048468@pdx.rh.CN85.dnsmgr.net> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:29:51 -0000 On Wed, Aug 15, 2018, at 10:35 AM, Rodney W. Grimes wrote: > > Author: brd > > Date: Wed Aug 15 16:22:12 2018 > > New Revision: 337857 > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > Log: > > Fix build after r337849 > > > > This moves the symlink creation to after where the files are installed. > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > > > Approved by: will (mentor) > > Differential Revision: https://reviews.freebsd.org/D16725 > > > > Modified: > > head/bin/csh/Makefile > > head/bin/sh/Makefile > > head/etc/master.passwd > > > > Modified: head/bin/csh/Makefile > > ============================================================================== > > --- head/bin/csh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > +++ head/bin/csh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > @@ -49,8 +49,7 @@ MLINKS= csh.1 tcsh.1 > > > > LIBADD= termcapw crypt > > > > -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ > > - /root/.cshrc /.cshrc > > +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > > > > CLEANFILES= ${GENHDRS} gethost csh.1 > > > > @@ -158,7 +157,7 @@ beforeinstall: > > rm -f ${DESTDIR}/.cshrc > > > > afterinstallconfig: > > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > > + sed -i "" -e 's;/bin/sh;/bin/csh;' ${DESTDIR}/etc/master.passwd > > pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > > > .include > > > > Modified: head/bin/sh/Makefile > > ============================================================================== > > --- head/bin/sh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > +++ head/bin/sh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > @@ -37,7 +37,6 @@ WFORMAT=0 > > > > CLEANFILES+= mknodes mksyntax > > CLEANFILES+= ${GENSRCS} ${GENHDRS} > > -LINKS= /root/.profile /.profile > > > > build-tools: mknodes mksyntax > > > > @@ -66,5 +65,8 @@ SUBDIR.${MK_TESTS}+= tests > > > > beforeinstall: > > rm -f ${DESTDIR}/.profile > > Still unconditionally removing /.profile, but only replacing it > when installconfig: is run. Yes, working on a separate review for this.. > > + > > +afterinstallconfig: > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile > > > > .include > > > > Modified: head/etc/master.passwd > > ============================================================================== > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > @@ -1,6 +1,6 @@ > > # $FreeBSD$ > > # > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > I strongly object to this change to master.passwd, and feel it should > be worked around if in anyway possible. I have pointed out in the > review ways to not have to make this change. I opened up the following which addresses some of your feedback: https://reviews.freebsd.org/D16728 > > toor:*:0:0::0:0:Bourne-again Superuser:/root: > > daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > > operator:*:2:5::0:0:System &:/:/usr/sbin/nologin > > -- > Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 17:30: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 8A4381069918; Wed, 15 Aug 2018 17:30:34 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 414DB97D52; Wed, 15 Aug 2018 17:30:34 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.5] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 9D3521616C; Wed, 15 Aug 2018 17:30:33 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.10.0.180812 Date: Wed, 15 Aug 2018 10:30:30 -0700 Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc From: Ravi Pokala To: Brad Davis , , , Message-ID: <86149E0F-D1C1-4032-8D07-CA5A82F94F98@panasas.com> Thread-Topic: svn commit: r337857 - in head: bin/csh bin/sh etc References: <201808151622.w7FGMCN7024455@repo.freebsd.org> <3E8B8322-9A8A-4EC0-95C6-7180659E9723@panasas.com> <1534353535.920234.1475238264.523AA6C6@webmail.messagingengine.com> In-Reply-To: <1534353535.920234.1475238264.523AA6C6@webmail.messagingengine.com> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:30:34 -0000 -----Original Message----- From: on behalf of Brad Davis Date: 2018-08-15, Wednesday at 10:18 To: Ravi Pokala , , , Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc > On Wed, Aug 15, 2018, at 11:17 AM, Ravi Pokala wrote: >> Brad, >> >> -----Original Message----- >> From: on behalf of Brad Davis >> >> Date: 2018-08-15, Wednesday at 09:22 >> To: , , > head@freebsd.org> >> Subject: svn commit: r337857 - in head: bin/csh bin/sh etc >> >>> Author: brd >>> Date: Wed Aug 15 16:22:12 2018 >>> New Revision: 337857 >>> URL: https://svnweb.freebsd.org/changeset/base/337857 >>> >>> Log: >>> Fix build after r337849 >>> >>> This moves the symlink creation to after where the files are installed. >>> >>> This also inverts the shell change so that it only happens if MK_TCSH is on. >> ... >>> Modified: head/etc/master.passwd >>> ============================================================================== >>> --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) >>> +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) >>> @@ -1,6 +1,6 @@ >>> # $FreeBSD$ >>> # >>> -root::0:0::0:0:Charlie &:/root:/bin/csh >>> +root::0:0::0:0:Charlie &:/root:/bin/sh >>> toor:*:0:0::0:0:Bourne-again Superuser:/root: >>> daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin >>> operator:*:2:5::0:0:System &:/:/usr/sbin/nologin >> >> Woah! Changing the root shell wasn't mentioned in the change >> description, has nothing to do with fixing r337849, and is a *HUGE* POLA >> violation. At the very least, a change of this magnitude needs public >> discussion, and even if the community agreed, it would also require an >> UPDATING message and relnote. >> >> Please revert this change to master.passwd immediately. > > Hi Ravi, > > Please, look closer. It doesn't change what is actually installed in either case, it just inverts the logic. This is master.passwd; it doesn't contain any logic, only data. Is there a different master.passwd somewhere that's used when MK_TCSH is on? Oh, I see! bin/csh/Makefile does some `sed'ing. But it's not clear at all why you added the (incorrect) `sed'ing in r337849 in the first place. root's shell should be /bin/csh in master.passwd, and left alone. Maybe, if *csh* -- not *tcsh* -- were disabled, then `sed'ing to make root's shell /bin/sh would make sense. But I can't think of any reason master.passwd would start off with /bin/sh rather than /bin/csh. What am I missing? Thanks, Ravi > Regards, > Brad Davis From owner-svn-src-all@freebsd.org Wed Aug 15 17:30: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 482091069A98; Wed, 15 Aug 2018 17:30:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D086A97E49; Wed, 15 Aug 2018 17:30:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 467FB1616D; Wed, 15 Aug 2018 17:30:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f46.google.com with SMTP id 95-v6so1418121lfy.9; Wed, 15 Aug 2018 10:30:41 -0700 (PDT) X-Gm-Message-State: AOUpUlH+05n3ddHqgVwHMARU9Bi9O31reL//A/eG36TaThYNq/tl2exL Xo4bZLNkSzoT9FSqQHd64crfaI0q0s802x7aZpU= X-Google-Smtp-Source: AA+uWPzxZD71hIrozGdI6D1f3XSIy2S52ei/VnNsXBT0LlMh/XK3XuuFtli/pNrs4xuhb/mslD2akplzC51uQXnYYMs= X-Received: by 2002:a19:26d2:: with SMTP id m201-v6mr16556099lfm.43.1534354238962; Wed, 15 Aug 2018 10:30:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 10:30:18 -0700 (PDT) In-Reply-To: <201808151607.w7FG7Smo048317@pdx.rh.CN85.dnsmgr.net> References: <201808151607.w7FG7Smo048317@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Wed, 15 Aug 2018 12:30:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: "Rodney W. Grimes" Cc: Ed Maste , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:30:42 -0000 On Wed, Aug 15, 2018 at 11:07 AM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On 14 August 2018 at 21:41, Rodney W. Grimes >> wrote: >> >> Author: kevans >> >> Date: Wed Aug 15 01:29:02 2018 >> >> New Revision: 337826 >> >> URL: https://svnweb.freebsd.org/changeset/base/337826 >> >> >> >> Log: >> >> MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment >> >> >> >> COLORTERM is the de facto standard, while CLICOLOR is generally specific to >> >> FreeBSD and ls(1). >> > >> > I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" >> > Seems that the defaults for xfce terminal is to have COLORTERM. >> >> If xfce's default is to request colour via the de-facto environment >> variable then we should generally honour it -- the answer to the >> %&*@(#$@) question is "you did, via your terminal's default." > > And I pointed that out to them, but it is kinda a POLA, people have > had to take explicit action to get colorls, that is no longer true > and that suprises them when they see it. > I find the POLA angle kind-of hard to buy, though. Nothing in the base system offers a way for the default behavior of ls(1) to be altered, and this whole change is only honoring a de-facto standard for indicating that a colored terminal is supported and desired. IMO, one should be aware of how the software they use is affecting their environment and the kinds of repercussions these changes may have. This is hardly the first bit of software that respects COLORTERM, and it surely won't be the last (in general... no specific plans here). =( From owner-svn-src-all@freebsd.org Wed Aug 15 17:31:09 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 1ED161069B2F; Wed, 15 Aug 2018 17:31:09 +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 34605700BE; Wed, 15 Aug 2018 17:31:07 +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 w7FHV4la048791; Wed, 15 Aug 2018 10:31:04 -0700 (PDT) (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 w7FHV4vv048790; Wed, 15 Aug 2018 10:31:04 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151731.w7FHV4vv048790@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc In-Reply-To: <1534353535.920234.1475238264.523AA6C6@webmail.messagingengine.com> To: Brad Davis Date: Wed, 15 Aug 2018 10:31:04 -0700 (PDT) CC: Ravi Pokala , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:31:09 -0000 > On Wed, Aug 15, 2018, at 11:17 AM, Ravi Pokala wrote: > > Brad, > > > > -----Original Message----- > > From: on behalf of Brad Davis > > > > Date: 2018-08-15, Wednesday at 09:22 > > To: , , > head@freebsd.org> > > Subject: svn commit: r337857 - in head: bin/csh bin/sh etc > > > > > Author: brd > > > Date: Wed Aug 15 16:22:12 2018 > > > New Revision: 337857 > > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > > > Log: > > > Fix build after r337849 > > > > > > This moves the symlink creation to after where the files are installed. > > > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > ... > > > Modified: head/etc/master.passwd > > > ============================================================================== > > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > > @@ -1,6 +1,6 @@ > > > # $FreeBSD$ > > > # > > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > > toor:*:0:0::0:0:Bourne-again Superuser:/root: > > > daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > > > operator:*:2:5::0:0:System &:/:/usr/sbin/nologin > > > > Woah! Changing the root shell wasn't mentioned in the change > > description, has nothing to do with fixing r337849, and is a *HUGE* POLA > > violation. At the very least, a change of this magnitude needs public > > discussion, and even if the community agreed, it would also require an > > UPDATING message and relnote. > > > > Please revert this change to master.passwd immediately. > > Hi Ravi, > > Please, look closer. It doesn't change what is actually installed in either case, it just inverts the logic. Though the end results maybe the same, we now have a sed that is running in the normal case, is not run in the exception case, a src file that must be editted to match the distribution file, etc. I can not express stronly enough how much I object to this. I have explained in your diffential that this should actually be put back as far as inverted, and that actually bin/csh/Makefile nor bin/sh/Makefile should never even touch etc/master.password, simply the wrong place to be doing it. This should be in what ever Makefile installs /etc/master.password an no place else. Regards, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 17:31: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 C58C21069BDC; Wed, 15 Aug 2018 17:31:49 +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 3D64D7038E; Wed, 15 Aug 2018 17:31:49 +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 w7FHVla2048813; Wed, 15 Aug 2018 10:31:47 -0700 (PDT) (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 w7FHVlFY048812; Wed, 15 Aug 2018 10:31:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151731.w7FHVlFY048812@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc In-Reply-To: <1534354189.922513.1475252728.321B67FB@webmail.messagingengine.com> To: Brad Davis Date: Wed, 15 Aug 2018 10:31:47 -0700 (PDT) CC: rgrimes@freebsd.org, 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:31:50 -0000 [ Charset UTF-8 unsupported, converting... ] > > > On Wed, Aug 15, 2018, at 10:35 AM, Rodney W. Grimes wrote: > > > Author: brd > > > Date: Wed Aug 15 16:22:12 2018 > > > New Revision: 337857 > > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > > > Log: > > > Fix build after r337849 > > > > > > This moves the symlink creation to after where the files are installed. > > > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > > > > > Approved by: will (mentor) > > > Differential Revision: https://reviews.freebsd.org/D16725 > > > > > > Modified: > > > head/bin/csh/Makefile > > > head/bin/sh/Makefile > > > head/etc/master.passwd > > > > > > Modified: head/bin/csh/Makefile > > > ============================================================================== > > > --- head/bin/csh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > +++ head/bin/csh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > @@ -49,8 +49,7 @@ MLINKS= csh.1 tcsh.1 > > > > > > LIBADD= termcapw crypt > > > > > > -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ > > > - /root/.cshrc /.cshrc > > > +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > > > > > > CLEANFILES= ${GENHDRS} gethost csh.1 > > > > > > @@ -158,7 +157,7 @@ beforeinstall: > > > rm -f ${DESTDIR}/.cshrc > > > > > > afterinstallconfig: > > > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > > > + sed -i "" -e 's;/bin/sh;/bin/csh;' ${DESTDIR}/etc/master.passwd > > > pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > > > > > .include > > > > > > Modified: head/bin/sh/Makefile > > > ============================================================================== > > > --- head/bin/sh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > +++ head/bin/sh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > @@ -37,7 +37,6 @@ WFORMAT=0 > > > > > > CLEANFILES+= mknodes mksyntax > > > CLEANFILES+= ${GENSRCS} ${GENHDRS} > > > -LINKS= /root/.profile /.profile > > > > > > build-tools: mknodes mksyntax > > > > > > @@ -66,5 +65,8 @@ SUBDIR.${MK_TESTS}+= tests > > > > > > beforeinstall: > > > rm -f ${DESTDIR}/.profile > > > > Still unconditionally removing /.profile, but only replacing it > > when installconfig: is run. > > Yes, working on a separate review for this.. > > > > + > > > +afterinstallconfig: > > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile > > > > > > .include > > > > > > Modified: head/etc/master.passwd > > > ============================================================================== > > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > > @@ -1,6 +1,6 @@ > > > # $FreeBSD$ > > > # > > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > > > I strongly object to this change to master.passwd, and feel it should > > be worked around if in anyway possible. I have pointed out in the > > review ways to not have to make this change. > > I opened up the following which addresses some of your feedback: > https://reviews.freebsd.org/D16728 Actually why not back out this whole set of changes, and come up with an agreeable solution, this is a bit of a mess right now. > > > > toor:*:0:0::0:0:Bourne-again Superuser:/root: > > > daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > > > operator:*:2:5::0:0:System &:/:/usr/sbin/nologin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 17:34: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 8FA381069D45; Wed, 15 Aug 2018 17:34:00 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 406F070716; Wed, 15 Aug 2018 17:34:00 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: brd/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1C51A1626A; Wed, 15 Aug 2018 17:34:00 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id F15B821C5C; Wed, 15 Aug 2018 13:33:59 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute5.internal (MEProxy); Wed, 15 Aug 2018 13:33:59 -0400 X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 7982741A1; Wed, 15 Aug 2018 13:33:59 -0400 (EDT) Message-Id: <1534354439.923623.1475256704.517B74D0@webmail.messagingengine.com> From: Brad Davis To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-9a5384d7 Date: Wed, 15 Aug 2018 11:33:59 -0600 Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc References: <201808151731.w7FHVlFY048812@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808151731.w7FHVlFY048812@pdx.rh.CN85.dnsmgr.net> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:34:00 -0000 On Wed, Aug 15, 2018, at 11:31 AM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > > > > > On Wed, Aug 15, 2018, at 10:35 AM, Rodney W. Grimes wrote: > > > > Author: brd > > > > Date: Wed Aug 15 16:22:12 2018 > > > > New Revision: 337857 > > > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > > > > > Log: > > > > Fix build after r337849 > > > > > > > > This moves the symlink creation to after where the files are installed. > > > > > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > > > > > > > Approved by: will (mentor) > > > > Differential Revision: https://reviews.freebsd.org/D16725 > > > > > > > > Modified: > > > > head/bin/csh/Makefile > > > > head/bin/sh/Makefile > > > > head/etc/master.passwd > > > > > > > > Modified: head/bin/csh/Makefile > > > > ============================================================================== > > > > --- head/bin/csh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > > +++ head/bin/csh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > > @@ -49,8 +49,7 @@ MLINKS= csh.1 tcsh.1 > > > > > > > > LIBADD= termcapw crypt > > > > > > > > -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ > > > > - /root/.cshrc /.cshrc > > > > +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > > > > > > > > CLEANFILES= ${GENHDRS} gethost csh.1 > > > > > > > > @@ -158,7 +157,7 @@ beforeinstall: > > > > rm -f ${DESTDIR}/.cshrc > > > > > > > > afterinstallconfig: > > > > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > > > > + sed -i "" -e 's;/bin/sh;/bin/csh;' ${DESTDIR}/etc/master.passwd > > > > pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > > > > > > > .include > > > > > > > > Modified: head/bin/sh/Makefile > > > > ============================================================================== > > > > --- head/bin/sh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > > +++ head/bin/sh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > > @@ -37,7 +37,6 @@ WFORMAT=0 > > > > > > > > CLEANFILES+= mknodes mksyntax > > > > CLEANFILES+= ${GENSRCS} ${GENHDRS} > > > > -LINKS= /root/.profile /.profile > > > > > > > > build-tools: mknodes mksyntax > > > > > > > > @@ -66,5 +65,8 @@ SUBDIR.${MK_TESTS}+= tests > > > > > > > > beforeinstall: > > > > rm -f ${DESTDIR}/.profile > > > > > > Still unconditionally removing /.profile, but only replacing it > > > when installconfig: is run. > > > > Yes, working on a separate review for this.. > > > > > > + > > > > +afterinstallconfig: > > > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile > > > > > > > > .include > > > > > > > > Modified: head/etc/master.passwd > > > > ============================================================================== > > > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > > > @@ -1,6 +1,6 @@ > > > > # $FreeBSD$ > > > > # > > > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > > > > > I strongly object to this change to master.passwd, and feel it should > > > be worked around if in anyway possible. I have pointed out in the > > > review ways to not have to make this change. > > > > I opened up the following which addresses some of your feedback: > > https://reviews.freebsd.org/D16728 > > Actually why not back out this whole set of changes, and come up with > an agreeable solution, this is a bit of a mess right now. And here is: https://reviews.freebsd.org/D16729 You where the one asking about repo churn.. Regards, Brad Davis From owner-svn-src-all@freebsd.org Wed Aug 15 17:34:26 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 6CB401069D94; Wed, 15 Aug 2018 17:34:26 +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 AEF6F70824; Wed, 15 Aug 2018 17:34:16 +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 w7FHYEwg048847; Wed, 15 Aug 2018 10:34:14 -0700 (PDT) (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 w7FHYE9r048846; Wed, 15 Aug 2018 10:34:14 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151734.w7FHYE9r048846@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc In-Reply-To: <1534354189.922513.1475252728.321B67FB@webmail.messagingengine.com> To: Brad Davis Date: Wed, 15 Aug 2018 10:34:14 -0700 (PDT) CC: rgrimes@FreeBSD.org, 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:34:26 -0000 > > > Author: brd > > > Date: Wed Aug 15 16:22:12 2018 > > > New Revision: 337857 > > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > > > Log: > > > Fix build after r337849 > > > > > > This moves the symlink creation to after where the files are installed. > > > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > > > > > Approved by: will (mentor) > > > Differential Revision: https://reviews.freebsd.org/D16725 > > > > > > Modified: > > > head/bin/csh/Makefile > > > head/bin/sh/Makefile > > > head/etc/master.passwd > > > > > > Modified: head/bin/csh/Makefile > > > ============================================================================== > > > --- head/bin/csh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > +++ head/bin/csh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > @@ -49,8 +49,7 @@ MLINKS= csh.1 tcsh.1 > > > > > > LIBADD= termcapw crypt > > > > > > -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ > > > - /root/.cshrc /.cshrc > > > +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > > > > > > CLEANFILES= ${GENHDRS} gethost csh.1 > > > > > > @@ -158,7 +157,7 @@ beforeinstall: > > > rm -f ${DESTDIR}/.cshrc > > > > > > afterinstallconfig: > > > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > > > + sed -i "" -e 's;/bin/sh;/bin/csh;' ${DESTDIR}/etc/master.passwd > > > pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > > > > > .include > > > > > > Modified: head/bin/sh/Makefile > > > ============================================================================== > > > --- head/bin/sh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > +++ head/bin/sh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > @@ -37,7 +37,6 @@ WFORMAT=0 > > > > > > CLEANFILES+= mknodes mksyntax > > > CLEANFILES+= ${GENSRCS} ${GENHDRS} > > > -LINKS= /root/.profile /.profile > > > > > > build-tools: mknodes mksyntax > > > > > > @@ -66,5 +65,8 @@ SUBDIR.${MK_TESTS}+= tests > > > > > > beforeinstall: > > > rm -f ${DESTDIR}/.profile > > > > Still unconditionally removing /.profile, but only replacing it > > when installconfig: is run. > > Yes, working on a separate review for this.. > > > > + > > > +afterinstallconfig: > > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile > > > > > > .include > > > > > > Modified: head/etc/master.passwd > > > ============================================================================== > > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > > @@ -1,6 +1,6 @@ > > > # $FreeBSD$ > > > # > > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > > > I strongly object to this change to master.passwd, and feel it should > > be worked around if in anyway possible. I have pointed out in the > > review ways to not have to make this change. > > I opened up the following which addresses some of your feedback: > https://reviews.freebsd.org/D16728 Bleh, can we revert all of this, and take a second look with many more eyes on this. master.passwd coming from libc makes my head hurt! Also this is now a patch on a patch on a patch, time to end the dive down the rabbit hole! > > > toor:*:0:0::0:0:Bourne-again Superuser:/root: > > > daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > > > operator:*:2:5::0:0:System &:/:/usr/sbin/nologin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 17:36:28 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 F3F601069EFB; Wed, 15 Aug 2018 17:36:27 +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 5E43B70A45; Wed, 15 Aug 2018 17:36:27 +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 w7FHaPrU048872; Wed, 15 Aug 2018 10:36:25 -0700 (PDT) (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 w7FHaPiw048871; Wed, 15 Aug 2018 10:36:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151736.w7FHaPiw048871@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: To: Kyle Evans Date: Wed, 15 Aug 2018 10:36:25 -0700 (PDT) CC: "Rodney W. Grimes" , Ed Maste , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:36:28 -0000 > On Wed, Aug 15, 2018 at 11:07 AM, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> On 14 August 2018 at 21:41, Rodney W. Grimes > >> wrote: > >> >> Author: kevans > >> >> Date: Wed Aug 15 01:29:02 2018 > >> >> New Revision: 337826 > >> >> URL: https://svnweb.freebsd.org/changeset/base/337826 > >> >> > >> >> Log: > >> >> MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment > >> >> > >> >> COLORTERM is the de facto standard, while CLICOLOR is generally specific to > >> >> FreeBSD and ls(1). > >> > > >> > I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" > >> > Seems that the defaults for xfce terminal is to have COLORTERM. > >> > >> If xfce's default is to request colour via the de-facto environment > >> variable then we should generally honour it -- the answer to the > >> %&*@(#$@) question is "you did, via your terminal's default." > > > > And I pointed that out to them, but it is kinda a POLA, people have > > had to take explicit action to get colorls, that is no longer true > > and that suprises them when they see it. > > > > I find the POLA angle kind-of hard to buy, though. Nothing in the base > system offers a way for the default behavior of ls(1) to be altered, > and this whole change is only honoring a de-facto standard for > indicating that a colored terminal is supported and desired. > > IMO, one should be aware of how the software they use is affecting > their environment and the kinds of repercussions these changes may > have. This is hardly the first bit of software that respects > COLORTERM, and it surely won't be the last (in general... no specific > plans here). =( You can say it isnt a POLA, but the user was asstonished when it happened and made the comment, hence forth, it is POLA. Personally, I dont care, I do not use xfce's default terminal, I specificially invoke xterm. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 17:37:45 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 97BD21069FB3 for ; Wed, 15 Aug 2018 17:37:45 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from mail-yw1-xc2b.google.com (mail-yw1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) (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 3982670BAC for ; Wed, 15 Aug 2018 17:37:45 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by mail-yw1-xc2b.google.com with SMTP id e23-v6so1390529ywe.13 for ; Wed, 15 Aug 2018 10:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamw-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2o/D6NVOXAM/8mEYxoD28JjGviFQGRDibWQuQFfxxcc=; b=oOEJCZmSNIMxbI6aUuwLJr7q1c4vXPrNdmGvcSbR1o2z3mnxIYZ42Cm8oC0ygTNhm/ 1i7KeGO4jSaapgPABwQGUKzzY4zVoNpRs/LSPN+ohIXOjENl5wE5GZ8MnBdfqOgWbTaF GaKEALS0tygEi/inzk/bayE8AJDPPFbil3fXRi4NQ/DHbHadtsT6r1fueJCl4PApTNsD f2LbkyMsb5IUNNUYP7lFmITmMSk9sE0HIesaqx1wvJOsAY4YRIhSwMPdk4i+AzuCpp3c twNTO2fjzua8LgwH/6jRPoz/eAulrR5IPN6GUrxpDjJJECHPNGysly8olLf3RyQRtSUu jfmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2o/D6NVOXAM/8mEYxoD28JjGviFQGRDibWQuQFfxxcc=; b=KPhhIIUe2zU05OTQa3gcmqRZ9wf5uCKfnDZjoTBe6r1bF6VOYmUTFw7VuK/ikIoFll YlCrdkGJOWa3v18n5hfpwkaZDSJ4YOLNTLT4URIARnlked3+sIUw5Ri0z8CXEbyyrAcU s/HKtteRP19Bm8G5/+xFrqYiVPzRO23mdKWdFn00qTF2bLGj3bEzQItPAGC3TZDS6iJ6 v7LXK12hyM7Yva7nzFZ4t5mAoZxT3Hm0/kwWTF4wJfYI+/LLm+iIqg/l5+tEle6Vz8WN oaa9eog3DbNepqSRTZCThFpCFKIvZfbVIZOgJEKoL5u0TjFEyR4/FKDi+D9I6aMBvEOw zh2g== X-Gm-Message-State: AOUpUlEBFlRWKgVgfd3QOKimTi6Cm59Rj5yz2Ob4K6PePeRwIpxoplT/ SF9keoscVGe7hWISNlqRqKCRw4+ikd9B32cj+Y+6pA== X-Google-Smtp-Source: AA+uWPzNr0v3ahHAgKkEV0YkOjBAeNB3jimuDR9WH+1hxerJdSSWAWybq7eAyXKFmHstMvWs4BaLIj0LqwrZQyemLoQ= X-Received: by 2002:a25:61cd:: with SMTP id v196-v6mr14574516ybb.246.1534354664537; Wed, 15 Aug 2018 10:37:44 -0700 (PDT) MIME-Version: 1.0 References: <201808151607.w7FG7Smo048317@pdx.rh.CN85.dnsmgr.net> In-Reply-To: From: Adam Weinberger Date: Wed, 15 Aug 2018 11:37:28 -0600 Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: kevans@freebsd.org Cc: rgrimes@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, emaste@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:37:45 -0000 On Wed, Aug 15, 2018 at 11:31 AM Kyle Evans wrote: > > On Wed, Aug 15, 2018 at 11:07 AM, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> On 14 August 2018 at 21:41, Rodney W. Grimes > >> wrote: > >> >> Author: kevans > >> >> Date: Wed Aug 15 01:29:02 2018 > >> >> New Revision: 337826 > >> >> URL: https://svnweb.freebsd.org/changeset/base/337826 > >> >> > >> >> Log: > >> >> MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment > >> >> > >> >> COLORTERM is the de facto standard, while CLICOLOR is generally specific to > >> >> FreeBSD and ls(1). > >> > > >> > I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" > >> > Seems that the defaults for xfce terminal is to have COLORTERM. > >> > >> If xfce's default is to request colour via the de-facto environment > >> variable then we should generally honour it -- the answer to the > >> %&*@(#$@) question is "you did, via your terminal's default." > > > > And I pointed that out to them, but it is kinda a POLA, people have > > had to take explicit action to get colorls, that is no longer true > > and that suprises them when they see it. > > > > I find the POLA angle kind-of hard to buy, though. Nothing in the base > system offers a way for the default behavior of ls(1) to be altered, > and this whole change is only honoring a de-facto standard for > indicating that a colored terminal is supported and desired. > > IMO, one should be aware of how the software they use is affecting > their environment and the kinds of repercussions these changes may > have. This is hardly the first bit of software that respects > COLORTERM, and it surely won't be the last (in general... no specific > plans here). =( Respecting the same env var that other OS's do seems like a reduction in POLA. Please consider putting a note in one or more of /usr/src/UPDATING, /usr/ports/UPDATING, and xfce/pkg-message explaining the change and what people should do to get the old behaviour. They're the best tools we have for improving POLA. # Adam -- Adam Weinberger adamw@adamw.org https://www.adamw.org From owner-svn-src-all@freebsd.org Wed Aug 15 17:41: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 CBC9D106A240; Wed, 15 Aug 2018 17:41: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81E8270DBB; Wed, 15 Aug 2018 17:41:20 +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 62A785AF5; Wed, 15 Aug 2018 17:41:20 +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 w7FHfKmT068246; Wed, 15 Aug 2018 17:41:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FHfKHu068245; Wed, 15 Aug 2018 17:41:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808151741.w7FHfKHu068245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 15 Aug 2018 17:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337861 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 337861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:41:21 -0000 Author: cem Date: Wed Aug 15 17:41:19 2018 New Revision: 337861 URL: https://svnweb.freebsd.org/changeset/base/337861 Log: FUSE: Document global sysctl knobs So that I don't have to keep grepping around the codebase to remember what each one does. And maybe it saves someone else some time. Fix a trivial whitespace issue while here. No functional change. Sponsored by: Dell EMC Isilon Modified: head/sys/fs/fuse/fuse_node.c Modified: head/sys/fs/fuse/fuse_node.c ============================================================================== --- head/sys/fs/fuse/fuse_node.c Wed Aug 15 16:36:29 2018 (r337860) +++ head/sys/fs/fuse/fuse_node.c Wed Aug 15 17:41:19 2018 (r337861) @@ -97,37 +97,48 @@ MALLOC_DEFINE(M_FUSEVN, "fuse_vnode", "fuse vnode priv static int fuse_node_count = 0; SYSCTL_INT(_vfs_fuse, OID_AUTO, node_count, CTLFLAG_RD, - &fuse_node_count, 0, ""); + &fuse_node_count, 0, "Count of FUSE vnodes"); int fuse_data_cache_enable = 1; SYSCTL_INT(_vfs_fuse, OID_AUTO, data_cache_enable, CTLFLAG_RW, - &fuse_data_cache_enable, 0, ""); + &fuse_data_cache_enable, 0, + "enable caching of FUSE file data (including dirty data)"); int fuse_data_cache_invalidate = 0; SYSCTL_INT(_vfs_fuse, OID_AUTO, data_cache_invalidate, CTLFLAG_RW, - &fuse_data_cache_invalidate, 0, ""); + &fuse_data_cache_invalidate, 0, + "If non-zero, discard cached clean file data when there are no active file" + " users"); int fuse_mmap_enable = 1; SYSCTL_INT(_vfs_fuse, OID_AUTO, mmap_enable, CTLFLAG_RW, - &fuse_mmap_enable, 0, ""); + &fuse_mmap_enable, 0, + "If non-zero, and data_cache_enable is also non-zero, enable mmap(2) of " + "FUSE files"); int fuse_refresh_size = 0; SYSCTL_INT(_vfs_fuse, OID_AUTO, refresh_size, CTLFLAG_RW, - &fuse_refresh_size, 0, ""); + &fuse_refresh_size, 0, + "If non-zero, and no dirty file extension data is buffered, fetch file " + "size before write operations"); int fuse_sync_resize = 1; SYSCTL_INT(_vfs_fuse, OID_AUTO, sync_resize, CTLFLAG_RW, - &fuse_sync_resize, 0, ""); + &fuse_sync_resize, 0, + "If a cached write extended a file, inform FUSE filesystem of the changed" + "size immediately subsequent to the issued writes"); int fuse_fix_broken_io = 0; SYSCTL_INT(_vfs_fuse, OID_AUTO, fix_broken_io, CTLFLAG_RW, - &fuse_fix_broken_io, 0, ""); + &fuse_fix_broken_io, 0, + "If non-zero, print a diagnostic warning if a userspace filesystem returns" + " EIO on reads of recently extended portions of files"); static void fuse_vnode_init(struct vnode *vp, struct fuse_vnode_data *fvdat, @@ -336,7 +347,7 @@ fuse_vnode_savesize(struct vnode *vp, struct ucred *cr fsai->valid = 0; /* Truncate to a new value. */ - fsai->size = fvdat->filesize; + fsai->size = fvdat->filesize; fsai->valid |= FATTR_SIZE; fuse_filehandle_getrw(vp, FUFH_WRONLY, &fufh); From owner-svn-src-all@freebsd.org Wed Aug 15 17:43: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 EE71D106A2D4; Wed, 15 Aug 2018 17:43:13 +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 583867113A; Wed, 15 Aug 2018 17:43: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 w7FHhBOm048919; Wed, 15 Aug 2018 10:43:11 -0700 (PDT) (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 w7FHhBT9048918; Wed, 15 Aug 2018 10:43:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151743.w7FHhBT9048918@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: To: Adam Weinberger Date: Wed, 15 Aug 2018 10:43:11 -0700 (PDT) CC: kevans@freebsd.org, rgrimes@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, emaste@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:43:14 -0000 [ Charset UTF-8 unsupported, converting... ] > On Wed, Aug 15, 2018 at 11:31 AM Kyle Evans wrote: > > > > On Wed, Aug 15, 2018 at 11:07 AM, Rodney W. Grimes > > wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > >> On 14 August 2018 at 21:41, Rodney W. Grimes > > >> wrote: > > >> >> Author: kevans > > >> >> Date: Wed Aug 15 01:29:02 2018 > > >> >> New Revision: 337826 > > >> >> URL: https://svnweb.freebsd.org/changeset/base/337826 > > >> >> > > >> >> Log: > > >> >> MFC r337506: ls(1): Enable colors with COLORTERM is set in the environment > > >> >> > > >> >> COLORTERM is the de facto standard, while CLICOLOR is generally specific to > > >> >> FreeBSD and ls(1). > > >> > > > >> > I have already seen one "Who enabled %&*@(#$@) colored ls output in 12?" > > >> > Seems that the defaults for xfce terminal is to have COLORTERM. > > >> > > >> If xfce's default is to request colour via the de-facto environment > > >> variable then we should generally honour it -- the answer to the > > >> %&*@(#$@) question is "you did, via your terminal's default." > > > > > > And I pointed that out to them, but it is kinda a POLA, people have > > > had to take explicit action to get colorls, that is no longer true > > > and that suprises them when they see it. > > > > > > > I find the POLA angle kind-of hard to buy, though. Nothing in the base > > system offers a way for the default behavior of ls(1) to be altered, > > and this whole change is only honoring a de-facto standard for > > indicating that a colored terminal is supported and desired. > > > > IMO, one should be aware of how the software they use is affecting > > their environment and the kinds of repercussions these changes may > > have. This is hardly the first bit of software that respects > > COLORTERM, and it surely won't be the last (in general... no specific > > plans here). =( > > Respecting the same env var that other OS's do seems like a reduction in POLA. > > Please consider putting a note in one or more of /usr/src/UPDATING, > /usr/ports/UPDATING, and xfce/pkg-message explaining the change and > what people should do to get the old behaviour. They're the best tools > we have for improving POLA. >From the Linux man page at: http://man7.org/linux/man-pages/man1/ls.1.html Using color to distinguish file types is disabled both by default and with --color=never. With --color=auto, ls emits color codes only when standard output is connected to a terminal. The LS_COLORS environment variable can change the settings. Use the dircolors command to set it. Um, so by default we should not be doing any colour... and we are... > > # Adam > > > -- > Adam Weinberger > adamw@adamw.org > https://www.adamw.org > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 17:44: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 01362106A36A for ; Wed, 15 Aug 2018 17:44:34 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2r.ore.mailhop.org (outbound2r.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B88D71290 for ; Wed, 15 Aug 2018 17:44:32 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: d8d88d2a-a0b2-11e8-904b-1d2e466b3c59 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id d8d88d2a-a0b2-11e8-904b-1d2e466b3c59; Wed, 15 Aug 2018 17:44:24 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7FHiNww075553; Wed, 15 Aug 2018 11:44:23 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534355063.1466.6.camel@freebsd.org> Subject: Re: svn commit: r337826 - stable/11/bin/ls From: Ian Lepore To: rgrimes@freebsd.org, Kyle Evans Cc: Ed Maste , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Date: Wed, 15 Aug 2018 11:44:23 -0600 In-Reply-To: <201808151736.w7FHaPiw048871@pdx.rh.CN85.dnsmgr.net> References: <201808151736.w7FHaPiw048871@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 17:44:34 -0000 On Wed, 2018-08-15 at 10:36 -0700, Rodney W. Grimes wrote: > > > > On Wed, Aug 15, 2018 at 11:07 AM, Rodney W. Grimes > > wrote: > > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > On 14 August 2018 at 21:41, Rodney W. Grimes > > > > wrote: > > > > > > > > > > > > > > > > > Author: kevans > > > > > > Date: Wed Aug 15 01:29:02 2018 > > > > > > New Revision: 337826 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/337826 > > > > > > > > > > > > Log: > > > > > >   MFC r337506: ls(1): Enable colors with COLORTERM is set > > > > > > in the environment > > > > > > > > > > > >   COLORTERM is the de facto standard, while CLICOLOR is > > > > > > generally specific to > > > > > >   FreeBSD and ls(1). > > > > > I have already seen one "Who enabled %&*@(#$@) colored ls > > > > > output in 12?" > > > > > Seems that the defaults for xfce terminal is to have > > > > > COLORTERM. > > > > If xfce's default is to request colour via the de-facto > > > > environment > > > > variable then we should generally honour it -- the answer to > > > > the > > > > %&*@(#$@) question is "you did, via your terminal's default." > > > And I pointed that out to them, but it is kinda a POLA, people > > > have > > > had to take explicit action to get colorls, that is no longer > > > true > > > and that suprises them when they see it. > > > > > I find the POLA angle kind-of hard to buy, though. Nothing in the > > base > > system offers a way for the default behavior of ls(1) to be > > altered, > > and this whole change is only honoring a de-facto standard for > > indicating that a colored terminal is supported and desired. > > > > IMO, one should be aware of how the software they use is affecting > > their environment and the kinds of repercussions these changes may > > have. This is hardly the first bit of software that respects > > COLORTERM, and it surely won't be the last (in general... no > > specific > > plans here). =( > You can say it isnt a POLA, but the user was asstonished when it > happened and made the comment, hence forth, it is POLA. > > Personally, I dont care, I do not use xfce's default terminal, > I specificially invoke xterm. > I would expect the thing that would lead to the most astonishment by most users would be "Even though I (or my shell) set COLORTERM, nothing in freebsd respects that and I still have to turn 18 other knobs to get color support from standard utilities." There's not much I hate more than colored output in my preferred black- on-white terminal windows, but having to enable or disable that support in multiple places is the kind of thing that would rank right up there. -- Ian From owner-svn-src-all@freebsd.org Wed Aug 15 18:18: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 B43F8106B132; Wed, 15 Aug 2018 18:18:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 644A87253F; Wed, 15 Aug 2018 18:18:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 00FC316673; Wed, 15 Aug 2018 18:18:12 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f48.google.com with SMTP id n96-v6so1532562lfi.1; Wed, 15 Aug 2018 11:18:12 -0700 (PDT) X-Gm-Message-State: AOUpUlHirp9HA18wPIRRxvJWYdgS/N2E5N+Yx94CS3zZm4kW6VPBBEFw BBvPiwMzUTcziRgMMWvF68PXcpn8JU1VWEPn7gI= X-Google-Smtp-Source: AA+uWPwvAJp1gdp1wEZS5RfyK8iY30O80onWy50Gz664qcQ6/hT2zPoIz3kKWjX/vSabKvcr90OcnVpSHB5a7REXUBg= X-Received: by 2002:a19:26d2:: with SMTP id m201-v6mr16642582lfm.43.1534357091599; Wed, 15 Aug 2018 11:18:11 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 11:17:50 -0700 (PDT) In-Reply-To: <201808151743.w7FHhBT9048918@pdx.rh.CN85.dnsmgr.net> References: <201808151743.w7FHhBT9048918@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Wed, 15 Aug 2018 13:17:50 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: "Rodney W. Grimes" Cc: Adam Weinberger , Kyle Evans , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 18:18:13 -0000 On Wed, Aug 15, 2018 at 12:43 PM, Rodney W. Grimes wrote: > > From the Linux man page at: http://man7.org/linux/man-pages/man1/ls.1.html > > Using color to distinguish file types is disabled both by default and > with --color=never. With --color=auto, ls emits color codes only > when standard output is connected to a terminal. The LS_COLORS > environment variable can change the settings. Use the dircolors > command to set it. > > Um, so by default we should not be doing any colour... and we are... > I don't recall making any argument that we're trying to match GNU ls(1) behavior. Furthermore, again, we aren't doing any color by default- only when the COLORTERM environment variable is set. ls(1) on FreeBSD historically honors -an- environment variable for enabling color. This environment variable is CLICOLOR. This commit switched the environment variable honored to the more-standard COLORTERM that is honored in other software and set by terminals that are generally expected to be used with color. I'm writing an UPDATING entry for this now to notify these users that they should remove COLORTERM from their environment if they do not, in fact, want a colored terminal. From owner-svn-src-all@freebsd.org Wed Aug 15 18:19: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 D3165106B1EC; Wed, 15 Aug 2018 18:19:46 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8926C726A2; Wed, 15 Aug 2018 18:19:46 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 658FA611C; Wed, 15 Aug 2018 18:19:46 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FIJkZB084413; Wed, 15 Aug 2018 18:19:46 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FIJjs4084410; Wed, 15 Aug 2018 18:19:45 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201808151819.w7FIJjs4084410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Wed, 15 Aug 2018 18:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337862 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 337862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 18:19:47 -0000 Author: pstef Date: Wed Aug 15 18:19:45 2018 New Revision: 337862 URL: https://svnweb.freebsd.org/changeset/base/337862 Log: indent(1): bug fix after r336333 The bug was that isalnum() is not exactly equivalent to previous code which also allowed characters "$" and "_", so check for those explicitly. Reported by: tuexen@ Modified: head/usr.bin/indent/lexi.c head/usr.bin/indent/tests/float.0 head/usr.bin/indent/tests/float.0.stdout Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Wed Aug 15 17:41:19 2018 (r337861) +++ head/usr.bin/indent/lexi.c Wed Aug 15 18:19:45 2018 (r337862) @@ -193,6 +193,7 @@ lexi(struct parser_state *state) /* Scan an alphanumeric token */ if (isalnum((unsigned char)*buf_ptr) || + *buf_ptr == '_' || *buf_ptr == '$' || (buf_ptr[0] == '.' && isdigit((unsigned char)buf_ptr[1]))) { /* * we have a character or number @@ -222,7 +223,7 @@ lexi(struct parser_state *state) else while (isalnum((unsigned char)*buf_ptr) || *buf_ptr == BACKSLASH || - *buf_ptr == '_') { + *buf_ptr == '_' || *buf_ptr == '$') { /* fill_buffer() terminates buffer with newline */ if (*buf_ptr == BACKSLASH) { if (*(buf_ptr + 1) == '\n') { Modified: head/usr.bin/indent/tests/float.0 ============================================================================== --- head/usr.bin/indent/tests/float.0 Wed Aug 15 17:41:19 2018 (r337861) +++ head/usr.bin/indent/tests/float.0 Wed Aug 15 18:19:45 2018 (r337862) @@ -4,4 +4,5 @@ void t(void) { double y[] = {0x1P+9F, 0.3, .1, 1.2f, 0xa.p01f, 3.14f, 2.L}; int z = 0b0101; DO_NOTHING; + x._y = 5; } Modified: head/usr.bin/indent/tests/float.0.stdout ============================================================================== --- head/usr.bin/indent/tests/float.0.stdout Wed Aug 15 17:41:19 2018 (r337861) +++ head/usr.bin/indent/tests/float.0.stdout Wed Aug 15 18:19:45 2018 (r337862) @@ -6,4 +6,5 @@ t(void) double y[] = {0x1P+9F, 0.3, .1, 1.2f, 0xa.p01f, 3.14f, 2.L}; int z = 0b0101; DO_NOTHING; + x._y = 5; } From owner-svn-src-all@freebsd.org Wed Aug 15 18:28:41 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 2FF3C106B67F; Wed, 15 Aug 2018 18:28:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (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 A598D72E70; Wed, 15 Aug 2018 18:28:40 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf1-x442.google.com with SMTP id l9-v6so836255pff.9; Wed, 15 Aug 2018 11:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=k4qzuuHoP3t0BCwgxurp8/JplDZayuII5Kw9uRXDSk8=; b=HRhtj5RRa2QIGtU1PTseNhZvOfJqjp05FhuPo9gz9jTNE2/tuCLvJUd06d7WkKmGVv 4Fh7K1T9+Lkedo/O98EZCkFpPnSumTFmc4VuTBrR+idUiC8O7qKm7pNFfD2o3D3c6BxG f4wSDkgiypnjIJD1Ls0wN68V5Co0IxYHMR1isQIzFJ8IYFrbwEHCXdokqynxRJJ5r7p8 z6YISd4qoWlWFXWxClbaRkPbzwfQbKV4ez0ocKtnIAgGb8pFqdm+22sUY69F0Y1N8Vzm rG24SXp4t0LUAOLtwxBZNuBjrG3xBBU4p7x5r/JC9yppzDiiX9l+U9Q6Jzu4YNGVeWBt 1rBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=k4qzuuHoP3t0BCwgxurp8/JplDZayuII5Kw9uRXDSk8=; b=pR9W7BKRaoBs18NA0qNZU8WegwAN5+wp9U3B5hvVPL9b048jQj/aTHjis9bLUjrENn Vz48c7d53RBc72P8VHYMyGq63lWkS0G6cvDA5PQDT60LMCfQ3D5RJ4xtJKC5FNtyJegH fyl66dbjGiheffx8f/fpM8jWIUxab9ZEB07QHBss2NKWu6LjUgKe6QYplvU4sH5x/Hhn bB0AuU4TB1Im7Tyb32m8k2KnsZdoERwUgviSJlaNOnPGbbEbKODMN2DVCqReksnTyPw7 J6MwRrMmEIMsM4lrGt80Drcesp0hPrH6fWFE4RS2a2bKNKZsYN67aTK9RGJF5X02RGfh 7Kgw== X-Gm-Message-State: AOUpUlFRoHQJL8nN7WVL4hMRoCYxSaXIFsDcKRaJBpl8ZjdsM8W65Cre UuzNJNoTCURoZd9HNj7XQzRyyTS2 X-Google-Smtp-Source: AA+uWPz5pL+rzAHGbi0S7vsVy8gYwFoXNi4MbbgsOy6a8AWviqAkZzl9gx2i5/8HC7MA7J2bqTUyxg== X-Received: by 2002:a63:ee56:: with SMTP id n22-v6mr25014227pgk.402.1534357719391; Wed, 15 Aug 2018 11:28:39 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id w13-v6sm21817404pgs.89.2018.08.15.11.28.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Aug 2018 11:28:38 -0700 (PDT) Sender: Mark Johnston Date: Wed, 15 Aug 2018 14:28:35 -0400 From: Mark Johnston To: rgrimes@freebsd.org, Brad Davis Cc: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc Message-ID: <20180815182835.GB42216@raichu> References: <1534353535.920234.1475238264.523AA6C6@webmail.messagingengine.com> <201808151731.w7FHV4vv048790@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201808151731.w7FHV4vv048790@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 18:28:41 -0000 On Wed, Aug 15, 2018 at 10:31:04AM -0700, Rodney W. Grimes wrote: > > On Wed, Aug 15, 2018, at 11:17 AM, Ravi Pokala wrote: > > > Brad, > > > > > > -----Original Message----- > > > From: on behalf of Brad Davis > > > > > > Date: 2018-08-15, Wednesday at 09:22 > > > To: , , > > head@freebsd.org> > > > Subject: svn commit: r337857 - in head: bin/csh bin/sh etc > > > > > > > Author: brd > > > > Date: Wed Aug 15 16:22:12 2018 > > > > New Revision: 337857 > > > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > > > > > Log: > > > > Fix build after r337849 > > > > > > > > This moves the symlink creation to after where the files are installed. > > > > > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > > ... > > > > Modified: head/etc/master.passwd > > > > ============================================================================== > > > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > > > @@ -1,6 +1,6 @@ > > > > # $FreeBSD$ > > > > # > > > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > > > toor:*:0:0::0:0:Bourne-again Superuser:/root: > > > > daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > > > > operator:*:2:5::0:0:System &:/:/usr/sbin/nologin > > > > > > Woah! Changing the root shell wasn't mentioned in the change > > > description, has nothing to do with fixing r337849, and is a *HUGE* POLA > > > violation. At the very least, a change of this magnitude needs public > > > discussion, and even if the community agreed, it would also require an > > > UPDATING message and relnote. > > > > > > Please revert this change to master.passwd immediately. > > > > Hi Ravi, > > > > Please, look closer. It doesn't change what is actually installed in either case, it just inverts the logic. > > Though the end results maybe the same, we now have a sed that > is running in the normal case, is not run in the exception case, > a src file that must be editted to match the distribution file, > etc. I can not express stronly enough how much I object to this. > > I have explained in your diffential that this should actually be > put back as far as inverted, and that actually bin/csh/Makefile > nor bin/sh/Makefile should never even touch etc/master.password, > simply the wrong place to be doing it. This should be in what > ever Makefile installs /etc/master.password an no place else. As a side observation, this kind of editing at build time can break -DNO_ROOT. See PR 209718 for a different example of the same problem. I haven't yet verified that this change has the same issue; my apologies if I'm missing something and there is no problem after all. From owner-svn-src-all@freebsd.org Wed Aug 15 18:35: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 1DB5E106BBD5; Wed, 15 Aug 2018 18:35:44 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7E6A735DF; Wed, 15 Aug 2018 18:35:43 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A47F66457; Wed, 15 Aug 2018 18:35:43 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FIZhE2094706; Wed, 15 Aug 2018 18:35:43 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FIZgW7094701; Wed, 15 Aug 2018 18:35:42 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201808151835.w7FIZgW7094701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Wed, 15 Aug 2018 18:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337863 - in head: sys/sys usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: in head: sys/sys usr.sbin/jail X-SVN-Commit-Revision: 337863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 18:35:44 -0000 Author: netchild Date: Wed Aug 15 18:35:42 2018 New Revision: 337863 URL: https://svnweb.freebsd.org/changeset/base/337863 Log: - Add exec hook "exec.created". This is called when the jail is created and before exec.start is called. [1] - Bump __FreeBSD_version. This allows to attach ZFS datasets and various other things to be done before any command/service/rc-script is started in the new jail. PR: 228066 [1] Reviewed by: jamie [1] Submitted by: Stefan Grönke [1] Differential Revision: https://reviews.freebsd.org/D15330 [1] Modified: head/sys/sys/param.h head/usr.sbin/jail/command.c head/usr.sbin/jail/config.c head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.c head/usr.sbin/jail/jailp.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Aug 15 18:19:45 2018 (r337862) +++ head/sys/sys/param.h Wed Aug 15 18:35:42 2018 (r337863) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200077 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200078 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Wed Aug 15 18:19:45 2018 (r337862) +++ head/usr.sbin/jail/command.c Wed Aug 15 18:35:42 2018 (r337863) @@ -147,8 +147,8 @@ next_command(struct cfjail *j) } if (j->comstring == NULL || j->comstring->len == 0 || (create_failed && (comparam == IP_EXEC_PRESTART || - comparam == IP_EXEC_START || comparam == IP_COMMAND || - comparam == IP_EXEC_POSTSTART))) + comparam == IP_EXEC_CREATED || comparam == IP_EXEC_START || + comparam == IP_COMMAND || comparam == IP_EXEC_POSTSTART))) continue; switch (run_command(j)) { case -1: Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Wed Aug 15 18:19:45 2018 (r337862) +++ head/usr.sbin/jail/config.c Wed Aug 15 18:35:42 2018 (r337863) @@ -73,6 +73,7 @@ static const struct ipspec intparams[] = { [IP_EXEC_POSTSTOP] = {"exec.poststop", PF_INTERNAL}, [IP_EXEC_PRESTART] = {"exec.prestart", PF_INTERNAL}, [IP_EXEC_PRESTOP] = {"exec.prestop", PF_INTERNAL}, + [IP_EXEC_CREATED] = {"exec.created", PF_INTERNAL}, [IP_EXEC_START] = {"exec.start", PF_INTERNAL}, [IP_EXEC_STOP] = {"exec.stop", PF_INTERNAL}, [IP_EXEC_SYSTEM_JAIL_USER]= {"exec.system_jail_user", Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Wed Aug 15 18:19:45 2018 (r337862) +++ head/usr.sbin/jail/jail.8 Wed Aug 15 18:35:42 2018 (r337863) @@ -706,6 +706,9 @@ The pseudo-parameters are: .Bl -tag -width indent .It Va exec.prestart Command(s) to run in the system environment before a jail is created. +.It Va exec.created +Command(s) to run in the system environment right after a jail has been +created, but before commands (or services) get executed in the jail. .It Va exec.start Command(s) to run in the jail environment when a jail is created. A typical command to run is Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Wed Aug 15 18:19:45 2018 (r337862) +++ head/usr.sbin/jail/jail.c Wed Aug 15 18:35:42 2018 (r337863) @@ -98,6 +98,7 @@ static const enum intparam startcommands[] = { IP_MOUNT_PROCFS, IP_EXEC_PRESTART, IP__OP, + IP_EXEC_CREATED, IP_VNET_INTERFACE, IP_EXEC_START, IP_COMMAND, Modified: head/usr.sbin/jail/jailp.h ============================================================================== --- head/usr.sbin/jail/jailp.h Wed Aug 15 18:19:45 2018 (r337862) +++ head/usr.sbin/jail/jailp.h Wed Aug 15 18:35:42 2018 (r337863) @@ -88,6 +88,7 @@ enum intparam { IP_EXEC_POSTSTOP, /* Commands run outside jail after removing */ IP_EXEC_PRESTART, /* Commands run outside jail before creating */ IP_EXEC_PRESTOP, /* Commands run outside jail before removing */ + IP_EXEC_CREATED, /* Commands run outside jail right after it was started */ IP_EXEC_START, /* Commands run inside jail on creation */ IP_EXEC_STOP, /* Commands run inside jail on removal */ IP_EXEC_SYSTEM_JAIL_USER,/* Get jail_user from system passwd file */ From owner-svn-src-all@freebsd.org Wed Aug 15 19:28: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 8B79E106D3A3; Wed, 15 Aug 2018 19:28:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42226753F4; Wed, 15 Aug 2018 19:28:49 +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 1FB2E6CC8; Wed, 15 Aug 2018 19:28:49 +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 w7FJSm17020890; Wed, 15 Aug 2018 19:28:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FJSmXf020889; Wed, 15 Aug 2018 19:28:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808151928.w7FJSmXf020889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 15 Aug 2018 19:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337864 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 337864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 19:28:49 -0000 Author: kevans Date: Wed Aug 15 19:28:48 2018 New Revision: 337864 URL: https://svnweb.freebsd.org/changeset/base/337864 Log: Add post-mortem note to UPDATING about r337506 MFC after: 3 days Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Aug 15 18:35:42 2018 (r337863) +++ head/UPDATING Wed Aug 15 19:28:48 2018 (r337864) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180815: + ls(1) now respects the COLORTERM environment variable used in other + systems and software to indicate that a colored terminal is both + supported and desired. If ls(1) is suddenly emitting colors, they may + be disabled again by removing the unwanted COLORTERM from your + environment. The ls(1) specific CLICOLOR may not be observed in a + future release. + 20180808: The default pager for most commands has been changed to "less". To restore the old behavior, set PAGER="more" and MANPAGER="more -s" in From owner-svn-src-all@freebsd.org Wed Aug 15 19:29:55 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 63B8E106D5D0; Wed, 15 Aug 2018 19:29:55 +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 93C0E75879; Wed, 15 Aug 2018 19:29:50 +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 w7FJTlOb049320; Wed, 15 Aug 2018 12:29:47 -0700 (PDT) (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 w7FJTl2o049319; Wed, 15 Aug 2018 12:29:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151929.w7FJTl2o049319@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc In-Reply-To: <20180815182835.GB42216@raichu> To: Mark Johnston Date: Wed, 15 Aug 2018 12:29:46 -0700 (PDT) CC: rgrimes@freebsd.org, Brad Davis , Ravi Pokala , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 19:29:55 -0000 > On Wed, Aug 15, 2018 at 10:31:04AM -0700, Rodney W. Grimes wrote: > > > On Wed, Aug 15, 2018, at 11:17 AM, Ravi Pokala wrote: > > > > Brad, > > > > > > > > -----Original Message----- > > > > From: on behalf of Brad Davis > > > > > > > > Date: 2018-08-15, Wednesday at 09:22 > > > > To: , , > > > head@freebsd.org> > > > > Subject: svn commit: r337857 - in head: bin/csh bin/sh etc > > > > > > > > > Author: brd > > > > > Date: Wed Aug 15 16:22:12 2018 > > > > > New Revision: 337857 > > > > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > > > > > > > Log: > > > > > Fix build after r337849 > > > > > > > > > > This moves the symlink creation to after where the files are installed. > > > > > > > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > > > ... > > > > > Modified: head/etc/master.passwd > > > > > ============================================================================== > > > > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > > > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > > > > @@ -1,6 +1,6 @@ > > > > > # $FreeBSD$ > > > > > # > > > > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > > > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > > > > toor:*:0:0::0:0:Bourne-again Superuser:/root: > > > > > daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > > > > > operator:*:2:5::0:0:System &:/:/usr/sbin/nologin > > > > > > > > Woah! Changing the root shell wasn't mentioned in the change > > > > description, has nothing to do with fixing r337849, and is a *HUGE* POLA > > > > violation. At the very least, a change of this magnitude needs public > > > > discussion, and even if the community agreed, it would also require an > > > > UPDATING message and relnote. > > > > > > > > Please revert this change to master.passwd immediately. > > > > > > Hi Ravi, > > > > > > Please, look closer. It doesn't change what is actually installed in either case, it just inverts the logic. > > > > Though the end results maybe the same, we now have a sed that > > is running in the normal case, is not run in the exception case, > > a src file that must be editted to match the distribution file, > > etc. I can not express stronly enough how much I object to this. > > > > I have explained in your diffential that this should actually be > > put back as far as inverted, and that actually bin/csh/Makefile > > nor bin/sh/Makefile should never even touch etc/master.password, > > simply the wrong place to be doing it. This should be in what > > ever Makefile installs /etc/master.password an no place else. > > As a side observation, this kind of editing at build time can break > -DNO_ROOT. See PR 209718 for a different example of the same problem. > I haven't yet verified that this change has the same issue; my apologies > if I'm missing something and there is no problem after all. > I do not believe that there are any edits at build time here, these are in install: type targets, or should be. None the less, there could be -DNO_ROOT issues I am not thinking of, as well as half a dozen other issues. My concern is we are now at a patch to a patch to a patch, and that tells me the initial change was not well thought out and it would probably be best to back out and rethink the whole thing. Does anyone have issue with reverting and starting back with the original differential, fixing it to DTRT ? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 19:35: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 35739106DD38; Wed, 15 Aug 2018 19:35:00 +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 C072876C73; Wed, 15 Aug 2018 19:34:49 +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 w7FJYlf4049358; Wed, 15 Aug 2018 12:34:47 -0700 (PDT) (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 w7FJYloG049357; Wed, 15 Aug 2018 12:34:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151934.w7FJYloG049357@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: To: Kyle Evans Date: Wed, 15 Aug 2018 12:34:47 -0700 (PDT) CC: "Rodney W. Grimes" , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 19:35:00 -0000 [ Charset UTF-8 unsupported, converting... ] > On Wed, Aug 15, 2018 at 12:43 PM, Rodney W. Grimes > wrote: > > > > From the Linux man page at: http://man7.org/linux/man-pages/man1/ls.1.html > > > > Using color to distinguish file types is disabled both by default and > > with --color=never. With --color=auto, ls emits color codes only > > when standard output is connected to a terminal. The LS_COLORS > > environment variable can change the settings. Use the dircolors > > command to set it. > > > > Um, so by default we should not be doing any colour... and we are... > > > > I don't recall making any argument that we're trying to match GNU > ls(1) behavior. Furthermore, again, we aren't doing any color by > default- only when the COLORTERM environment variable is set. So we are intentially being different? > > ls(1) on FreeBSD historically honors -an- environment variable for > enabling color. Short history, long history it had no color support at all. > This environment variable is CLICOLOR. This commit > switched the environment variable honored to the more-standard > COLORTERM that is honored in other software and set by terminals that > are generally expected to be used with color. > > I'm writing an UPDATING entry for this now to notify these users that > they should remove COLORTERM from their environment if they do not, in > fact, want a colored terminal. Is that the only way to turn this off? That may not be desired either. Atleast GNU ls allows me to force it off on command invocation with --color=never, do we have an equivelent? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 19:43: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 8C80F106E39B; Wed, 15 Aug 2018 19:43:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D3F17789C; Wed, 15 Aug 2018 19:43:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D157E16F94; Wed, 15 Aug 2018 19:43:23 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f51.google.com with SMTP id j143-v6so1675786lfj.12; Wed, 15 Aug 2018 12:43:23 -0700 (PDT) X-Gm-Message-State: AOUpUlEtxO6dn4KE16yKKYkf2il5bkoWvovtBfvJ49te+Hj3GJNzSjCp /qGDIvz84ltHbTqTyTFNGV+KyU6GxeI9jpLJ6Ac= X-Google-Smtp-Source: AA+uWPxa/0EFpNztpA2qi+/hp/ijaTpRtC2yb+Ogp7fulgNIXuaCGeKwC0Opas/K6xej3i/OwweWzhvgD6QYiPtNr8E= X-Received: by 2002:a19:ded7:: with SMTP id i84-v6mr2082353lfl.146.1534362202493; Wed, 15 Aug 2018 12:43:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 12:43:01 -0700 (PDT) In-Reply-To: <201808151934.w7FJYloG049357@pdx.rh.CN85.dnsmgr.net> References: <201808151934.w7FJYloG049357@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Wed, 15 Aug 2018 14:43:01 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: "Rodney W. Grimes" Cc: Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 19:43:24 -0000 On Wed, Aug 15, 2018 at 2:34 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On Wed, Aug 15, 2018 at 12:43 PM, Rodney W. Grimes >> wrote: >> > >> > From the Linux man page at: http://man7.org/linux/man-pages/man1/ls.1.html >> > >> > Using color to distinguish file types is disabled both by default and >> > with --color=never. With --color=auto, ls emits color codes only >> > when standard output is connected to a terminal. The LS_COLORS >> > environment variable can change the settings. Use the dircolors >> > command to set it. >> > >> > Um, so by default we should not be doing any colour... and we are... >> > >> >> I don't recall making any argument that we're trying to match GNU >> ls(1) behavior. Furthermore, again, we aren't doing any color by >> default- only when the COLORTERM environment variable is set. > > So we are intentially being different? > No, we are not intentionally being different. See: the next paragraph, where I described that we've now-historically been honoring an environment variable for this and have simply added a more standard name for this variable. >> >> ls(1) on FreeBSD historically honors -an- environment variable for >> enabling color. > > Short history, long history it had no color support at all. Color support in ls(1) is now old enough to drink having been introduced in 2000- I think that's long enough to call it "historically" here in 2018. > >> This environment variable is CLICOLOR. This commit >> switched the environment variable honored to the more-standard >> COLORTERM that is honored in other software and set by terminals that >> are generally expected to be used with color. >> >> I'm writing an UPDATING entry for this now to notify these users that >> they should remove COLORTERM from their environment if they do not, in >> fact, want a colored terminal. > > Is that the only way to turn this off? > That may not be desired either. > Atleast GNU ls allows me to force it off on command invocation > with --color=never, do we have an equivelent? > Sure- it gets turned off the same way it got turned on. =) I'm certainly not averse to adding a --color long option, and will do so when I find the time (later today, most likely). Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Wed Aug 15 19:46: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 5AFF8106E551; Wed, 15 Aug 2018 19:46:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4BE77B97; Wed, 15 Aug 2018 19:46:15 +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 E39F17019; Wed, 15 Aug 2018 19:46:14 +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 w7FJkEEl034127; Wed, 15 Aug 2018 19:46:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FJkD6i034122; Wed, 15 Aug 2018 19:46:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808151946.w7FJkD6i034122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 15 Aug 2018 19:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337865 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 337865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 19:46:15 -0000 Author: kevans Date: Wed Aug 15 19:46:13 2018 New Revision: 337865 URL: https://svnweb.freebsd.org/changeset/base/337865 Log: dd: Incorporate some changes from imp for status=progress Notable changes from what landed in r337505: - sigalarm handler isn't setup unless we're actually using it - Humanized versions of the amount of data transferred in the progress update Submitted by: imp Reviewed by: kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D16642 Modified: head/bin/dd/Makefile head/bin/dd/dd.c head/bin/dd/extern.h head/bin/dd/misc.c head/bin/dd/position.c Modified: head/bin/dd/Makefile ============================================================================== --- head/bin/dd/Makefile Wed Aug 15 19:28:48 2018 (r337864) +++ head/bin/dd/Makefile Wed Aug 15 19:46:13 2018 (r337865) @@ -6,6 +6,7 @@ PACKAGE=runtime PROG= dd SRCS= args.c conv.c conv_tab.c dd.c misc.c position.c +LIBADD= util # # Test the character conversion functions. We have to be explicit about Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Wed Aug 15 19:28:48 2018 (r337864) +++ head/bin/dd/dd.c Wed Aug 15 19:46:13 2018 (r337865) @@ -95,6 +95,8 @@ volatile sig_atomic_t need_progress; int main(int argc __unused, char *argv[]) { + struct itimerval itv = { { 1, 0 }, { 1, 0 } }; /* SIGALARM every second, if needed */ + (void)setlocale(LC_CTYPE, ""); jcl(argv); setup(); @@ -104,7 +106,10 @@ main(int argc __unused, char *argv[]) err(1, "unable to enter capability mode"); (void)signal(SIGINFO, siginfo_handler); - (void)signal(SIGALRM, sigalrm_handler); + if (ddflags & C_PROGRESS) { + (void)signal(SIGALRM, sigalarm_handler); + setitimer(ITIMER_REAL, &itv, NULL); + } (void)signal(SIGINT, terminate); atexit(summary); @@ -284,14 +289,6 @@ setup(void) ctab = casetab; } - if ((ddflags & C_PROGRESS)) { - struct itimerval timer = { - .it_interval = { .tv_sec = 1, .tv_usec = 0 }, - .it_value = { .tv_sec = 1, .tv_usec = 0 }, - }; - setitimer(ITIMER_REAL, &timer, NULL); - } - if (clock_gettime(CLOCK_MONOTONIC, &st.start)) err(1, "clock_gettime"); } @@ -469,12 +466,10 @@ dd_in(void) in.dbp += in.dbrcnt; (*cfunc)(); - if (need_summary) { + if (need_summary) summary(); - } - if (need_progress) { + if (need_progress) progress(); - } } } Modified: head/bin/dd/extern.h ============================================================================== --- head/bin/dd/extern.h Wed Aug 15 19:28:48 2018 (r337864) +++ head/bin/dd/extern.h Wed Aug 15 19:46:13 2018 (r337865) @@ -45,10 +45,11 @@ void jcl(char **); void pos_in(void); void pos_out(void); double secs_elapsed(void); +void progress(void); void summary(void); void progress(void); +void sigalarm_handler(int); void siginfo_handler(int); -void sigalrm_handler(int); void terminate(int); void unblock(void); void unblock_close(void); Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Wed Aug 15 19:28:48 2018 (r337864) +++ head/bin/dd/misc.c Wed Aug 15 19:46:13 2018 (r337865) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -56,8 +57,6 @@ __FBSDID("$FreeBSD$"); #include "dd.h" #include "extern.h" -static int need_newline; - double secs_elapsed(void) { @@ -85,7 +84,7 @@ summary(void) if (ddflags & C_NOINFO) return; - if (need_newline && !need_summary) + if (ddflags & C_PROGRESS) fprintf(stderr, "\n"); secs = secs_elapsed(); @@ -110,22 +109,25 @@ summary(void) void progress(void) { + static int outlen; + char si[4 + 1 + 2 + 1]; /* 123 NUL */ + char iec[4 + 1 + 2 + 1]; /* 123 NUL */ + char persec[4 + 1 + 2 + 1]; /* 123 NUL */ + char *buf; double secs; - static int lastlen; - int len; secs = secs_elapsed(); - len = fprintf(stderr, - "\r%ju bytes transferred in %.0f secs (%.0f bytes/sec)", - st.bytes, secs, st.bytes / secs); - - if (len > 0) { - if (len < lastlen) - (void)fprintf(stderr, "%*s", len - lastlen, ""); - lastlen = len; - } - - need_newline = 1; + humanize_number(si, sizeof(si), (int64_t)st.bytes, "B", HN_AUTOSCALE, + HN_DECIMAL | HN_DIVISOR_1000); + humanize_number(iec, sizeof(iec), (int64_t)st.bytes, "B", HN_AUTOSCALE, + HN_DECIMAL | HN_IEC_PREFIXES); + humanize_number(persec, sizeof(iec), (int64_t)(st.bytes / secs), "B", + HN_AUTOSCALE, HN_DECIMAL | HN_DIVISOR_1000); + asprintf(&buf, " %'ju bytes (%s, %s) transferred %.3fs, %s/s", + (uintmax_t)st.bytes, si, iec, secs, persec); + outlen = fprintf(stderr, "%-*s\r", outlen, buf); + fflush(stderr); + free(buf); need_progress = 0; } @@ -139,7 +141,7 @@ siginfo_handler(int signo __unused) /* ARGSUSED */ void -sigalrm_handler(int signo __unused) +sigalarm_handler(int signo __unused) { need_progress = 1; Modified: head/bin/dd/position.c ============================================================================== --- head/bin/dd/position.c Wed Aug 15 19:28:48 2018 (r337864) +++ head/bin/dd/position.c Wed Aug 15 19:46:13 2018 (r337865) @@ -125,6 +125,8 @@ pos_in(void) --cnt; if (need_summary) summary(); + if (need_progress) + progress(); continue; } From owner-svn-src-all@freebsd.org Wed Aug 15 19:46: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 3328C106E58E; Wed, 15 Aug 2018 19:46:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 D02AE77C84; Wed, 15 Aug 2018 19:46:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [51.52.172.98]) by mail.baldwin.cx (Postfix) with ESMTPSA id E252910B476; Wed, 15 Aug 2018 15:46:25 -0400 (EDT) Subject: Re: svn commit: r337624 - in head: etc sbin/sysctl To: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808111328.w7BDS3UH021653@repo.freebsd.org> From: John Baldwin Message-ID: <48297a0e-8d79-d22d-3123-eecf37c0325b@FreeBSD.org> Date: Wed, 15 Aug 2018 20:46:25 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808111328.w7BDS3UH021653@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 15 Aug 2018 15:46:26 -0400 (EDT) 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.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 19:46:27 -0000 On 8/11/18 2:28 PM, Brad Davis wrote: > Author: brd > Date: Sat Aug 11 13:28:03 2018 > New Revision: 337624 > URL: https://svnweb.freebsd.org/changeset/base/337624 > > Log: > Move sysctl.conf to sbin/sysctl/ and switch to CONFS. > > This helps with pkgbase to tag this config file as a config file. > > Approved by: allanjude (mentor), will (mentor) > Differential Revision: https://reviews.freebsd.org/D16559 This one is kind of odd because sysctl itself doesn't natively use it, instead /etc/rc.d/sysctl does. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Aug 15 19:55: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 6CA1E106E83A; Wed, 15 Aug 2018 19:55:04 +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 ED57C7818C; Wed, 15 Aug 2018 19:55:03 +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 w7FJt2CV049461; Wed, 15 Aug 2018 12:55:02 -0700 (PDT) (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 w7FJt2Bk049460; Wed, 15 Aug 2018 12:55:02 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808151955.w7FJt2Bk049460@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: To: Kyle Evans Date: Wed, 15 Aug 2018 12:55:02 -0700 (PDT) CC: "Rodney W. Grimes" , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 19:55:04 -0000 > On Wed, Aug 15, 2018 at 2:34 PM, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> On Wed, Aug 15, 2018 at 12:43 PM, Rodney W. Grimes > >> wrote: > >> > > >> > From the Linux man page at: http://man7.org/linux/man-pages/man1/ls.1.html > >> > > >> > Using color to distinguish file types is disabled both by default and > >> > with --color=never. With --color=auto, ls emits color codes only > >> > when standard output is connected to a terminal. The LS_COLORS > >> > environment variable can change the settings. Use the dircolors > >> > command to set it. > >> > > >> > Um, so by default we should not be doing any colour... and we are... > >> > > >> > >> I don't recall making any argument that we're trying to match GNU > >> ls(1) behavior. Furthermore, again, we aren't doing any color by > >> default- only when the COLORTERM environment variable is set. > > > > So we are intentially being different? > > > > No, we are not intentionally being different. See: the next paragraph, > where I described that we've now-historically been honoring an > environment variable for this and have simply added a more standard > name for this variable. And one that is set by default many more places than the one that had been set before, changing behavior people have been seeing for a long time, and some of those people did not expect that, nor seem to want it either. > > >> > >> ls(1) on FreeBSD historically honors -an- environment variable for > >> enabling color. > > > > Short history, long history it had no color support at all. > > Color support in ls(1) is now old enough to drink having been > introduced in 2000- I think that's long enough to call it > "historically" here in 2018. ok, but for 25 years that ls has output in b&w even in a colour terminal unless I took action to make it color output. > >> This environment variable is CLICOLOR. This commit > >> switched the environment variable honored to the more-standard > >> COLORTERM that is honored in other software and set by terminals that > >> are generally expected to be used with color. > >> > >> I'm writing an UPDATING entry for this now to notify these users that > >> they should remove COLORTERM from their environment if they do not, in > >> fact, want a colored terminal. > > > > Is that the only way to turn this off? > > That may not be desired either. > > Atleast GNU ls allows me to force it off on command invocation > > with --color=never, do we have an equivelent? > > > > Sure- it gets turned off the same way it got turned on. =) Well, it now gets turned on when it was not turned on before, and as is I now have to completly decolor to decolor ls(1), I have no easy knob to turn off colorls only. > I'm > certainly not averse to adding a --color long option, and will do so > when I find the time (later today, most likely). That would help, atleast the annoyed can alias ls ls --color=never. NB: from the GNU ls documentation there is a significant performance impact with having colorls turned on as you now have to stat every file in a directory listing. Is this also true of the BSD colorls? > Thanks, > Kyle Evans -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 20:18: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 879AF106EF8F; Wed, 15 Aug 2018 20:18:23 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A7BC790E4; Wed, 15 Aug 2018 20:18:23 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B72AF1728A; Wed, 15 Aug 2018 20:18:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f43.google.com with SMTP id f18-v6so1770796lfc.2; Wed, 15 Aug 2018 13:18:22 -0700 (PDT) X-Gm-Message-State: AOUpUlFQxR1I2RqzAHqhv++l6sF595bDQDK+d9qSzYCzWeHTmBzransg t4iTZMY1tZKcQCiP5DRjTB3rzpQuYKBGkMwSbSc= X-Google-Smtp-Source: AA+uWPxDjd1q+eTbNlCJdpeIZ8b9K6JW8zsExnEsMHKg9hJGSo5OMszJsgVH9V2q9vUmZFyJ0K4pyhHshfuDaBmvqbA= X-Received: by 2002:a19:be54:: with SMTP id o81-v6mr1917068lff.31.1534364301247; Wed, 15 Aug 2018 13:18:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 13:18:00 -0700 (PDT) In-Reply-To: <201808151955.w7FJt2Bk049460@pdx.rh.CN85.dnsmgr.net> References: <201808151955.w7FJt2Bk049460@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Wed, 15 Aug 2018 15:18:00 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: "Rodney W. Grimes" Cc: Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:18:23 -0000 On Wed, Aug 15, 2018 at 2:55 PM, Rodney W. Grimes wrote: >> On Wed, Aug 15, 2018 at 2:34 PM, Rodney W. Grimes >> wrote: >> > [ Charset UTF-8 unsupported, converting... ] >> >> On Wed, Aug 15, 2018 at 12:43 PM, Rodney W. Grimes >> >> wrote: >> >> > >> >> > From the Linux man page at: http://man7.org/linux/man-pages/man1/ls.1.html >> >> > >> >> > Using color to distinguish file types is disabled both by default and >> >> > with --color=never. With --color=auto, ls emits color codes only >> >> > when standard output is connected to a terminal. The LS_COLORS >> >> > environment variable can change the settings. Use the dircolors >> >> > command to set it. >> >> > >> >> > Um, so by default we should not be doing any colour... and we are... >> >> > >> >> >> >> I don't recall making any argument that we're trying to match GNU >> >> ls(1) behavior. Furthermore, again, we aren't doing any color by >> >> default- only when the COLORTERM environment variable is set. >> > >> > So we are intentially being different? >> > >> >> No, we are not intentionally being different. See: the next paragraph, >> where I described that we've now-historically been honoring an >> environment variable for this and have simply added a more standard >> name for this variable. > > And one that is set by default many more places than the one that > had been set before, changing behavior people have been seeing for > a long time, and some of those people did not expect that, > nor seem to want it either. Will backing out the MFC and leaving this a 12.0 feature end this? =( Many changes we make fit the same same description that you just wrote, perhaps with "many many more places" replaced with "". Standardization is hard to argue against, leaving one knob to turn everything off or on and not having to have a profile full of: LSCOLORS=yes; export LSCOLORS GREPCOLORS=yes; export GREPCOLORS DPVCOLORS=yes; export DPVCOLORS ... I would hazard a guess that most people err to one side or the other: all the colors or none of the colors. >> >> >> >> >> ls(1) on FreeBSD historically honors -an- environment variable for >> >> enabling color. >> > >> > Short history, long history it had no color support at all. >> >> Color support in ls(1) is now old enough to drink having been >> introduced in 2000- I think that's long enough to call it >> "historically" here in 2018. > > ok, but for 25 years that ls has output in b&w even in > a colour terminal unless I took action to make it color output. And still, with a base FreeBSD install, you take action to make it color output. Some third party software claims COLORTERM for you, and you should be aware if this is the case. Not all color terminals will set COLORTERM for you. >> >> This environment variable is CLICOLOR. This commit >> >> switched the environment variable honored to the more-standard >> >> COLORTERM that is honored in other software and set by terminals that >> >> are generally expected to be used with color. >> >> >> >> I'm writing an UPDATING entry for this now to notify these users that >> >> they should remove COLORTERM from their environment if they do not, in >> >> fact, want a colored terminal. >> > >> > Is that the only way to turn this off? >> > That may not be desired either. >> > Atleast GNU ls allows me to force it off on command invocation >> > with --color=never, do we have an equivelent? >> > >> >> Sure- it gets turned off the same way it got turned on. =) > > Well, it now gets turned on when it was not turned on before, > and as is I now have to completly decolor to decolor ls(1), > I have no easy knob to turn off colorls only. > >> I'm >> certainly not averse to adding a --color long option, and will do so >> when I find the time (later today, most likely). > > That would help, atleast the annoyed can alias ls ls --color=never. > Ok > NB: from the GNU ls documentation there is a significant performance > impact with having colorls turned on as you now have to stat every > file in a directory listing. Is this also true of the BSD colorls? > No clue. From owner-svn-src-all@freebsd.org Wed Aug 15 20:23: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 270A1106F2BE; Wed, 15 Aug 2018 20:23:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFF90795BE; Wed, 15 Aug 2018 20:23:10 +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 B132776B7; Wed, 15 Aug 2018 20:23:10 +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 w7FKNAOF055262; Wed, 15 Aug 2018 20:23:10 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FKN9LL055254; Wed, 15 Aug 2018 20:23:09 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808152023.w7FKN9LL055254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 15 Aug 2018 20:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337866 - in head/sys: net netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: net netinet netinet6 X-SVN-Commit-Revision: 337866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:23:11 -0000 Author: mmacy Date: Wed Aug 15 20:23:08 2018 New Revision: 337866 URL: https://svnweb.freebsd.org/changeset/base/337866 Log: Fix in6_multi double free This is actually several different bugs: - The code is not designed to handle inpcb deletion after interface deletion - add reference for inpcb membership - The multicast address has to be removed from interface lists when the refcount goes to zero OR when the interface goes away - decouple list disconnect from refcount (v6 only for now) - ifmultiaddr can exist past being on interface lists - add flag for tracking whether or not it's enqueued - deferring freeing moptions makes the incpb cleanup code simpler but opens the door wider still to races - call inp_gcmoptions synchronously after dropping the the inpcb lock Fundamentally multicast needs a rewrite - but keep applying band-aids for now. Tested by: kp Reported by: novel, kp, lwhsu Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_carp.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_var.h head/sys/netinet6/mld6.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Aug 15 19:46:13 2018 (r337865) +++ head/sys/net/if.c Wed Aug 15 20:23:08 2018 (r337866) @@ -3545,6 +3545,7 @@ if_addmulti(struct ifnet *ifp, struct sockaddr *sa, error = ENOMEM; goto free_llsa_out; } + ll_ifma->ifma_flags |= IFMA_F_ENQUEUED; CK_STAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ll_ifma, ifma_link); } else @@ -3557,6 +3558,7 @@ if_addmulti(struct ifnet *ifp, struct sockaddr *sa, * referenced link layer address. Add the primary address to the * ifnet address list. */ + ifma->ifma_flags |= IFMA_F_ENQUEUED; CK_STAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link); if (retifma != NULL) @@ -3757,9 +3759,10 @@ if_delmulti_locked(struct ifnet *ifp, struct ifmultiad if (--ifma->ifma_refcount > 0) return 0; - if (ifp != NULL && detaching == 0) + if (ifp != NULL && detaching == 0 && (ifma->ifma_flags & IFMA_F_ENQUEUED)) { CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifmultiaddr, ifma_link); - + ifma->ifma_flags &= ~IFMA_F_ENQUEUED; + } /* * If this ifma is a network-layer ifma, a link-layer ifma may * have been associated with it. Release it first if so. @@ -3772,8 +3775,11 @@ if_delmulti_locked(struct ifnet *ifp, struct ifmultiad ll_ifma->ifma_ifp = NULL; /* XXX */ if (--ll_ifma->ifma_refcount == 0) { if (ifp != NULL) { - CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, - ifma_link); + if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED) { + CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, + ifma_link); + ifma->ifma_flags &= ~IFMA_F_ENQUEUED; + } } if_freemulti(ll_ifma); } Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Aug 15 19:46:13 2018 (r337865) +++ head/sys/net/if_var.h Wed Aug 15 20:23:08 2018 (r337866) @@ -548,12 +548,14 @@ void ifa_ref(struct ifaddr *ifa); * Multicast address structure. This is analogous to the ifaddr * structure except that it keeps track of multicast addresses. */ +#define IFMA_F_ENQUEUED 0x1 struct ifmultiaddr { CK_STAILQ_ENTRY(ifmultiaddr) ifma_link; /* queue macro glue */ struct sockaddr *ifma_addr; /* address this membership is for */ struct sockaddr *ifma_lladdr; /* link-layer translation, if any */ struct ifnet *ifma_ifp; /* back-pointer to interface */ u_int ifma_refcount; /* reference count */ + int ifma_flags; void *ifma_protospec; /* protocol-specific state, if any */ struct ifmultiaddr *ifma_llifma; /* pointer to ifma for ifma_lladdr */ struct epoch_context ifma_epoch_ctx; Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Wed Aug 15 19:46:13 2018 (r337865) +++ head/sys/netinet/in_mcast.c Wed Aug 15 20:23:08 2018 (r337866) @@ -263,7 +263,10 @@ inm_disconnect(struct in_multi *inm) ifma = inm->inm_ifma; if_ref(ifp); - CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifmultiaddr, ifma_link); + if (ifma->ifma_flags & IFMA_F_ENQUEUED) { + CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifmultiaddr, ifma_link); + ifma->ifma_flags &= ~IFMA_F_ENQUEUED; + } MCDPRINTF("removed ifma: %p from %s\n", ifma, ifp->if_xname); if ((ll_ifma = ifma->ifma_llifma) != NULL) { MPASS(ifma != ll_ifma); @@ -271,7 +274,10 @@ inm_disconnect(struct in_multi *inm) MPASS(ll_ifma->ifma_llifma == NULL); MPASS(ll_ifma->ifma_ifp == ifp); if (--ll_ifma->ifma_refcount == 0) { - CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, ifma_link); + if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED) { + CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, ifma_link); + ifma->ifma_flags &= ~IFMA_F_ENQUEUED; + } MCDPRINTF("removed ll_ifma: %p from %s\n", ll_ifma, ifp->if_xname); if_freemulti(ll_ifma); ifma_restart = true; @@ -1668,16 +1674,13 @@ inp_findmoptions(struct inpcb *inp) } static void -inp_gcmoptions(epoch_context_t ctx) +inp_gcmoptions(struct ip_moptions *imo) { - struct ip_moptions *imo; struct in_mfilter *imf; struct in_multi *inm; struct ifnet *ifp; size_t idx, nmships; - imo = __containerof(ctx, struct ip_moptions, imo_epoch_ctx); - nmships = imo->imo_num_memberships; for (idx = 0; idx < nmships; ++idx) { imf = imo->imo_mfilters ? &imo->imo_mfilters[idx] : NULL; @@ -1713,7 +1716,7 @@ inp_freemoptions(struct ip_moptions *imo) { if (imo == NULL) return; - epoch_call(net_epoch_preempt, &imo->imo_epoch_ctx, inp_gcmoptions); + inp_gcmoptions(imo); } /* @@ -2265,7 +2268,8 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt __func__); IN_MULTI_LIST_UNLOCK(); goto out_imo_free; - } + } + inm_acquire(inm); imo->imo_membership[idx] = inm; } else { CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); @@ -2305,6 +2309,12 @@ out_in_multi_locked: out_imo_free: if (error && is_new) { + inm = imo->imo_membership[idx]; + if (inm != NULL) { + IN_MULTI_LIST_LOCK(); + inm_release_deferred(inm); + IN_MULTI_LIST_UNLOCK(); + } imo->imo_membership[idx] = NULL; --imo->imo_num_memberships; } Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Aug 15 19:46:13 2018 (r337865) +++ head/sys/netinet/in_pcb.c Wed Aug 15 20:23:08 2018 (r337866) @@ -1578,7 +1578,7 @@ in_pcbfree_deferred(epoch_context_t ctx) INP_WLOCK(inp); #ifdef INET - inp_freemoptions(inp->inp_moptions); + struct ip_moptions *imo = inp->inp_moptions; inp->inp_moptions = NULL; #endif /* XXXRW: Do as much as possible here. */ @@ -1587,9 +1587,10 @@ in_pcbfree_deferred(epoch_context_t ctx) ipsec_delete_pcbpolicy(inp); #endif #ifdef INET6 + struct ip6_moptions *im6o = NULL; if (inp->inp_vflag & INP_IPV6PROTO) { ip6_freepcbopts(inp->in6p_outputopts); - ip6_freemoptions(inp->in6p_moptions); + im6o = inp->in6p_moptions; inp->in6p_moptions = NULL; } #endif @@ -1602,6 +1603,12 @@ in_pcbfree_deferred(epoch_context_t ctx) #endif released = in_pcbrele_wlocked(inp); MPASS(released); +#ifdef INET6 + ip6_freemoptions(im6o); +#endif +#ifdef INET + inp_freemoptions(imo); +#endif } /* Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Aug 15 19:46:13 2018 (r337865) +++ head/sys/netinet/ip_carp.c Wed Aug 15 20:23:08 2018 (r337866) @@ -1423,6 +1423,7 @@ carp_multicast_setup(struct carp_if *cif, sa_family_t free(im6o->im6o_membership, M_CARP); break; } + in6m_acquire(in6m); im6o->im6o_membership[0] = in6m; im6o->im6o_num_memberships++; @@ -1444,6 +1445,7 @@ carp_multicast_setup(struct carp_if *cif, sa_family_t free(im6o->im6o_membership, M_CARP); break; } + in6m_acquire(in6m); im6o->im6o_membership[1] = in6m; im6o->im6o_num_memberships++; break; Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Wed Aug 15 19:46:13 2018 (r337865) +++ head/sys/netinet6/in6_ifattach.c Wed Aug 15 20:23:08 2018 (r337866) @@ -863,6 +863,7 @@ in6_purgemaddrs(struct ifnet *ifp) ifma->ifma_protospec == NULL) continue; inm = (struct in6_multi *)ifma->ifma_protospec; + in6m_disconnect(inm); in6m_rele_locked(&purgeinms, inm); if (__predict_false(ifma6_restart)) { ifma6_restart = false; Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Wed Aug 15 19:46:13 2018 (r337865) +++ head/sys/netinet6/in6_mcast.c Wed Aug 15 20:23:08 2018 (r337866) @@ -538,6 +538,8 @@ in6m_release(struct in6_multi *inm) CTR2(KTR_MLD, "%s: purging ifma %p", __func__, ifma); KASSERT(ifma->ifma_protospec == NULL, ("%s: ifma_protospec != NULL", __func__)); + if (ifp == NULL) + ifp = ifma->ifma_ifp; if (ifp != NULL) { CURVNET_SET(ifp->if_vnet); @@ -592,11 +594,20 @@ in6m_disconnect(struct in6_multi *inm) struct ifmultiaddr *ifma, *ll_ifma; ifp = inm->in6m_ifp; + + if (ifp == NULL) + return; + inm->in6m_ifp = NULL; IF_ADDR_WLOCK_ASSERT(ifp); ifma = inm->in6m_ifma; + if (ifma == NULL) + return; if_ref(ifp); - CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifmultiaddr, ifma_link); + if (ifma->ifma_flags & IFMA_F_ENQUEUED) { + CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifmultiaddr, ifma_link); + ifma->ifma_flags &= ~IFMA_F_ENQUEUED; + } MCDPRINTF("removed ifma: %p from %s\n", ifma, ifp->if_xname); if ((ll_ifma = ifma->ifma_llifma) != NULL) { MPASS(ifma != ll_ifma); @@ -605,7 +616,10 @@ in6m_disconnect(struct in6_multi *inm) MPASS(ll_ifma->ifma_ifp == ifp); if (--ll_ifma->ifma_refcount == 0) { ifma6_restart = true; - CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, ifma_link); + if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED) { + CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, ifma_link); + ifma->ifma_flags &= ~IFMA_F_ENQUEUED; + } MCDPRINTF("removed ll_ifma: %p from %s\n", ll_ifma, ifp->if_xname); if_freemulti(ll_ifma); } @@ -632,7 +646,7 @@ in6m_release_deferred(struct in6_multi *inm) IN6_MULTI_LIST_LOCK_ASSERT(); KASSERT(inm->in6m_refcount > 0, ("refcount == %d inm: %p", inm->in6m_refcount, inm)); if (--inm->in6m_refcount == 0) { - in6m_disconnect(inm); + MPASS(inm->in6m_ifp == NULL); SLIST_INIT(&tmp); inm->in6m_ifma->ifma_protospec = NULL; MPASS(inm->in6m_ifma->ifma_llifma == NULL); @@ -1310,6 +1324,7 @@ out_in6m_release: break; } } + in6m_disconnect(inm); in6m_release_deferred(inm); IF_ADDR_RUNLOCK(ifp); } else { @@ -1389,13 +1404,17 @@ in6_leavegroup_locked(struct in6_multi *inm, /*const*/ KASSERT(error == 0, ("%s: failed to merge inm state", __func__)); CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); + error = 0; + if (ifp) + error = mld_change_state(inm, 0); if (error) CTR1(KTR_MLD, "%s: failed mld downcall", __func__); CTR2(KTR_MLD, "%s: dropping ref on %p", __func__, inm); if (ifp) IF_ADDR_WLOCK(ifp); + if (inm->in6m_refcount == 1 && inm->in6m_ifp != NULL) + in6m_disconnect(inm); in6m_release_deferred(inm); if (ifp) IF_ADDR_WUNLOCK(ifp); @@ -1629,16 +1648,13 @@ in6p_findmoptions(struct inpcb *inp) */ static void -inp_gcmoptions(epoch_context_t ctx) +inp_gcmoptions(struct ip6_moptions *imo) { - struct ip6_moptions *imo; struct in6_mfilter *imf; struct in6_multi *inm; struct ifnet *ifp; size_t idx, nmships; - imo = __containerof(ctx, struct ip6_moptions, imo6_epoch_ctx); - nmships = imo->im6o_num_memberships; for (idx = 0; idx < nmships; ++idx) { imf = imo->im6o_mfilters ? &imo->im6o_mfilters[idx] : NULL; @@ -1668,7 +1684,7 @@ ip6_freemoptions(struct ip6_moptions *imo) { if (imo == NULL) return; - epoch_call(net_epoch_preempt, &imo->imo6_epoch_ctx, inp_gcmoptions); + inp_gcmoptions(imo); } /* @@ -2162,6 +2178,7 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop IN6_MULTI_UNLOCK(); goto out_im6o_free; } + in6m_acquire(inm); imo->im6o_membership[idx] = inm; } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); @@ -2196,6 +2213,12 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop out_im6o_free: if (error && is_new) { + inm = imo->im6o_membership[idx]; + if (inm != NULL) { + IN6_MULTI_LIST_LOCK(); + in6m_release_deferred(inm); + IN6_MULTI_LIST_UNLOCK(); + } imo->im6o_membership[idx] = NULL; --imo->im6o_num_memberships; } Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Wed Aug 15 19:46:13 2018 (r337865) +++ head/sys/netinet6/in6_var.h Wed Aug 15 20:23:08 2018 (r337866) @@ -784,7 +784,7 @@ in6m_rele_locked(struct in6_multi_head *inmh, struct i IN6_MULTI_LIST_LOCK_ASSERT(); if (--inm->in6m_refcount == 0) { - in6m_disconnect(inm); + MPASS(inm->in6m_ifp == NULL); inm->in6m_ifma->ifma_protospec = NULL; MPASS(inm->in6m_ifma->ifma_llifma == NULL); SLIST_INSERT_HEAD(inmh, inm, in6m_nrele); Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Wed Aug 15 19:46:13 2018 (r337865) +++ head/sys/netinet6/mld6.c Wed Aug 15 20:23:08 2018 (r337866) @@ -557,6 +557,7 @@ mld_ifdetach(struct ifnet *ifp) continue; inm = (struct in6_multi *)ifma->ifma_protospec; if (inm->in6m_state == MLD_LEAVING_MEMBER) { + in6m_disconnect(inm); in6m_rele_locked(&inmh, inm); ifma->ifma_protospec = NULL; } @@ -1483,6 +1484,7 @@ mld_v1_process_group_timer(struct in6_multi_head *inmh case MLD_REPORTING_MEMBER: if (report_timer_expired) { inm->in6m_state = MLD_IDLE_MEMBER; + in6m_disconnect(inm); in6m_rele_locked(inmh, inm); } break; @@ -1607,6 +1609,7 @@ mld_v2_process_group_timers(struct in6_multi_head *inm if (inm->in6m_state == MLD_LEAVING_MEMBER && inm->in6m_scrv == 0) { inm->in6m_state = MLD_NOT_MEMBER; + in6m_disconnect(inm); in6m_rele_locked(inmh, inm); } } @@ -1697,6 +1700,7 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) * version, we need to release the final * reference held for issuing the INCLUDE {}. */ + in6m_disconnect(inm); in6m_rele_locked(&inmh, inm); ifma->ifma_protospec = NULL; /* FALLTHROUGH */ @@ -1893,16 +1897,15 @@ mld_change_state(struct in6_multi *inm, const int dela */ KASSERT(inm->in6m_ifma != NULL, ("%s: no ifma", __func__)); ifp = inm->in6m_ifma->ifma_ifp; - if (ifp != NULL) { - /* - * Sanity check that netinet6's notion of ifp is the - * same as net's. - */ - KASSERT(inm->in6m_ifp == ifp, ("%s: bad ifp", __func__)); - } + if (ifp == NULL) + return (0); + /* + * Sanity check that netinet6's notion of ifp is the + * same as net's. + */ + KASSERT(inm->in6m_ifp == ifp, ("%s: bad ifp", __func__)); MLD_LOCK(); - mli = MLD_IFINFO(ifp); KASSERT(mli != NULL, ("%s: no mld_ifsoftc for ifp %p", __func__, ifp)); @@ -1996,9 +1999,9 @@ mld_initial_join(struct in6_multi *inm, struct mld_ifs * group around for the final INCLUDE {} enqueue. */ if (mli->mli_version == MLD_VERSION_2 && - inm->in6m_state == MLD_LEAVING_MEMBER) - in6m_release_deferred(inm); - + inm->in6m_state == MLD_LEAVING_MEMBER) { + inm->in6m_refcount--; + } inm->in6m_state = MLD_REPORTING_MEMBER; switch (mli->mli_version) { From owner-svn-src-all@freebsd.org Wed Aug 15 20:23: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 B6B7F106F2FF; Wed, 15 Aug 2018 20:23:18 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57C4979680; Wed, 15 Aug 2018 20:23:18 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04E3176B8; Wed, 15 Aug 2018 20:23:17 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FKNHxN055320; Wed, 15 Aug 2018 20:23:17 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FKNH4u055319; Wed, 15 Aug 2018 20:23:17 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808152023.w7FKNH4u055319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Aug 2018 20:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337867 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 337867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:23:18 -0000 Author: jamie Date: Wed Aug 15 20:23:17 2018 New Revision: 337867 URL: https://svnweb.freebsd.org/changeset/base/337867 Log: Don't let clobber jailparam values when checking for modification of init-only parameters. Compare string parameter values with strncmp, not memcmp. PR: 230487 Reported by: Jason Mader MFC after: 3 days Modified: head/usr.sbin/jail/jail.c Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Wed Aug 15 20:23:08 2018 (r337866) +++ head/usr.sbin/jail/jail.c Wed Aug 15 20:23:17 2018 (r337867) @@ -803,8 +803,10 @@ rdtun_params(struct cfjail *j, int dofail) exit(1); } for (jp = j->jp; jp < j->jp + j->njp; jp++) - if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) + if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { *++rtjp = *jp; + rtjp->jp_value = NULL; + } rval = 0; if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { @@ -815,8 +817,11 @@ rdtun_params(struct cfjail *j, int dofail) jp->jp_valuelen == 0 && *(int *)jp->jp_value) && !(rtjp->jp_valuelen == jp->jp_valuelen && - !memcmp(rtjp->jp_value, jp->jp_value, - jp->jp_valuelen))) { + !((jp->jp_ctltype & CTLTYPE) == + CTLTYPE_STRING ? strncmp(rtjp->jp_value, + jp->jp_value, jp->jp_valuelen) : + memcmp(rtjp->jp_value, jp->jp_value, + jp->jp_valuelen)))) { if (dofail) { jail_warnx(j, "%s cannot be " "changed after creation", From owner-svn-src-all@freebsd.org Wed Aug 15 20:26:25 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 B122E106F41E; Wed, 15 Aug 2018 20:26:25 +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 153047990B; Wed, 15 Aug 2018 20:26:24 +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 w7FKQG8g049628; Wed, 15 Aug 2018 13:26:16 -0700 (PDT) (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 w7FKQGBN049627; Wed, 15 Aug 2018 13:26:16 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808152026.w7FKQGBN049627@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: To: Kyle Evans Date: Wed, 15 Aug 2018 13:26:16 -0700 (PDT) CC: "Rodney W. Grimes" , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:26:25 -0000 [ Charset UTF-8 unsupported, converting... ] > On Wed, Aug 15, 2018 at 2:55 PM, Rodney W. Grimes > wrote: > >> On Wed, Aug 15, 2018 at 2:34 PM, Rodney W. Grimes > >> wrote: > >> > [ Charset UTF-8 unsupported, converting... ] > >> >> On Wed, Aug 15, 2018 at 12:43 PM, Rodney W. Grimes > >> >> wrote: > >> >> > > >> >> > From the Linux man page at: http://man7.org/linux/man-pages/man1/ls.1.html > >> >> > > >> >> > Using color to distinguish file types is disabled both by default and > >> >> > with --color=never. With --color=auto, ls emits color codes only > >> >> > when standard output is connected to a terminal. The LS_COLORS > >> >> > environment variable can change the settings. Use the dircolors > >> >> > command to set it. > >> >> > > >> >> > Um, so by default we should not be doing any colour... and we are... > >> >> > > >> >> > >> >> I don't recall making any argument that we're trying to match GNU > >> >> ls(1) behavior. Furthermore, again, we aren't doing any color by > >> >> default- only when the COLORTERM environment variable is set. > >> > > >> > So we are intentially being different? > >> > > >> > >> No, we are not intentionally being different. See: the next paragraph, > >> where I described that we've now-historically been honoring an > >> environment variable for this and have simply added a more standard > >> name for this variable. > > > > And one that is set by default many more places than the one that > > had been set before, changing behavior people have been seeing for > > a long time, and some of those people did not expect that, > > nor seem to want it either. > > Will backing out the MFC and leaving this a 12.0 feature end this? =( Sadly no, as the person responded with that reaction when they installed 12.0-ALPHA :-(. > Many changes we make fit the same same description that you just > wrote, perhaps with "many many more places" replaced with "". > Standardization is hard to argue against, leaving one knob to turn > everything off or on and not having to have a profile full of: > > LSCOLORS=yes; export LSCOLORS > GREPCOLORS=yes; export GREPCOLORS > DPVCOLORS=yes; export DPVCOLORS > ... > > I would hazard a guess that most people err to one side or the other: > all the colors or none of the colors. Yes, and probably those people have figured out how to turn on all the colour stuff, so this has little to no effect on them, it does however effect the people who have intentionally turned off colors, it now suddenly pops on, and they are now having to do something like your list above to disable more and more color things. It is a double edge sword, I can see neither side is right nor wrong, its just a mess. > >> >> ls(1) on FreeBSD historically honors -an- environment variable for > >> >> enabling color. > >> > > >> > Short history, long history it had no color support at all. > >> > >> Color support in ls(1) is now old enough to drink having been > >> introduced in 2000- I think that's long enough to call it > >> "historically" here in 2018. > > > > ok, but for 25 years that ls has output in b&w even in > > a colour terminal unless I took action to make it color output. > > And still, with a base FreeBSD install, you take action to make it > color output. Some third party software claims COLORTERM for you, and > you should be aware if this is the case. Not all color terminals will > set COLORTERM for you. > > >> >> This environment variable is CLICOLOR. This commit > >> >> switched the environment variable honored to the more-standard > >> >> COLORTERM that is honored in other software and set by terminals that > >> >> are generally expected to be used with color. > >> >> > >> >> I'm writing an UPDATING entry for this now to notify these users that > >> >> they should remove COLORTERM from their environment if they do not, in > >> >> fact, want a colored terminal. > >> > > >> > Is that the only way to turn this off? > >> > That may not be desired either. > >> > Atleast GNU ls allows me to force it off on command invocation > >> > with --color=never, do we have an equivelent? > >> > > >> > >> Sure- it gets turned off the same way it got turned on. =) > > > > Well, it now gets turned on when it was not turned on before, > > and as is I now have to completly decolor to decolor ls(1), > > I have no easy knob to turn off colorls only. > > > >> I'm > >> certainly not averse to adding a --color long option, and will do so > >> when I find the time (later today, most likely). > > > > That would help, atleast the annoyed can alias ls ls --color=never. > > > > Ok > > > NB: from the GNU ls documentation there is a significant performance > > impact with having colorls turned on as you now have to stat every > > file in a directory listing. Is this also true of the BSD colorls? > > > > No clue. We should probalby find out and document that. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 20:29: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 B4D9B106F548 for ; Wed, 15 Aug 2018 20:29:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FCCD79B46 for ; Wed, 15 Aug 2018 20:29:06 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: d5f616cb-a0c9-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id d5f616cb-a0c9-11e8-93fa-f3ebd9db2b94; Wed, 15 Aug 2018 20:28:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7FKSvXN075864; Wed, 15 Aug 2018 14:28:57 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534364937.1466.11.camel@freebsd.org> Subject: Re: svn commit: r337826 - stable/11/bin/ls From: Ian Lepore To: rgrimes@freebsd.org, Kyle Evans Cc: Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@freebsd.org Date: Wed, 15 Aug 2018 14:28:57 -0600 In-Reply-To: <201808152026.w7FKQGBN049627@pdx.rh.CN85.dnsmgr.net> References: <201808152026.w7FKQGBN049627@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:29:06 -0000 On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: > >  > > Will backing out the MFC and leaving this a 12.0 feature end this? > =( > > Sadly no, as the person responded with that reaction when > they installed 12.0-ALPHA :-(. So one whiner can demand of the project that any new feature be removed before a new release is made? -- Ian From owner-svn-src-all@freebsd.org Wed Aug 15 20:31: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 8DB97106F716; Wed, 15 Aug 2018 20:31:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40E8D79DCE; Wed, 15 Aug 2018 20:31:12 +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 233537815; Wed, 15 Aug 2018 20:31:12 +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 w7FKVC0B058678; Wed, 15 Aug 2018 20:31:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FKVCVa058677; Wed, 15 Aug 2018 20:31:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808152031.w7FKVCVa058677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 15 Aug 2018 20:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337868 - head/stand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 337868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:31:12 -0000 Author: imp Date: Wed Aug 15 20:31:11 2018 New Revision: 337868 URL: https://svnweb.freebsd.org/changeset/base/337868 Log: stand: Use -Oz/-Os for all loader/stand builds. While we're not super size constrained, the x86 BIOS /boot/loader has to be less than about 520k-530k to be reliable. The LUA loader is at this size today. -Oz saves 15-20% on the size, keeping us safely small enough (comparable to where we were with the 4th loader). This will also help with sjg's work on bringing in bearssl, though we may again be looking for space in the LUA loader. Size table for clang 6.0.0: default -O1 -Os -Oz 4th 442368 417792 389120 376832 lua 524288 479232 446464 430080 Tested by: kevans91@ (ubldr on armv7), dhw@ (loader on amdy64) Differential Revision: https://reviews.freebsd.org/D16724 Modified: head/stand/defs.mk Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Wed Aug 15 20:23:17 2018 (r337867) +++ head/stand/defs.mk Wed Aug 15 20:31:11 2018 (r337868) @@ -53,7 +53,12 @@ CFLAGS+= -I${SASRC} -D_STANDALONE CFLAGS+= -I${SYSDIR} # Spike the floating point interfaces CFLAGS+= -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface - +# Slim down the image. This saves about 15% in size with clang 6 on x86 +# Our most constrained /boot/loader env is BIOS booting on x86, where +# our text + data + BTX have to fit into 640k below the ISA hole. +# Experience has shown that problems arise between ~520k to ~530k. +CFLAGS.clang+= -Oz +CFLAGS.gcc+= -Os # GELI Support, with backward compat hooks (mostly) .if defined(LOADER_NO_GELI_SUPPORT) From owner-svn-src-all@freebsd.org Wed Aug 15 20:32: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 04CE9106F9CB for ; Wed, 15 Aug 2018 20:32:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (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 14DBC7A174 for ; Wed, 15 Aug 2018 20:32:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id v26-v6so2073682iog.5 for ; Wed, 15 Aug 2018 13:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nEqTrIFP4brdYAS9pr7f2jo0HwUqN1ueqgl+/FyZ08Y=; b=OmzAuhd2frEt4sWqrAB/oVGYHWpcJ/iLeUc89tIcE3CvTEfqVr8VfrSfmxJlc0L8fc iTXXhbfRpjae7nbeDGm6pgfX6EzQv9K1u5j41Db/tYo1UdGFQ6MJE2sNG2g99PX24JuU rEkZTHnhLqHI4RMMeQIqG6Biy1+ZH3bSyKOeSILz02zbIrCndHkt6NyYsz2sergQ/mUF NvcOTckv2PASXrz9kfNGfH6lccUnccGXcctLlwQdCCP8ItkD8wMx+No6uis5doOA/th3 c7D6pEd7V6K4Cm8nuwZ9niYKpWtsiWP3Ys5hTxKV2KqzxuILiFIQDtKw3Bw5aDeCFMGW TFTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nEqTrIFP4brdYAS9pr7f2jo0HwUqN1ueqgl+/FyZ08Y=; b=oU3toGsTePuqCocXvVoWxlRuhUtvui/gM2c4IiO4TON/q4lBuT+6Tc/wUZO80SFfLv luWxqXYUUDZd+DEEZUZDso40uAOJXwt46sMKhS72cDdhGYMVcQZvEVDY5yvr16UQosXq nOhXeSWZP+xPWaHff2vAGiA15XnTbAyVbRnlvKw/Tkzd5YjV4v0EOhqPgWOWUYpPoBTR xUv7XzBsHsJNJ+25kP+XASkxLi9MqOI5mDqEQSaUy0tN25DXjxYra2yqkTCX/I6FKWt0 UnBpbLAD67OjDcjGvZaftqq3f5dafQpbADneYS5toadHfy671IACPmw8NAYE2Up0XjR5 jYhQ== X-Gm-Message-State: AOUpUlHx9v8qNquiIbwopPm/dZKk1SuDWucXiDUcr6vyAPOSmaReRszL XoTdA6itZ3zZ7i/rtVFOfTJbgMpQMVyDdQ8mwQ0MN/VgO1A= X-Google-Smtp-Source: AA+uWPxncpHGiEwp831C4wF6yWFMOxZXDAiRz3pGvCDJJsN5Oh0ERdXBeVyIgImSuOx04wShTtVujtfoTea4OQmx1zM= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr23588051ioa.168.1534365175174; Wed, 15 Aug 2018 13:32:55 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 13:32:54 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: <1534364937.1466.11.camel@freebsd.org> References: <201808152026.w7FKQGBN049627@pdx.rh.CN85.dnsmgr.net> <1534364937.1466.11.camel@freebsd.org> From: Warner Losh Date: Wed, 15 Aug 2018 14:32:54 -0600 X-Google-Sender-Auth: HC8ODzl_HqIKtLYPGOjY9_i_WJc Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: Ian Lepore Cc: "Rodney W. Grimes" , Kyle Evans , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:32:57 -0000 On Wed, Aug 15, 2018 at 2:28 PM, Ian Lepore wrote: > On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: > > > > > > Will backing out the MFC and leaving this a 12.0 feature end this? > > =( > > > > Sadly no, as the person responded with that reaction when > > they installed 12.0-ALPHA :-(. > > So one whiner can demand of the project that any new feature be removed > before a new release is made? > This is a good change. I don't see why people are so fussed about it... For people fighting colored environments a simple unsetenv COLORTERM seems to solve this problem no only on FreeBSD but for any other system they have access to... Warner From owner-svn-src-all@freebsd.org Wed Aug 15 20:34: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 EBC94106FACE; Wed, 15 Aug 2018 20:34:33 +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 6F9667A320; Wed, 15 Aug 2018 20:34:33 +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 w7FKYTm3049695; Wed, 15 Aug 2018 13:34:29 -0700 (PDT) (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 w7FKYTss049694; Wed, 15 Aug 2018 13:34:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808152034.w7FKYTss049694@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: <1534364937.1466.11.camel@freebsd.org> To: Ian Lepore Date: Wed, 15 Aug 2018 13:34:29 -0700 (PDT) CC: rgrimes@freebsd.org, Kyle Evans , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:34:34 -0000 > On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: > > >? > > > Will backing out the MFC and leaving this a 12.0 feature end this? > > =( > > > > Sadly no, as the person responded with that reaction when > > they installed 12.0-ALPHA :-(. > > So one whiner can demand of the project that any new feature be removed > before a new release is made? Saddly our sample size is never reflective of the user base, any and all feedback from ANY user, one or one hundred should be considered. Most people have come to the point that they wont even say anything any more cause the FreeBSD developer community just ignores them, and that I hear from many more than 1. I doubt very many of the "user" base is running with this patch in place yet. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 20:43: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 6CC69106FEF9 for ; Wed, 15 Aug 2018 20:43:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC7B27A906 for ; Wed, 15 Aug 2018 20:43:00 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: c40dc9b6-a0cb-11e8-aff6-0b9b8210da61 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id c40dc9b6-a0cb-11e8-aff6-0b9b8210da61; Wed, 15 Aug 2018 20:42:47 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7FKgkTh075908; Wed, 15 Aug 2018 14:42:46 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534365765.1466.15.camel@freebsd.org> Subject: Re: svn commit: r337826 - stable/11/bin/ls From: Ian Lepore To: rgrimes@freebsd.org Cc: Kyle Evans , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@freebsd.org Date: Wed, 15 Aug 2018 14:42:45 -0600 In-Reply-To: <201808152034.w7FKYTss049694@pdx.rh.CN85.dnsmgr.net> References: <201808152034.w7FKYTss049694@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:43:01 -0000 On Wed, 2018-08-15 at 13:34 -0700, Rodney W. Grimes wrote: > > > > On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: > > > > > > > > > > > ? > > > > Will backing out the MFC and leaving this a 12.0 feature end > > > > this? > > > =( > > > > > > Sadly no, as the person responded with that reaction when > > > they installed 12.0-ALPHA :-(. > > So one whiner can demand of the project that any new feature be > > removed > > before a new release is made? > Saddly our sample size is never reflective of the user base, > any and all feedback from ANY user, one or one hundred should > be considered.  Most people have come to the point that they > wont even say anything any more cause the FreeBSD developer > community just ignores them, and that I hear from many more > than 1. > > I doubt very many of the "user" base is running with this > patch in place yet. > > If citing invisible armies of supporters is acceptable, it appears that any single person can in fact demand removal of something. -- Ian From owner-svn-src-all@freebsd.org Wed Aug 15 20:48:16 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 7C56610700D0; Wed, 15 Aug 2018 20:48:16 +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 04F777AC0D; Wed, 15 Aug 2018 20:48:15 +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 w7FKmEus049853; Wed, 15 Aug 2018 13:48:14 -0700 (PDT) (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 w7FKmEDM049852; Wed, 15 Aug 2018 13:48:14 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808152048.w7FKmEDM049852@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: <1534365765.1466.15.camel@freebsd.org> To: Ian Lepore Date: Wed, 15 Aug 2018 13:48:14 -0700 (PDT) CC: rgrimes@freebsd.org, Kyle Evans , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:48:16 -0000 > On Wed, 2018-08-15 at 13:34 -0700, Rodney W. Grimes wrote: > > > > > > On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: > > > > > > > > > > > > > > ? > > > > > Will backing out the MFC and leaving this a 12.0 feature end > > > > > this? > > > > =( > > > > > > > > Sadly no, as the person responded with that reaction when > > > > they installed 12.0-ALPHA :-(. > > > So one whiner can demand of the project that any new feature be > > > removed > > > before a new release is made? > > Saddly our sample size is never reflective of the user base, > > any and all feedback from ANY user, one or one hundred should > > be considered.??Most people have come to the point that they > > wont even say anything any more cause the FreeBSD developer > > community just ignores them, and that I hear from many more > > than 1. > > > > I doubt very many of the "user" base is running with this > > patch in place yet. > > > > > > If citing invisible armies of supporters is acceptable, it appears that > any single person can in fact demand removal of something. No one is demanding any removal of anything here, your going very far off on that. I have how ever asked, and in one case Kyle has already said he would add --color= support, that we maintain some simbliance of compatibility with respect to knob turning. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 20:41:41 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 03539106FE76; Wed, 15 Aug 2018 20:41:41 +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 843D97A76E; Wed, 15 Aug 2018 20:41:40 +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 w7FKfbhL049765; Wed, 15 Aug 2018 13:41:37 -0700 (PDT) (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 w7FKfbCU049764; Wed, 15 Aug 2018 13:41:37 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808152041.w7FKfbCU049764@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: To: Warner Losh Date: Wed, 15 Aug 2018 13:41:37 -0700 (PDT) CC: Ian Lepore , "Rodney W. Grimes" , Kyle Evans , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@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-Mailman-Approved-At: Wed, 15 Aug 2018 20:50:15 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:41:41 -0000 > On Wed, Aug 15, 2018 at 2:28 PM, Ian Lepore wrote: > > > On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: > > > > > > > > Will backing out the MFC and leaving this a 12.0 feature end this? > > > =( > > > > > > Sadly no, as the person responded with that reaction when > > > they installed 12.0-ALPHA :-(. > > > > So one whiner can demand of the project that any new feature be removed > > before a new release is made? > > > > This is a good change. I don't see why people are so fussed about it... For > people fighting colored environments a simple unsetenv COLORTERM seems to > solve this problem no only on FreeBSD but for any other system they have > access to... This is exactly the dismissive attitude by FreeBSD developers that I was speaking to in my reply to Ian. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 15 20:50: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 ECFBB10702FE; Wed, 15 Aug 2018 20:50:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3D117AF4A; Wed, 15 Aug 2018 20:50:38 +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 861DF7A65; Wed, 15 Aug 2018 20:50:38 +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 w7FKochB065678; Wed, 15 Aug 2018 20:50:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FKocbn065677; Wed, 15 Aug 2018 20:50:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808152050.w7FKocbn065677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 15 Aug 2018 20:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337869 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 337869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 20:50:39 -0000 Author: kevans Date: Wed Aug 15 20:50:38 2018 New Revision: 337869 URL: https://svnweb.freebsd.org/changeset/base/337869 Log: dd(1): Kill off duplicate progress definition following r337865 Reported by: mmacy Modified: head/bin/dd/extern.h Modified: head/bin/dd/extern.h ============================================================================== --- head/bin/dd/extern.h Wed Aug 15 20:31:11 2018 (r337868) +++ head/bin/dd/extern.h Wed Aug 15 20:50:38 2018 (r337869) @@ -47,7 +47,6 @@ void pos_out(void); double secs_elapsed(void); void progress(void); void summary(void); -void progress(void); void sigalarm_handler(int); void siginfo_handler(int); void terminate(int); From owner-svn-src-all@freebsd.org Wed Aug 15 21:01: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 C2F041070942; Wed, 15 Aug 2018 21:01:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73E277B7F6; Wed, 15 Aug 2018 21:01:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55BDF7C6D; Wed, 15 Aug 2018 21:01:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FL1wDo074980; Wed, 15 Aug 2018 21:01:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FL1wIE074979; Wed, 15 Aug 2018 21:01:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201808152101.w7FL1wIE074979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 15 Aug 2018 21:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337870 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:01:58 -0000 Author: mav Date: Wed Aug 15 21:01:57 2018 New Revision: 337870 URL: https://svnweb.freebsd.org/changeset/base/337870 Log: Fix mismerge in r337196. ZoL did the same mistake, and fixed it with separate commit 863522b1f9: dsl_scan_scrub_cb: don't double-account non-embedded blocks We were doing count_block() twice inside this function, once unconditionally at the beginning (intended to catch the embedded block case) and once near the end after processing the block. The double-accounting caused the "zpool scrub" progress statistics in "zpool status" to climb from 0% to 200% instead of 0% to 100%, and showed double the I/O rate it was actually seeing. This was apparently a regression introduced in commit 00c405b4b5e8, which was an incorrect port of this OpenZFS commit: https://github.com/openzfs/openzfs/commit/d8a447a7 Reviewed by: Thomas Caputi Reviewed by: Matt Ahrens Reviewed-by: Brian Behlendorf Reviewed-by: George Melikov Signed-off-by: Steven Noonan Closes #7720 Closes #7738 Reported by: sef Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Aug 15 20:50:38 2018 (r337869) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Wed Aug 15 21:01:57 2018 (r337870) @@ -3555,12 +3555,12 @@ dsl_scan_scrub_cb(dsl_pool_t *dp, boolean_t needs_io; int zio_flags = ZIO_FLAG_SCAN_THREAD | ZIO_FLAG_RAW | ZIO_FLAG_CANFAIL; int d; - - count_block(scn, dp->dp_blkstats, bp); if (phys_birth <= scn->scn_phys.scn_min_txg || - phys_birth >= scn->scn_phys.scn_max_txg) + phys_birth >= scn->scn_phys.scn_max_txg) { + count_block(scn, dp->dp_blkstats, bp); return (0); + } /* Embedded BP's have phys_birth==0, so we reject them above. */ ASSERT(!BP_IS_EMBEDDED(bp)); From owner-svn-src-all@freebsd.org Wed Aug 15 21:13: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 64B251070F48; Wed, 15 Aug 2018 21:13:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 148C17C341; Wed, 15 Aug 2018 21:13:11 +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 EAC877F6D; Wed, 15 Aug 2018 21:13:10 +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 w7FLDAb1081034; Wed, 15 Aug 2018 21:13:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FLDALN081033; Wed, 15 Aug 2018 21:13:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808152113.w7FLDALN081033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 15 Aug 2018 21:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337871 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 337871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:13:11 -0000 Author: kevans Date: Wed Aug 15 21:13:10 2018 New Revision: 337871 URL: https://svnweb.freebsd.org/changeset/base/337871 Log: pkgfs_init: Initialize pkg new_package may not set *pp if it errors out, leaving pkg uninitialized. Reported by: GCC Modified: head/stand/libsa/pkgfs.c Modified: head/stand/libsa/pkgfs.c ============================================================================== --- head/stand/libsa/pkgfs.c Wed Aug 15 21:01:57 2018 (r337870) +++ head/stand/libsa/pkgfs.c Wed Aug 15 21:13:10 2018 (r337871) @@ -163,6 +163,7 @@ pkgfs_init(const char *pkgname, struct fs_ops *proto) struct package *pkg; int error, fd; + pkg = NULL; if (proto != &pkgfs_fsops) pkgfs_cleanup(); From owner-svn-src-all@freebsd.org Wed Aug 15 21:21: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 D46D51071311; Wed, 15 Aug 2018 21:21:17 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AE837CC31; Wed, 15 Aug 2018 21:21:17 +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 6C0BC7FB4; Wed, 15 Aug 2018 21:21:17 +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 w7FLLHKX084199; Wed, 15 Aug 2018 21:21:17 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FLLHLM084198; Wed, 15 Aug 2018 21:21:17 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808152121.w7FLLHLM084198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 15 Aug 2018 21:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337872 - 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: 337872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:21:18 -0000 Author: tsoome Date: Wed Aug 15 21:21:16 2018 New Revision: 337872 URL: https://svnweb.freebsd.org/changeset/base/337872 Log: libi386: remove BD_SUPPORT_FRAGS BD_SUPPORT_FRAGS is preprocessor knob to allow partial reads in bioscd/biosdisk level. However, we already have support for partial reads in bcache, and there is no need to have duplication via preprocessor controls. Note that bioscd/biosdisk interface is assumed to perform IO in 512B blocks, so the only translation we have to do is 512 <-> native block size. Differential Revision: https://reviews.freebsd.org/D16600 Modified: head/stand/i386/libi386/bioscd.c head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/bioscd.c ============================================================================== --- head/stand/i386/libi386/bioscd.c Wed Aug 15 21:13:10 2018 (r337871) +++ head/stand/i386/libi386/bioscd.c Wed Aug 15 21:21:16 2018 (r337872) @@ -258,15 +258,9 @@ bc_realstrategy(void *devdata, int rw, daddr_t dblk, s struct i386_devdesc *dev; int unit; int blks; -#ifdef BD_SUPPORT_FRAGS - char fragbuf[BIOSCD_SECSIZE]; - size_t fragsize; - fragsize = size % BIOSCD_SECSIZE; -#else if (size % BIOSCD_SECSIZE) return (EINVAL); -#endif if ((rw & F_MASK) != F_READ) return(EROFS); @@ -290,20 +284,6 @@ bc_realstrategy(void *devdata, int rw, daddr_t dblk, s return (0); } } -#ifdef BD_SUPPORT_FRAGS - DEBUG("frag read %d from %lld+%d to %p", - fragsize, dblk, blks, buf + (blks * BIOSCD_SECSIZE)); - if (fragsize && bc_read(unit, dblk + blks, 1, fragbuf) != 1) { - if (blks) { - if (rsize) - *rsize = blks * BIOSCD_SECSIZE; - return (0); - } - DEBUG("frag read error"); - return(EIO); - } - bcopy(fragbuf, buf + (blks * BIOSCD_SECSIZE), fragsize); -#endif if (rsize) *rsize = size; return (0); Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Wed Aug 15 21:13:10 2018 (r337871) +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 21:21:16 2018 (r337872) @@ -451,17 +451,11 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s struct disk_devdesc *dev = (struct disk_devdesc *)devdata; uint64_t disk_blocks; int blks, rc; -#ifdef BD_SUPPORT_FRAGS /* XXX: sector size */ - char fragbuf[BIOSDISK_SECSIZE]; - size_t fragsize; - fragsize = size % BIOSDISK_SECSIZE; -#else if (size % BD(dev).bd_sectorsize) { panic("bd_strategy: %d bytes I/O not multiple of block size", size); } -#endif DEBUG("open_disk %p", dev); @@ -520,15 +514,6 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s } return (EIO); } -#ifdef BD_SUPPORT_FRAGS /* XXX: sector size */ - DEBUG("bd_strategy: frag read %d from %d+%d to %p", - fragsize, dblk, blks, buf + (blks * BIOSDISK_SECSIZE)); - if (fragsize && bd_read(od, dblk + blks, 1, fragsize)) { - DEBUG("frag read error"); - return (EIO); - } - bcopy(fragbuf, buf + (blks * BIOSDISK_SECSIZE), fragsize); -#endif break; case F_WRITE : DEBUG("write %d from %lld to %p", blks, dblk, buf); @@ -537,12 +522,6 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s DEBUG("write error"); return (EIO); } -#ifdef BD_SUPPORT_FRAGS - if (fragsize) { - DEBUG("Attempted to write a frag"); - return (EIO); - } -#endif break; default: /* DO NOTHING */ From owner-svn-src-all@freebsd.org Wed Aug 15 21:22: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 1636B1071500; Wed, 15 Aug 2018 21:22:30 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF8837CF56; Wed, 15 Aug 2018 21:22:29 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5BCA717992; Wed, 15 Aug 2018 21:22:29 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f177.google.com with SMTP id p10-v6so2039725ljg.2; Wed, 15 Aug 2018 14:22:29 -0700 (PDT) X-Gm-Message-State: AOUpUlFITmvLGJdqoRsB9qtQ3o6+5cEjwXU4AyOhITEZTvRAfCm07AkU PWJ2xi3nkGjfH77ZB8xnXAXKfQjliJe6GE+6KC8= X-Google-Smtp-Source: AA+uWPzK0DpLSThGD1SG0G269Xf2JbOSIIsdDob0KihFlRfCjiFASFGch7wuRCFECoxJyuHTfFx1XtxNzX5O7PkDV/Y= X-Received: by 2002:a2e:498:: with SMTP id a24-v6mr20052188ljf.27.1534368147842; Wed, 15 Aug 2018 14:22:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 14:22:07 -0700 (PDT) In-Reply-To: <201808152031.w7FKVCVa058677@repo.freebsd.org> References: <201808152031.w7FKVCVa058677@repo.freebsd.org> From: Kyle Evans Date: Wed, 15 Aug 2018 16:22:07 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337868 - head/stand To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:22:30 -0000 On Wed, Aug 15, 2018 at 3:31 PM, Warner Losh wrote: > Author: imp > Date: Wed Aug 15 20:31:11 2018 > New Revision: 337868 > URL: https://svnweb.freebsd.org/changeset/base/337868 > > Log: > stand: Use -Oz/-Os for all loader/stand builds. > > While we're not super size constrained, the x86 BIOS /boot/loader has > to be less than about 520k-530k to be reliable. The LUA loader is at > this size today. -Oz saves 15-20% on the size, keeping us safely small > enough (comparable to where we were with the 4th loader). This will > also help with sjg's work on bringing in bearssl, though we may again > be looking for space in the LUA loader. > > Size table for clang 6.0.0: > default -O1 -Os -Oz > 4th 442368 417792 389120 376832 > lua 524288 479232 446464 430080 > > Tested by: kevans91@ (ubldr on armv7), dhw@ (loader on amdy64) > Differential Revision: https://reviews.freebsd.org/D16724 > This seems to have frustrated the MIPS build: --- ubldr --- /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function `block_map': /usr/src/stand/libsa/ufs.c:277: undefined reference to `__ashldi3' /usr/src/stand/libsa/ufs.c:277: relocation truncated to fit: R_MIPS_26 against `__ashldi3' /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function `buf_read_file': /usr/src/stand/libsa/ufs.c:402: undefined reference to `__ashrdi3' /usr/src/stand/libsa/ufs.c:402: relocation truncated to fit: R_MIPS_26 against `__ashrdi3' /usr/src/stand/libsa/ufs.c:403: undefined reference to `__ashldi3' /usr/src/stand/libsa/ufs.c:403: relocation truncated to fit: R_MIPS_26 against `__ashldi3' /usr/src/stand/libsa/ufs.c:418: undefined reference to `__ashldi3' /usr/src/stand/libsa/ufs.c:418: relocation truncated to fit: R_MIPS_26 against `__ashldi3' /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function `buf_write_file': /usr/src/stand/libsa/ufs.c:327: undefined reference to `__ashrdi3' /usr/src/stand/libsa/ufs.c:327: relocation truncated to fit: R_MIPS_26 against `__ashrdi3' /usr/src/stand/libsa/ufs.c:328: undefined reference to `__ashldi3' /usr/src/stand/libsa/ufs.c:328: relocation truncated to fit: R_MIPS_26 against `__ashldi3' /usr/src/stand/libsa/ufs.c:358: undefined reference to `__ashldi3' /usr/src/stand/libsa/ufs.c:358: relocation truncated to fit: R_MIPS_26 against `__ashldi3' /usr/src/stand/libsa/ufs.c:377: undefined reference to `__ashldi3' /usr/src/stand/libsa/ufs.c:377: relocation truncated to fit: R_MIPS_26 against `__ashldi3' /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function `read_inode': /usr/src/stand/libsa/ufs.c:166: undefined reference to `__ashldi3' /usr/src/stand/libsa/ufs.c:166: relocation truncated to fit: R_MIPS_26 against `__ashldi3' /usr/src/stand/libsa/ufs.c:166: undefined reference to `__ashldi3' /usr/src/stand/libsa/ufs.c:166: relocation truncated to fit: R_MIPS_26 against `__ashldi3' /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o):/usr/src/stand/libsa/ufs.c:638: more undefined references to `__ashldi3' follow /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function `ufs_open': /usr/src/stand/libsa/ufs.c:638: additional relocation overflows omitted from the output From owner-svn-src-all@freebsd.org Wed Aug 15 21:24: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 BC9B010715D7; Wed, 15 Aug 2018 21:24:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72C587D0EA; Wed, 15 Aug 2018 21:24:06 +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 3A2CC1012C; Wed, 15 Aug 2018 21:24:06 +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 w7FLO6Rg086722; Wed, 15 Aug 2018 21:24:06 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FLO5Ss086720; Wed, 15 Aug 2018 21:24:05 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808152124.w7FLO5Ss086720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 15 Aug 2018 21:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337873 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 337873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:24:07 -0000 Author: np Date: Wed Aug 15 21:24:05 2018 New Revision: 337873 URL: https://svnweb.freebsd.org/changeset/base/337873 Log: cxgbe(4): Use VLAN_TRUNKDEV instead of private cookie to figure out the parent of a VLAN ifnet. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_connect.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Wed Aug 15 21:21:16 2018 (r337872) +++ head/sys/dev/cxgbe/adapter.h Wed Aug 15 21:24:05 2018 (r337873) @@ -194,8 +194,6 @@ struct vi_info { uint16_t rss_size; /* size of VI's RSS table slice */ uint16_t rss_base; /* start of VI's RSS table slice */ - eventhandler_tag vlan_c; - int nintr; int first_intr; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Aug 15 21:21:16 2018 (r337872) +++ head/sys/dev/cxgbe/t4_main.c Wed Aug 15 21:24:05 2018 (r337873) @@ -544,7 +544,6 @@ static void get_regs(struct adapter *, struct t4_regdu static void vi_refresh_stats(struct adapter *, struct vi_info *); static void cxgbe_refresh_stats(struct adapter *, struct port_info *); static void cxgbe_tick(void *); -static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t); static void cxgbe_sysctls(struct port_info *); static int sysctl_int_array(SYSCTL_HANDLER_ARGS); static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS); @@ -1522,9 +1521,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS; ifp->if_hw_tsomaxsegsize = 65536; - vi->vlan_c = EVENTHANDLER_REGISTER(vlan_config, cxgbe_vlan_config, ifp, - EVENTHANDLER_PRI_ANY); - ether_ifattach(ifp, vi->hw_addr); #ifdef DEV_NETMAP if (ifp->if_capabilities & IFCAP_NETMAP) @@ -1602,9 +1598,6 @@ cxgbe_vi_detach(struct vi_info *vi) ether_ifdetach(ifp); - if (vi->vlan_c) - EVENTHANDLER_DEREGISTER(vlan_config, vi->vlan_c); - /* Let detach proceed even if these fail. */ #ifdef DEV_NETMAP if (ifp->if_capabilities & IFCAP_NETMAP) @@ -5459,18 +5452,6 @@ vi_tick(void *arg) vi_refresh_stats(sc, vi); callout_schedule(&vi->tick, hz); -} - -static void -cxgbe_vlan_config(void *arg, struct ifnet *ifp, uint16_t vid) -{ - struct ifnet *vlan; - - if (arg != ifp || ifp->if_type != IFT_ETHER) - return; - - vlan = VLAN_DEVAT(ifp, vid); - VLAN_SETCOOKIE(vlan, ifp); } /* Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Wed Aug 15 21:21:16 2018 (r337872) +++ head/sys/dev/cxgbe/tom/t4_connect.c Wed Aug 15 21:24:05 2018 (r337873) @@ -335,7 +335,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru if (rt_ifp->if_type == IFT_ETHER) vi = rt_ifp->if_softc; else if (rt_ifp->if_type == IFT_L2VLAN) { - struct ifnet *ifp = VLAN_COOKIE(rt_ifp); + struct ifnet *ifp = VLAN_TRUNKDEV(rt_ifp); vi = ifp->if_softc; VLAN_TAG(rt_ifp, &vid); From owner-svn-src-all@freebsd.org Wed Aug 15 21:35: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 4354F107184F; Wed, 15 Aug 2018 21:35:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B00B07D6E6; Wed, 15 Aug 2018 21:35:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w7FLYuvo041810 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Aug 2018 00:34:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w7FLYuvo041810 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w7FLYu8J041809; Thu, 16 Aug 2018 00:34:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 16 Aug 2018 00:34:56 +0300 From: Konstantin Belousov To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r337682 - in stable/11: share/mk tools/build/options usr.bin/ofed usr.bin/ofed/infiniband-diags Message-ID: <20180815213456.GD2340@kib.kiev.ua> References: <201808120845.w7C8jNQU027742@repo.freebsd.org> <201808121550.w7CFovDw033112@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201808121550.w7CFovDw033112@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:35:08 -0000 On Sun, Aug 12, 2018 at 08:50:57AM -0700, Rodney W. Grimes wrote: > > Author: kib > > Date: Sun Aug 12 08:45:23 2018 > > New Revision: 337682 > > URL: https://svnweb.freebsd.org/changeset/base/337682 > > > > Log: > > MFC r336569: > > Move mostly useless examples binaries from OFED, as well as the Subnet > > Manager, under the new option WITH_OFED_EXTRA, disabled by default. > > I never got a response on putting opensm out from under _EXTRA. I thought that I already answered. If no, sorry. I do not see much point in this split. Right now you get either nothing or everyting, the split allows to get nothing/libs/everything. I do not see allowing SM by a separate option to serve significant number of users to justify me spending several more days tinderboxing the change. If somebody else wants to do that, I have no objections. From owner-svn-src-all@freebsd.org Wed Aug 15 21:36:41 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 EF02C10718DA; Wed, 15 Aug 2018 21:36:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45F047D847; Wed, 15 Aug 2018 21:36:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w7FLaUsw042972 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Aug 2018 00:36:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w7FLaUsw042972 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w7FLaUTM042971; Thu, 16 Aug 2018 00:36:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 16 Aug 2018 00:36:30 +0300 From: Konstantin Belousov To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r337682 - in stable/11: share/mk tools/build/options usr.bin/ofed usr.bin/ofed/infiniband-diags Message-ID: <20180815213629.GE2340@kib.kiev.ua> References: <201808120845.w7C8jNQU027742@repo.freebsd.org> <201808121554.w7CFsGXX033130@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201808121554.w7CFsGXX033130@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:36:41 -0000 On Sun, Aug 12, 2018 at 08:54:15AM -0700, Rodney W. Grimes wrote: > > Author: kib > > Date: Sun Aug 12 08:45:23 2018 > > New Revision: 337682 > > URL: https://svnweb.freebsd.org/changeset/base/337682 > > > > Log: > > MFC r336569: > > Move mostly useless examples binaries from OFED, as well as the Subnet > > Manager, under the new option WITH_OFED_EXTRA, disabled by default. > > > > Added: > > stable/11/tools/build/options/WITH_OFED_EXTRA > > - copied unchanged from r336569, head/tools/build/options/WITH_OFED_EXTRA > > This is also now kinda a POLA issue for those who have been building > on stable/11 with just OFED defined, on our next builds a bunch of > stuff is gona go missing. The needs an UPDATING entry, and defanitly a > > ReleaseNotes: Yes Using this thread to inform about what happens next: there are several missed commits in stable/11 which do not allow to enable OFED unconditionally on several architectures. I will only enable it on amd64 and add some UPDATING text. From owner-svn-src-all@freebsd.org Wed Aug 15 21:38: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 498B6107198D; Wed, 15 Aug 2018 21:38:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 007D67D9B8; Wed, 15 Aug 2018 21:38:07 +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 D193C102DC; Wed, 15 Aug 2018 21:38:06 +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 w7FLc6MX092387; Wed, 15 Aug 2018 21:38:06 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FLc6aK092386; Wed, 15 Aug 2018 21:38:06 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808152138.w7FLc6aK092386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 15 Aug 2018 21:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337874 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 337874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:38:07 -0000 Author: tsoome Date: Wed Aug 15 21:38:06 2018 New Revision: 337874 URL: https://svnweb.freebsd.org/changeset/base/337874 Log: libsa: zfs_probe() needs to set spa to NULL Silence the warning about possibly uninitialized use of spa. Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Wed Aug 15 21:24:05 2018 (r337873) +++ head/stand/libsa/zfs/zfs.c Wed Aug 15 21:38:06 2018 (r337874) @@ -467,6 +467,7 @@ zfs_probe(int fd, uint64_t *pool_guid) spa_t *spa; int ret; + spa = NULL; ret = vdev_probe(vdev_read, (void *)(uintptr_t)fd, &spa); if (ret == 0 && pool_guid != NULL) *pool_guid = spa->spa_guid; From owner-svn-src-all@freebsd.org Wed Aug 15 21:38: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 BC89610719B2; Wed, 15 Aug 2018 21:38:14 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 485077D9E9; Wed, 15 Aug 2018 21:38:11 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D60A3102DD; Wed, 15 Aug 2018 21:38:10 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FLcAB9092437; Wed, 15 Aug 2018 21:38:10 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FLcAax092436; Wed, 15 Aug 2018 21:38:10 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808152138.w7FLcAax092436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Aug 2018 21:38: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: r337875 - stable/11/lib/libjail X-SVN-Group: stable-11 X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: stable/11/lib/libjail X-SVN-Commit-Revision: 337875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:38:14 -0000 Author: jamie Date: Wed Aug 15 21:38:10 2018 New Revision: 337875 URL: https://svnweb.freebsd.org/changeset/base/337875 Log: MFC r331332: If a jail parameter isn't found, try loading a related kernel module. PR: 192092 Modified: stable/11/lib/libjail/jail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libjail/jail.c ============================================================================== --- stable/11/lib/libjail/jail.c Wed Aug 15 21:38:06 2018 (r337874) +++ stable/11/lib/libjail/jail.c Wed Aug 15 21:38:10 2018 (r337875) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$"); static int jailparam_import_enum(const char **values, int nvalues, const char *valstr, size_t valsize, int *value); static int jailparam_type(struct jailparam *jp); +static int kldload_param(const char *name); static char *noname(const char *name); static char *nononame(const char *name); @@ -885,6 +887,9 @@ jailparam_type(struct jailparam *jp) "sysctl(0.3.%s): %s", name, strerror(errno)); return (-1); } + if (kldload_param(name) >= 0 && sysctl(mib, 2, mib + 2, &miblen, + desc.s, strlen(desc.s)) >= 0) + goto mib_desc; /* * The parameter probably doesn't exist. But it might be * the "no" counterpart to a boolean. @@ -1021,6 +1026,33 @@ jailparam_type(struct jailparam *jp) jp->jp_valuelen = 0; } return (0); +} + +/* + * Attempt to load a kernel module matching an otherwise nonexistent parameter. + */ +static int +kldload_param(const char *name) +{ + int kl; + + if (strcmp(name, "linux") == 0 || strncmp(name, "linux.", 6) == 0) + kl = kldload("linux"); + else if (strcmp(name, "sysvmsg") == 0 || strcmp(name, "sysvsem") == 0 || + strcmp(name, "sysvshm") == 0) + kl = kldload(name); + else { + errno = ENOENT; + return (-1); + } + if (kl < 0 && errno == EEXIST) { + /* + * In the module is already loaded, then it must not contain + * the parameter. + */ + errno = ENOENT; + } + return kl; } /* From owner-svn-src-all@freebsd.org Wed Aug 15 21:38:45 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 880831071A69; Wed, 15 Aug 2018 21:38:45 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C3EF7DBF7; Wed, 15 Aug 2018 21:38:45 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EE21102DF; Wed, 15 Aug 2018 21:38:45 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FLcikn092514; Wed, 15 Aug 2018 21:38:44 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FLciGW092513; Wed, 15 Aug 2018 21:38:44 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808152138.w7FLciGW092513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Aug 2018 21:38:44 +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: r337876 - stable/10/lib/libjail X-SVN-Group: stable-10 X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: stable/10/lib/libjail X-SVN-Commit-Revision: 337876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:38:45 -0000 Author: jamie Date: Wed Aug 15 21:38:44 2018 New Revision: 337876 URL: https://svnweb.freebsd.org/changeset/base/337876 Log: MFC r331332: If a jail parameter isn't found, try loading a related kernel module. PR: 192092 Modified: stable/10/lib/libjail/jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libjail/jail.c ============================================================================== --- stable/10/lib/libjail/jail.c Wed Aug 15 21:38:10 2018 (r337875) +++ stable/10/lib/libjail/jail.c Wed Aug 15 21:38:44 2018 (r337876) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$"); static int jailparam_import_enum(const char **values, int nvalues, const char *valstr, size_t valsize, int *value); static int jailparam_type(struct jailparam *jp); +static int kldload_param(const char *name); static char *noname(const char *name); static char *nononame(const char *name); @@ -885,6 +887,9 @@ jailparam_type(struct jailparam *jp) "sysctl(0.3.%s): %s", name, strerror(errno)); return (-1); } + if (kldload_param(name) >= 0 && sysctl(mib, 2, mib + 2, &miblen, + desc.s, strlen(desc.s)) >= 0) + goto mib_desc; /* * The parameter probably doesn't exist. But it might be * the "no" counterpart to a boolean. @@ -1021,6 +1026,33 @@ jailparam_type(struct jailparam *jp) jp->jp_valuelen = 0; } return (0); +} + +/* + * Attempt to load a kernel module matching an otherwise nonexistent parameter. + */ +static int +kldload_param(const char *name) +{ + int kl; + + if (strcmp(name, "linux") == 0 || strncmp(name, "linux.", 6) == 0) + kl = kldload("linux"); + else if (strcmp(name, "sysvmsg") == 0 || strcmp(name, "sysvsem") == 0 || + strcmp(name, "sysvshm") == 0) + kl = kldload(name); + else { + errno = ENOENT; + return (-1); + } + if (kl < 0 && errno == EEXIST) { + /* + * In the module is already loaded, then it must not contain + * the parameter. + */ + errno = ENOENT; + } + return kl; } /* From owner-svn-src-all@freebsd.org Wed Aug 15 21:47: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 A65351071F12; Wed, 15 Aug 2018 21:47:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 591F47E1A6; Wed, 15 Aug 2018 21:47:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A1E81048B; Wed, 15 Aug 2018 21:47:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FLl48p097691; Wed, 15 Aug 2018 21:47:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FLl4U8097690; Wed, 15 Aug 2018 21:47:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808152147.w7FLl4U8097690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 15 Aug 2018 21:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337877 - head/sys/modules/dtb/am335x X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/dtb/am335x X-SVN-Commit-Revision: 337877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 21:47:04 -0000 Author: manu Date: Wed Aug 15 21:47:03 2018 New Revision: 337877 URL: https://svnweb.freebsd.org/changeset/base/337877 Log: am335x: Add pocketbeagle DTS to the build U-Boot works for this board since 2018.07 and the DTS is now present in the tree. Modified: head/sys/modules/dtb/am335x/Makefile Modified: head/sys/modules/dtb/am335x/Makefile ============================================================================== --- head/sys/modules/dtb/am335x/Makefile Wed Aug 15 21:38:44 2018 (r337876) +++ head/sys/modules/dtb/am335x/Makefile Wed Aug 15 21:47:03 2018 (r337877) @@ -7,6 +7,7 @@ DTS= \ am335x-bonegreen.dts \ am335x-bonegreen-wireless.dts \ am335x-boneblue.dts \ + am335x-pocketbeagle.dts \ ufw.dts .include From owner-svn-src-all@freebsd.org Wed Aug 15 22:25: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 00032107297A; Wed, 15 Aug 2018 22:25:05 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AADE57F719; Wed, 15 Aug 2018 22:25:05 +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 8BEF610AFA; Wed, 15 Aug 2018 22:25:05 +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 w7FMP5bj018007; Wed, 15 Aug 2018 22:25:05 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FMP5J2018006; Wed, 15 Aug 2018 22:25:05 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808152225.w7FMP5J2018006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 15 Aug 2018 22:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337878 - 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: 337878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 22:25:06 -0000 Author: tsoome Date: Wed Aug 15 22:25:05 2018 New Revision: 337878 URL: https://svnweb.freebsd.org/changeset/base/337878 Log: libi386: remove bd_read() and bd_write() wrappers Those wroappers are nice, but do not really add much value. Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Wed Aug 15 21:47:03 2018 (r337877) +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:25:05 2018 (r337878) @@ -94,10 +94,7 @@ static int nbdinfo = 0; static void bd_io_workaround(struct disk_devdesc *dev); -static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, - caddr_t dest); -static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, - caddr_t dest); +static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, int); static int bd_int13probe(struct bdinfo *bd); static int bd_init(void); @@ -506,7 +503,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s case F_READ: DEBUG("read %d from %lld to %p", blks, dblk, buf); - if (blks && (rc = bd_read(dev, dblk, blks, buf))) { + if (blks && (rc = bd_io(dev, dblk, blks, buf, 0))) { /* Filter out floppy controller errors */ if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { printf("read %d from %lld to %p, error: 0x%x\n", @@ -518,7 +515,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s case F_WRITE : DEBUG("write %d from %lld to %p", blks, dblk, buf); - if (blks && bd_write(dev, dblk, blks, buf)) { + if (blks && bd_io(dev, dblk, blks, buf, 1)) { DEBUG("write error"); return (EIO); } @@ -713,20 +710,6 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks } return (0); -} - -static int -bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest) -{ - - return (bd_io(dev, dblk, blks, dest, 0)); -} - -static int -bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest) -{ - - return (bd_io(dev, dblk, blks, dest, 1)); } /* From owner-svn-src-all@freebsd.org Wed Aug 15 22:28: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 D605B1072A2D for ; Wed, 15 Aug 2018 22:28:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52C7E7F8CF for ; Wed, 15 Aug 2018 22:28:58 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 97df9aa3-a0da-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 97df9aa3-a0da-11e8-93fa-f3ebd9db2b94; Wed, 15 Aug 2018 22:28:55 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7FMSsrL076132; Wed, 15 Aug 2018 16:28:54 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534372134.1466.21.camel@freebsd.org> Subject: Re: svn commit: r337878 - head/stand/i386/libi386 From: Ian Lepore To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 15 Aug 2018 16:28:54 -0600 In-Reply-To: <201808152225.w7FMP5J2018006@repo.freebsd.org> References: <201808152225.w7FMP5J2018006@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 22:28:59 -0000 On Wed, 2018-08-15 at 22:25 +0000, Toomas Soome wrote: > Author: tsoome > Date: Wed Aug 15 22:25:05 2018 > New Revision: 337878 > URL: https://svnweb.freebsd.org/changeset/base/337878 > > Log: >   libi386: remove bd_read() and bd_write() wrappers >    >   Those wroappers are nice, but do not really add much value. > > Modified: >   head/stand/i386/libi386/biosdisk.c > > Modified: head/stand/i386/libi386/biosdisk.c > ===================================================================== > ========= > --- head/stand/i386/libi386/biosdisk.c Wed Aug 15 21:47:03 > 2018 (r337877) > +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:25:05 > 2018 (r337878) > @@ -94,10 +94,7 @@ static int nbdinfo = 0; >   >  static void bd_io_workaround(struct disk_devdesc *dev); >   > -static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, > -    caddr_t dest); > -static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int > blks, > -    caddr_t dest); > +static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, int); >  static int bd_int13probe(struct bdinfo *bd); >   >  static int bd_init(void); > @@ -506,7 +503,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > dblk, s >   case F_READ: >   DEBUG("read %d from %lld to %p", blks, dblk, buf); >   > - if (blks && (rc = bd_read(dev, dblk, blks, buf))) { > + if (blks && (rc = bd_io(dev, dblk, blks, buf, 0))) { >   /* Filter out floppy controller errors */ >   if (BD(dev).bd_flags != BD_FLOPPY || rc != > 0x20) { >   printf("read %d from %lld to %p, > error: 0x%x\n", > @@ -518,7 +515,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > dblk, s >   case F_WRITE : >   DEBUG("write %d from %lld to %p", blks, dblk, buf); >   > - if (blks && bd_write(dev, dblk, blks, buf)) { > + if (blks && bd_io(dev, dblk, blks, buf, 1)) { >   DEBUG("write error"); >   return (EIO); >   } > @@ -713,20 +710,6 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, > int blks >   } >   >   return (0); > -} > - > -static int > -bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > dest) > -{ > - > - return (bd_io(dev, dblk, blks, dest, 0)); > -} > - > -static int > -bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > dest) > -{ > - > - return (bd_io(dev, dblk, blks, dest, 1)); >  } >   >  /* > This would be a more satisfying change if there were something like  #define BD_RD 0  #define BD_WR 1 so that it was clear at a glance what a bd_io() call is doing. -- Ian From owner-svn-src-all@freebsd.org Wed Aug 15 22:29: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 0B9431072A7B for ; Wed, 15 Aug 2018 22:29:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (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 A62607F9AB for ; Wed, 15 Aug 2018 22:29:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id j81-v6so3822641ite.0 for ; Wed, 15 Aug 2018 15:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Qh0OLXbZ+Ov9GPkKAkXhRv8QX/SqTydWQzltzyCpf9E=; b=cc/oAlT33fyoQeXFEdfFwVa1h0xtndcERMaa6eFTZztq7Hqnxz+m3Osus1DnsKY1nr qG/lrUsForwfN3qMe/Lebm1gSCL4ErzH+xscHBcxGVv3RZp1aXnQHZ+Ed4/F2HawAVqx EOwjZAws/zx8lDh9DgSn+vvzlBGWb9dSzOrzm40qD/uv30bgrXYlxLosI8ZFVhA+6Pm8 XCpssgTW8iuM+cgsLWe8SgI5JRu4hCC5hkQAbS2Lb0Xa2PO0uhsVTgsGQ/aUnlfcJUud t4pjSmYuEZQDz3g/I/fetWMzFRrTa2E+R/EcjDp7HNhG6HZLX6+OD/4guDtrQlzg9i4r mc4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Qh0OLXbZ+Ov9GPkKAkXhRv8QX/SqTydWQzltzyCpf9E=; b=O2EzUAMFm+D64phULFpxKLY7nbUJSwwDZKH5hc0JrkoYD7Tvj918AlRn9HGCqsABrx q/wV1tIAHYg8b2XhRCDOK3OTbpLNbIpNvsMSPBpr0CPAUcQj/oFjyFrIfV+VamYazMSy H2FznELBIH1M77IW8+wbeHL8LnYB6m3Hxakw3CWYFbKP0eY9GBKbyrvjOdP9ixL8ZIPB PWvLKU2HYNeHJHFz/DoCoGy4zVhsj/rX70e6qDtGUwzlTHmku6aZUR0yE4Cdi+a/xN9u v9vhi193QZMNTJj46x7m74UKdlA+LtD/XJiOZBGsNwbUQgGETh9lf8pV2wuagW8hThMF qjNw== X-Gm-Message-State: AOUpUlFnjycKnF7M1vbirooSsjTBPYVurkDJYiVy0rqRHdrwC7Nz4981 RPKu0ev0BL9rvYyTIOSlN6dQy6EzEac/lB0oquKohw== X-Google-Smtp-Source: AA+uWPxBoiFLa6El4zweYr/SU1O+2uEKcitwLRJgF+fEUM8csjnAst3p+97KTSTL9lxzBl9VpioBXYWHX6zjITqoPuQ= X-Received: by 2002:a24:b211:: with SMTP id u17-v6mr19084958ite.1.1534372138701; Wed, 15 Aug 2018 15:28:58 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 15:28:58 -0700 (PDT) X-Originating-IP: [172.58.56.51] In-Reply-To: <201808152041.w7FKfbCU049764@pdx.rh.CN85.dnsmgr.net> References: <201808152041.w7FKfbCU049764@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 15 Aug 2018 16:28:58 -0600 X-Google-Sender-Auth: Uv6KOLSjmDydFk9IdZStY7MSOqI Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: "Rodney W. Grimes" Cc: Ian Lepore , Kyle Evans , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 22:29:07 -0000 On Wed, Aug 15, 2018 at 2:41 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Wed, Aug 15, 2018 at 2:28 PM, Ian Lepore wrote: > > > > > On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: > > > > > > > > > > Will backing out the MFC and leaving this a 12.0 feature end this? > > > > =( > > > > > > > > Sadly no, as the person responded with that reaction when > > > > they installed 12.0-ALPHA :-(. > > > > > > So one whiner can demand of the project that any new feature be removed > > > before a new release is made? > > > > > > > This is a good change. I don't see why people are so fussed about it... > For > > people fighting colored environments a simple unsetenv COLORTERM seems to > > solve this problem no only on FreeBSD but for any other system they have > > access to... > > This is exactly the dismissive attitude by FreeBSD developers that > I was speaking to in my reply to Ian. > I see how it disagrees with you, but it's not dismissive. It's just asking for better data to support your view given that in general when all systems do X when Y happens, except FreeBSD, we generally make FreeBSD do X when Y unless there's a compelling reason not to. I've not seen a compelling reason not to yet. Basically, why should this be different than our general pattern of being in line with industry standards? Warner From owner-svn-src-all@freebsd.org Wed Aug 15 22:32: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 AA11B1072C90; Wed, 15 Aug 2018 22:32:44 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FCA57FE22; Wed, 15 Aug 2018 22:32:44 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 420FD10CA2; Wed, 15 Aug 2018 22:32:44 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FMWiv9022769; Wed, 15 Aug 2018 22:32:44 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FMWixM022768; Wed, 15 Aug 2018 22:32:44 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808152232.w7FMWixM022768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Aug 2018 22:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337879 - stable/11/lib/libjail X-SVN-Group: stable-11 X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: stable/11/lib/libjail X-SVN-Commit-Revision: 337879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 22:32:44 -0000 Author: jamie Date: Wed Aug 15 22:32:43 2018 New Revision: 337879 URL: https://svnweb.freebsd.org/changeset/base/337879 Log: Load filesystem modules associated with allow.mount permissions. PR: 192092 Modified: stable/11/lib/libjail/jail.c Modified: stable/11/lib/libjail/jail.c ============================================================================== --- stable/11/lib/libjail/jail.c Wed Aug 15 22:25:05 2018 (r337878) +++ stable/11/lib/libjail/jail.c Wed Aug 15 22:32:43 2018 (r337879) @@ -513,7 +513,18 @@ jailparam_set(struct jailparam *jp, unsigned njp, int } jiov[i - 1].iov_base = nname; jiov[i - 1].iov_len = strlen(nname) + 1; - + } + /* + * Load filesystem modules associated with allow.mount + * permissions. Ignore failure, since the module may + * be static, and even a failure to load is not a jail + * error. + */ + if (strncmp(jp[j].jp_name, "allow.mount.", 12) == 0) { + if (kldload(jp[j].jp_name + 12) < 0 && + errno == ENOENT && + strncmp(jp[j].jp_name + 12, "no", 2) == 0) + (void)kldload(jp[j].jp_name + 14); } } else { /* From owner-svn-src-all@freebsd.org Wed Aug 15 22:32:56 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 34F751072CC3; Wed, 15 Aug 2018 22:32:56 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF0987FF1F; Wed, 15 Aug 2018 22:32:55 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C189910CA4; Wed, 15 Aug 2018 22:32:55 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FMWtT0022835; Wed, 15 Aug 2018 22:32:55 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FMWtMf022834; Wed, 15 Aug 2018 22:32:55 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808152232.w7FMWtMf022834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Aug 2018 22:32:55 +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: r337880 - stable/10/lib/libjail X-SVN-Group: stable-10 X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: stable/10/lib/libjail X-SVN-Commit-Revision: 337880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 22:32:56 -0000 Author: jamie Date: Wed Aug 15 22:32:55 2018 New Revision: 337880 URL: https://svnweb.freebsd.org/changeset/base/337880 Log: Load filesystem modules associated with allow.mount permissions. PR: 192092 Modified: stable/10/lib/libjail/jail.c Modified: stable/10/lib/libjail/jail.c ============================================================================== --- stable/10/lib/libjail/jail.c Wed Aug 15 22:32:43 2018 (r337879) +++ stable/10/lib/libjail/jail.c Wed Aug 15 22:32:55 2018 (r337880) @@ -513,7 +513,18 @@ jailparam_set(struct jailparam *jp, unsigned njp, int } jiov[i - 1].iov_base = nname; jiov[i - 1].iov_len = strlen(nname) + 1; - + } + /* + * Load filesystem modules associated with allow.mount + * permissions. Ignore failure, since the module may + * be static, and even a failure to load is not a jail + * error. + */ + if (strncmp(jp[j].jp_name, "allow.mount.", 12) == 0) { + if (kldload(jp[j].jp_name + 12) < 0 && + errno == ENOENT && + strncmp(jp[j].jp_name + 12, "no", 2) == 0) + (void)kldload(jp[j].jp_name + 14); } } else { /* From owner-svn-src-all@freebsd.org Wed Aug 15 22:40: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 803D61072E4C; Wed, 15 Aug 2018 22:40:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 365C08018C; Wed, 15 Aug 2018 22:40:10 +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 F3A3E10CAB; Wed, 15 Aug 2018 22:40:09 +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 w7FMe9Lh023480; Wed, 15 Aug 2018 22:40:09 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FMe91p023479; Wed, 15 Aug 2018 22:40:09 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808152240.w7FMe91p023479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 15 Aug 2018 22:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337881 - 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: 337881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 22:40:10 -0000 Author: tsoome Date: Wed Aug 15 22:40:09 2018 New Revision: 337881 URL: https://svnweb.freebsd.org/changeset/base/337881 Log: libi386: use BD_RD and BR_WR constants Use BD_RD and BD_WR instead of 0 and 1. Reported by: ian Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:32:55 2018 (r337880) +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:40:09 2018 (r337881) @@ -91,6 +91,8 @@ static struct bdinfo static int nbdinfo = 0; #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); @@ -503,7 +505,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s case F_READ: DEBUG("read %d from %lld to %p", blks, dblk, buf); - if (blks && (rc = bd_io(dev, dblk, blks, buf, 0))) { + if (blks && (rc = bd_io(dev, dblk, blks, buf, BD_RD))) { /* Filter out floppy controller errors */ if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { printf("read %d from %lld to %p, error: 0x%x\n", @@ -515,7 +517,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s case F_WRITE : DEBUG("write %d from %lld to %p", blks, dblk, buf); - if (blks && bd_io(dev, dblk, blks, buf, 1)) { + if (blks && bd_io(dev, dblk, blks, buf, BD_WR)) { DEBUG("write error"); return (EIO); } @@ -544,7 +546,7 @@ bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int v86.ctl = V86_FLAGS; v86.addr = 0x13; /* Should we Write with verify ?? 0x4302 ? */ - if (dowrite) + if (dowrite == BD_WR) v86.eax = 0x4300; else v86.eax = 0x4200; @@ -580,7 +582,7 @@ bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int v86.ctl = V86_FLAGS; v86.addr = 0x13; - if (dowrite) + if (dowrite == BD_WR) v86.eax = 0x300 | blks; else v86.eax = 0x200 | blks; @@ -668,7 +670,7 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks * Put your Data In, Put your Data out, * Put your Data In, and shake it all about */ - if (dowrite && bbuf != NULL) + if (dowrite == BD_WR && bbuf != NULL) bcopy(p, bbuf, x * BD(dev).bd_sectorsize); /* @@ -693,7 +695,7 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks break; } - if (dowrite) + if (dowrite == BD_WR) DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, result ? "failed" : "ok"); else @@ -702,7 +704,7 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks if (result) { return (result); } - if (!dowrite && bbuf != NULL) + if (dowrite == BD_RD && bbuf != NULL) bcopy(bbuf, p, x * BD(dev).bd_sectorsize); p += (x * BD(dev).bd_sectorsize); dblk += x; From owner-svn-src-all@freebsd.org Wed Aug 15 22:42: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 4E10C1072F5C for ; Wed, 15 Aug 2018 22:42:23 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2r.ore.mailhop.org (outbound2r.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCEEA8061E for ; Wed, 15 Aug 2018 22:42:22 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 775ae165-a0dc-11e8-904b-1d2e466b3c59 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 775ae165-a0dc-11e8-904b-1d2e466b3c59; Wed, 15 Aug 2018 22:42:19 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7FMgIN5076166; Wed, 15 Aug 2018 16:42:18 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534372938.1466.22.camel@freebsd.org> Subject: Re: svn commit: r337881 - head/stand/i386/libi386 From: Ian Lepore To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 15 Aug 2018 16:42:18 -0600 In-Reply-To: <201808152240.w7FMe91p023479@repo.freebsd.org> References: <201808152240.w7FMe91p023479@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 22:42:23 -0000 On Wed, 2018-08-15 at 22:40 +0000, Toomas Soome wrote: > Author: tsoome > Date: Wed Aug 15 22:40:09 2018 > New Revision: 337881 > URL: https://svnweb.freebsd.org/changeset/base/337881 > > Log: >   libi386: use BD_RD and BR_WR constants >    >   Use BD_RD and BD_WR instead of 0 and 1. >    >   Reported by: ian > Thanks, that makes the code much clearer. -- Ian From owner-svn-src-all@freebsd.org Wed Aug 15 22:59: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 684FB1073833 for ; Wed, 15 Aug 2018 22:59:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (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 EF461818B6 for ; Wed, 15 Aug 2018 22:59:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x244.google.com with SMTP id 139-v6so4210060itf.0 for ; Wed, 15 Aug 2018 15:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=azziFUU7DXY/7d+wW7f7KIkRgyW8UzTyRWqer2K9bW0=; b=jsxaelDqZeaeya/hXiZkNpeY9cO/w0Sn4NSYqofTJCxm1OEYPFlCASrbN4+8cAryTf aojTjk9y6v10/h8XI+1yfBrqfmLs+1qq7A/k4kI3aoLpCno4Xeo/InuNBL5AvtkNkwjF enYeLeZsY4vYT4dFkJeSpk9VpSlgaIVemv+/IhqU814xFFpt0HwkMi3XZO4bRIVl5zlT iSBoCc4O93ZPAjU3VNwtP3oH1xNWZL84dzxEKsPKtuCjjn2FXVcvh147rgYUwFHlgFO6 zpgAYcHjlqm2SoecX/0JwNRqB7ywobSEZFbwN2wYnp2uSc8fVnJm0SkMAa31zOcQNt10 wr3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=azziFUU7DXY/7d+wW7f7KIkRgyW8UzTyRWqer2K9bW0=; b=IEc0leLwhn9f/sD9aPo1d+kEL7bBYNkVMjDE78KWothHdWptO1LKePn+G9NyeXQz2N kQ11o0p2I7sFji3LoUgkjd5xbCnQ7nwjQfETk+r5A7H8mhhB5Xn6yuNkHJWPjNS0ohBa MGAQOwe+zjBqo+V7xLhf2Do6RK9VGyUzZjytwkaxZ2/G0THoP76r8xX56dSLirTSuHtG yROL9j9dev1lditg88jW6/vf+hZYUvsjTEhKrCmoIqp7okR00TJmjfL8M70yOqMM/+Fy kQ5rHVrKkF0QK8AmIYuo/OaWwv80Xq3p5NY3cHhFQNlSlb0DHlxwhpW/sapTB/F4mtys R0DQ== X-Gm-Message-State: AOUpUlGW6166GxWpb7Pn0SiG1D29QwdJAetSfT13d6OJx8pembqUCF7b 4Fvwmv0z2Qq+Y+iEtwL8FMNTsHp6f276iAgDFH1Jjw== X-Google-Smtp-Source: AA+uWPyM2JQFmVMKEeJ5M5iFQhYouaiqdnb9uAnDdM7sryR78hNQ9q5ehNBNIkRw83ZirlAWIegZTBiVAMYIf5oagBg= X-Received: by 2002:a02:bb04:: with SMTP id y4-v6mr25103717jan.5.1534373989190; Wed, 15 Aug 2018 15:59:49 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 15:59:48 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <1534372134.1466.21.camel@freebsd.org> References: <201808152225.w7FMP5J2018006@repo.freebsd.org> <1534372134.1466.21.camel@freebsd.org> From: Warner Losh Date: Wed, 15 Aug 2018 16:59:48 -0600 X-Google-Sender-Auth: k0mnpw-HHUNjSbeaj-SeP9utBSw Message-ID: Subject: Re: svn commit: r337878 - head/stand/i386/libi386 To: Ian Lepore Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 22:59:50 -0000 On Wed, Aug 15, 2018 at 4:28 PM, Ian Lepore wrote: > On Wed, 2018-08-15 at 22:25 +0000, Toomas Soome wrote: > > Author: tsoome > > Date: Wed Aug 15 22:25:05 2018 > > New Revision: 337878 > > URL: https://svnweb.freebsd.org/changeset/base/337878 > > > > Log: > > libi386: remove bd_read() and bd_write() wrappers > > > > Those wroappers are nice, but do not really add much value. > > > > Modified: > > head/stand/i386/libi386/biosdisk.c > > > > Modified: head/stand/i386/libi386/biosdisk.c > > ===================================================================== > > ========= > > --- head/stand/i386/libi386/biosdisk.c Wed Aug 15 21:47:03 > > 2018 (r337877) > > +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:25:05 > > 2018 (r337878) > > @@ -94,10 +94,7 @@ static int nbdinfo = 0; > > > > static void bd_io_workaround(struct disk_devdesc *dev); > > > > -static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, > > - caddr_t dest); > > -static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int > > blks, > > - caddr_t dest); > > +static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, int); > > static int bd_int13probe(struct bdinfo *bd); > > > > static int bd_init(void); > > @@ -506,7 +503,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > > dblk, s > > case F_READ: > > DEBUG("read %d from %lld to %p", blks, dblk, buf); > > > > - if (blks && (rc = bd_read(dev, dblk, blks, buf))) { > > + if (blks && (rc = bd_io(dev, dblk, blks, buf, 0))) { > > /* Filter out floppy controller errors */ > > if (BD(dev).bd_flags != BD_FLOPPY || rc != > > 0x20) { > > printf("read %d from %lld to %p, > > error: 0x%x\n", > > @@ -518,7 +515,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > > dblk, s > > case F_WRITE : > > DEBUG("write %d from %lld to %p", blks, dblk, buf); > > > > - if (blks && bd_write(dev, dblk, blks, buf)) { > > + if (blks && bd_io(dev, dblk, blks, buf, 1)) { > > DEBUG("write error"); > > return (EIO); > > } > > @@ -713,20 +710,6 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, > > int blks > > } > > > > return (0); > > -} > > - > > -static int > > -bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > > dest) > > -{ > > - > > - return (bd_io(dev, dblk, blks, dest, 0)); > > -} > > - > > -static int > > -bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > > dest) > > -{ > > - > > - return (bd_io(dev, dblk, blks, dest, 1)); > > } > > > > /* > > > > This would be a more satisfying change if there were something like > > #define BD_RD 0 > #define BD_WR 1 > > so that it was clear at a glance what a bd_io() call is doing. > I think that's a good idea... Warner From owner-svn-src-all@freebsd.org Wed Aug 15 23:18: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 440441073DA2; Wed, 15 Aug 2018 23:18:36 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDE20820F6; Wed, 15 Aug 2018 23:18:35 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D059711332; Wed, 15 Aug 2018 23:18:35 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FNIZ1b043862; Wed, 15 Aug 2018 23:18:35 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FNIYLl043856; Wed, 15 Aug 2018 23:18:34 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808152318.w7FNIYLl043856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 15 Aug 2018 23:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337882 - in head: bin/csh bin/sh etc etc/root X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: bin/csh bin/sh etc etc/root X-SVN-Commit-Revision: 337882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 23:18:36 -0000 Author: brd Date: Wed Aug 15 23:18:34 2018 New Revision: 337882 URL: https://svnweb.freebsd.org/changeset/base/337882 Log: Revert parts of r337849 and r337857 This fixes the build and I will redo these changes as part of a future review that organizes them differently. The way I tried to do it here could be done better. Sorry for the noise. Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D16737 Added: head/etc/root/dot.cshrc - copied unchanged from r337881, head/bin/csh/dot.cshrc head/etc/root/dot.profile - copied unchanged from r337881, head/bin/sh/dot.profile Deleted: head/bin/csh/dot.cshrc head/bin/sh/dot.profile Modified: head/bin/csh/Makefile head/bin/sh/Makefile head/etc/Makefile head/etc/master.passwd Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Wed Aug 15 22:40:09 2018 (r337881) +++ head/bin/csh/Makefile Wed Aug 15 23:18:34 2018 (r337882) @@ -8,11 +8,8 @@ .include -CONFGROUPS= ETC ROOT +CONFGROUPS= ETC ETC= csh.cshrc csh.login csh.logout -ROOT= dot.cshrc -ROOTDIR= /root -ROOTNAME= .cshrc PACKAGE=runtime TCSHDIR= ${SRCTOP}/contrib/tcsh .PATH: ${TCSHDIR} @@ -152,12 +149,5 @@ tc.const.h: tc.const.c sh.char.h config.h config_f.h s sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \ sort >> ${.TARGET} @echo '#endif /* _h_tc_const */' >> ${.TARGET} - -beforeinstall: - rm -f ${DESTDIR}/.cshrc - -afterinstallconfig: - sed -i "" -e 's;/bin/sh;/bin/csh;' ${DESTDIR}/etc/master.passwd - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .include Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Wed Aug 15 22:40:09 2018 (r337881) +++ head/bin/sh/Makefile Wed Aug 15 23:18:34 2018 (r337882) @@ -3,9 +3,7 @@ .include -CONFS= dot.profile profile -CONFSDIR_dot.profile= /root -CONFSNAME_dot.profile= .profile +CONFS= profile PACKAGE=runtime PROG= sh INSTALLFLAGS= -S @@ -62,11 +60,5 @@ token.h: mktokens HAS_TESTS= SUBDIR.${MK_TESTS}+= tests - -beforeinstall: - rm -f ${DESTDIR}/.profile - -afterinstallconfig: - ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile .include Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Aug 15 22:40:09 2018 (r337881) +++ head/etc/Makefile Wed Aug 15 23:18:34 2018 (r337882) @@ -135,6 +135,10 @@ distribution: ${DESTDIR}/etc/services; .endif +.if ${MK_TCSH} == "no" + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd +.endif + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .if defined(NO_ROOT) ( \ echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \ @@ -171,6 +175,18 @@ distribution: cd ${.CURDIR}/root; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ dot.k5login ${DESTDIR}/root/.k5login; +.endif + cd ${.CURDIR}/root; \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + dot.profile ${DESTDIR}/root/.profile; \ + rm -f ${DESTDIR}/.profile; \ + ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile +.if ${MK_TCSH} != "no" + cd ${.CURDIR}/root; \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + dot.cshrc ${DESTDIR}/root/.cshrc; \ + rm -f ${DESTDIR}/.cshrc; \ + ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc .endif .if ${MK_MAIL} != "no" Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Wed Aug 15 22:40:09 2018 (r337881) +++ head/etc/master.passwd Wed Aug 15 23:18:34 2018 (r337882) @@ -1,6 +1,6 @@ # $FreeBSD$ # -root::0:0::0:0:Charlie &:/root:/bin/sh +root::0:0::0:0:Charlie &:/root:/bin/csh toor:*:0:0::0:0:Bourne-again Superuser:/root: daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin operator:*:2:5::0:0:System &:/:/usr/sbin/nologin Copied: head/etc/root/dot.cshrc (from r337881, head/bin/csh/dot.cshrc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/root/dot.cshrc Wed Aug 15 23:18:34 2018 (r337882, copy of r337881, head/bin/csh/dot.cshrc) @@ -0,0 +1,43 @@ +# $FreeBSD$ +# +# .cshrc - csh resource script, read at beginning of execution by each shell +# +# see also csh(1), environ(7). +# more examples available at /usr/share/examples/csh/ +# + +alias h history 25 +alias j jobs -l +alias la ls -aF +alias lf ls -FA +alias ll ls -lAF + +# A righteous umask +umask 22 + +set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) + +setenv EDITOR vi +setenv PAGER less +setenv BLOCKSIZE K + +if ($?prompt) then + # An interactive shell -- set some stuff up + set prompt = "%N@%m:%~ %# " + set promptchars = "%#" + + set filec + set history = 1000 + set savehist = (1000 merge) + set autolist = ambiguous + # Use history to aid expansion + set autoexpand + set autorehash + set mail = (/var/mail/$USER) + if ( $?tcsh ) then + bindkey "^W" backward-delete-word + bindkey -k up history-search-backward + bindkey -k down history-search-forward + endif + +endif Copied: head/etc/root/dot.profile (from r337881, head/bin/sh/dot.profile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/root/dot.profile Wed Aug 15 23:18:34 2018 (r337882, copy of r337881, head/bin/sh/dot.profile) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin +export PATH +HOME=/root +export HOME +TERM=${TERM:-xterm} +export TERM +PAGER=less +export PAGER + +# Query terminal size; useful for serial lines. +if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi + +# Uncomment to display a random cookie on each login. +# if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune -s ; fi From owner-svn-src-all@freebsd.org Wed Aug 15 23:22: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 562401073EEE; Wed, 15 Aug 2018 23:22:00 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08E58824AE; Wed, 15 Aug 2018 23:22:00 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: brd/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id DAC7D184BC; Wed, 15 Aug 2018 23:21:59 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 9F4E120F1D; Wed, 15 Aug 2018 19:21:59 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute5.internal (MEProxy); Wed, 15 Aug 2018 19:21:59 -0400 X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 1962A41A1; Wed, 15 Aug 2018 19:21:59 -0400 (EDT) Message-Id: <1534375319.1005259.1475586528.5E9C2023@webmail.messagingengine.com> From: Brad Davis To: rgrimes@FreeBSD.org Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-9a5384d7 Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc Date: Wed, 15 Aug 2018 17:21:59 -0600 In-Reply-To: <201808151734.w7FHYE9r048846@pdx.rh.CN85.dnsmgr.net> References: <201808151734.w7FHYE9r048846@pdx.rh.CN85.dnsmgr.net> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 23:22:00 -0000 On Wed, Aug 15, 2018, at 11:34 AM, Rodney W. Grimes wrote: > > > > Author: brd > > > > Date: Wed Aug 15 16:22:12 2018 > > > > New Revision: 337857 > > > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > > > > > Log: > > > > Fix build after r337849 > > > > > > > > This moves the symlink creation to after where the files are installed. > > > > > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > > > > > > > Approved by: will (mentor) > > > > Differential Revision: https://reviews.freebsd.org/D16725 > > > > > > > > Modified: > > > > head/bin/csh/Makefile > > > > head/bin/sh/Makefile > > > > head/etc/master.passwd > > > > > > > > Modified: head/bin/csh/Makefile > > > > ============================================================================== > > > > --- head/bin/csh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > > +++ head/bin/csh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > > @@ -49,8 +49,7 @@ MLINKS= csh.1 tcsh.1 > > > > > > > > LIBADD= termcapw crypt > > > > > > > > -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ > > > > - /root/.cshrc /.cshrc > > > > +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > > > > > > > > CLEANFILES= ${GENHDRS} gethost csh.1 > > > > > > > > @@ -158,7 +157,7 @@ beforeinstall: > > > > rm -f ${DESTDIR}/.cshrc > > > > > > > > afterinstallconfig: > > > > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > > > > + sed -i "" -e 's;/bin/sh;/bin/csh;' ${DESTDIR}/etc/master.passwd > > > > pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > > > > > > > .include > > > > > > > > Modified: head/bin/sh/Makefile > > > > ============================================================================== > > > > --- head/bin/sh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > > +++ head/bin/sh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > > @@ -37,7 +37,6 @@ WFORMAT=0 > > > > > > > > CLEANFILES+= mknodes mksyntax > > > > CLEANFILES+= ${GENSRCS} ${GENHDRS} > > > > -LINKS= /root/.profile /.profile > > > > > > > > build-tools: mknodes mksyntax > > > > > > > > @@ -66,5 +65,8 @@ SUBDIR.${MK_TESTS}+= tests > > > > > > > > beforeinstall: > > > > rm -f ${DESTDIR}/.profile > > > > > > Still unconditionally removing /.profile, but only replacing it > > > when installconfig: is run. > > > > Yes, working on a separate review for this.. > > > > > > + > > > > +afterinstallconfig: > > > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile > > > > > > > > .include > > > > > > > > Modified: head/etc/master.passwd > > > > ============================================================================== > > > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > > > @@ -1,6 +1,6 @@ > > > > # $FreeBSD$ > > > > # > > > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > > > > > I strongly object to this change to master.passwd, and feel it should > > > be worked around if in anyway possible. I have pointed out in the > > > review ways to not have to make this change. > > > > I opened up the following which addresses some of your feedback: > > https://reviews.freebsd.org/D16728 > > Bleh, can we revert all of this, and take a second look with many more > eyes on this. master.passwd coming from libc makes my head hurt! > > Also this is now a patch on a patch on a patch, time to end the dive > down the rabbit hole! Yes, I did a partial revert of the problematic spots in r337882. I will redo with a better approach tomorrow. Sorry for the trouble and your .cshrc getting clobbered. Regards, Brad Davis From owner-svn-src-all@freebsd.org Wed Aug 15 23:36: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 C51BC10743E6 for ; Wed, 15 Aug 2018 23:36:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (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 4972082C3E for ; Wed, 15 Aug 2018 23:36:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id q4-v6so2414806iob.8 for ; Wed, 15 Aug 2018 16:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=pge+KMotrTFALfMJv3UsScQmFUGr+Xi2xqhN8n5Sq3U=; b=aPmoo92bU5veptklGtO4aEF1/p2dw1X+/ptIZz4FpJKMBHylp2bRlyEs42Ipetz2FX PwZjrZUPDjRwPdatqI1XW/0wVtlRsFLbfYl0tBwF1mJY1uJf2DeqJ3B/T9GbtlDJ1K1c K9nLz0ln3tWkr1CDbmaMii/r5PIb3JCYHNL7l2wJNSalfgh3VRvPFkwBAUu5EknxICuN GUCrqie9EZRcJTvK4j4Tz0bgLthdsfW1OOwdLgfHrynI/7ZLLgpdz5qHhXSsFjrx0DD+ 4BjxHbWyET9ZoGYV2wW/5ETaVlSOcVcfLWJNAFtW1UwVi8CIp/rfAtAgvTxd0vK6sOGR i/ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=pge+KMotrTFALfMJv3UsScQmFUGr+Xi2xqhN8n5Sq3U=; b=f7e4g4L2OoieUiFcmTYXpz9ZPy/698VKZx1Nvc9wVxLX7700z2onSj8TwnoRBZyWJW jZxggRSU8f4jCb59EmrppWFU5xi+vG7Mr1XAWxCbCAS+TnzVABfWa0ar0AzR2OrnnEwZ n54IEGi5s1ByYbb4OuzA4zmQb82m7gzAzsAuzPf6bd7GcBCM00CI9pnVCAmiJEDzKFCl vSWyJVDgjx4pPas6U3P/oBzxI/j0t0F1HDC7DxBuwCBxT3v9ZhYeAsEKee8zElk2WjNU JQsRkcrltqK0IaODyadOC93i+6WCReV906ryiplTN8B+wmza9YcV69e/4wPTjWpqfdNW zp1g== X-Gm-Message-State: AOUpUlEwUa+x2pkG2Bd5cmHxIPXVp0mWiXuEAHXc7qbHJ04mHqpAGRyo zjFb1/FxwaLS5aNnr0wx1F6Dt6AVoYZEXBPDiUQfWg== X-Google-Smtp-Source: AA+uWPxhNImjMUF05VSohRC9kkiuEo3SQxhOcMmCiHwZ9tfovVFw67fOrNeIUX8ugD50meQGX6k0TXK62438CnUNHK8= X-Received: by 2002:a6b:d004:: with SMTP id x4-v6mr23434561ioa.299.1534376163375; Wed, 15 Aug 2018 16:36:03 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 16:36:02 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808152031.w7FKVCVa058677@repo.freebsd.org> From: Warner Losh Date: Wed, 15 Aug 2018 17:36:02 -0600 X-Google-Sender-Auth: b4zeMUCAqXk1FzU3QLHDv_X8mLI Message-ID: Subject: Re: svn commit: r337868 - head/stand To: Kyle Evans Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 23:36:05 -0000 which mips builds? My automated mips and mips64 builds just work... Warner On Wed, Aug 15, 2018 at 3:22 PM, Kyle Evans wrote: > On Wed, Aug 15, 2018 at 3:31 PM, Warner Losh wrote: > > Author: imp > > Date: Wed Aug 15 20:31:11 2018 > > New Revision: 337868 > > URL: https://svnweb.freebsd.org/changeset/base/337868 > > > > Log: > > stand: Use -Oz/-Os for all loader/stand builds. > > > > While we're not super size constrained, the x86 BIOS /boot/loader has > > to be less than about 520k-530k to be reliable. The LUA loader is at > > this size today. -Oz saves 15-20% on the size, keeping us safely small > > enough (comparable to where we were with the 4th loader). This will > > also help with sjg's work on bringing in bearssl, though we may again > > be looking for space in the LUA loader. > > > > Size table for clang 6.0.0: > > default -O1 -Os -Oz > > 4th 442368 417792 389120 376832 > > lua 524288 479232 446464 430080 > > > > Tested by: kevans91@ (ubldr on armv7), dhw@ (loader on amdy64) > > Differential Revision: https://reviews.freebsd.org/D16724 > > > > This seems to have frustrated the MIPS build: > > --- ubldr --- > /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function > `block_map': > /usr/src/stand/libsa/ufs.c:277: undefined reference to `__ashldi3' > /usr/src/stand/libsa/ufs.c:277: relocation truncated to fit: R_MIPS_26 > against `__ashldi3' > /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function > `buf_read_file': > /usr/src/stand/libsa/ufs.c:402: undefined reference to `__ashrdi3' > /usr/src/stand/libsa/ufs.c:402: relocation truncated to fit: R_MIPS_26 > against `__ashrdi3' > /usr/src/stand/libsa/ufs.c:403: undefined reference to `__ashldi3' > /usr/src/stand/libsa/ufs.c:403: relocation truncated to fit: R_MIPS_26 > against `__ashldi3' > /usr/src/stand/libsa/ufs.c:418: undefined reference to `__ashldi3' > /usr/src/stand/libsa/ufs.c:418: relocation truncated to fit: R_MIPS_26 > against `__ashldi3' > /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function > `buf_write_file': > /usr/src/stand/libsa/ufs.c:327: undefined reference to `__ashrdi3' > /usr/src/stand/libsa/ufs.c:327: relocation truncated to fit: R_MIPS_26 > against `__ashrdi3' > /usr/src/stand/libsa/ufs.c:328: undefined reference to `__ashldi3' > /usr/src/stand/libsa/ufs.c:328: relocation truncated to fit: R_MIPS_26 > against `__ashldi3' > /usr/src/stand/libsa/ufs.c:358: undefined reference to `__ashldi3' > /usr/src/stand/libsa/ufs.c:358: relocation truncated to fit: R_MIPS_26 > against `__ashldi3' > /usr/src/stand/libsa/ufs.c:377: undefined reference to `__ashldi3' > /usr/src/stand/libsa/ufs.c:377: relocation truncated to fit: R_MIPS_26 > against `__ashldi3' > /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function > `read_inode': > /usr/src/stand/libsa/ufs.c:166: undefined reference to `__ashldi3' > /usr/src/stand/libsa/ufs.c:166: relocation truncated to fit: R_MIPS_26 > against `__ashldi3' > /usr/src/stand/libsa/ufs.c:166: undefined reference to `__ashldi3' > /usr/src/stand/libsa/ufs.c:166: relocation truncated to fit: R_MIPS_26 > against `__ashldi3' > /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o):/ > usr/src/stand/libsa/ufs.c:638: > more undefined references to `__ashldi3' follow > /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function > `ufs_open': > /usr/src/stand/libsa/ufs.c:638: additional relocation overflows > omitted from the output > From owner-svn-src-all@freebsd.org Wed Aug 15 23:49:55 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 BE1B01074928; Wed, 15 Aug 2018 23:49:55 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FA698338E; Wed, 15 Aug 2018 23:49:55 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 0CB8F187C8; Wed, 15 Aug 2018 23:49:55 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f47.google.com with SMTP id g6-v6so2076592lfb.11; Wed, 15 Aug 2018 16:49:54 -0700 (PDT) X-Gm-Message-State: AOUpUlEH8Bf21lAiAoZ0NRgd6ayFodUW6YJ7oVJ4fwko/2GP72ol6hy/ WFdYMjev816zQjeRS3XeSay1HMLBGGry/GPH/lo= X-Google-Smtp-Source: AA+uWPyDkoKj7/Chd8s9uWGVshpkPtRmVmEuoa7xnUr3c59iC3wFIG5+QqLZBkaj6Ij+pcRdq4+QfYBRS23p3e4dIVQ= X-Received: by 2002:a19:26d2:: with SMTP id m201-v6mr17151747lfm.43.1534376993662; Wed, 15 Aug 2018 16:49:53 -0700 (PDT) MIME-Version: 1.0 References: <201808152031.w7FKVCVa058677@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 15 Aug 2018 18:49:41 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337868 - head/stand To: Warner Losh Cc: Kyle Evans , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 23:49:56 -0000 https://ci.freebsd.org/job/FreeBSD-head-mips-build/3874/console at least; a local make -j8 TARGET_ARCH=mips buildworld also failed a while ago On Wed, Aug 15, 2018, 18:36 Warner Losh wrote: > which mips builds? My automated mips and mips64 builds just work... > > Warner > > On Wed, Aug 15, 2018 at 3:22 PM, Kyle Evans wrote: > >> On Wed, Aug 15, 2018 at 3:31 PM, Warner Losh wrote: >> > Author: imp >> > Date: Wed Aug 15 20:31:11 2018 >> > New Revision: 337868 >> > URL: https://svnweb.freebsd.org/changeset/base/337868 >> > >> > Log: >> > stand: Use -Oz/-Os for all loader/stand builds. >> > >> > While we're not super size constrained, the x86 BIOS /boot/loader has >> > to be less than about 520k-530k to be reliable. The LUA loader is at >> > this size today. -Oz saves 15-20% on the size, keeping us safely small >> > enough (comparable to where we were with the 4th loader). This will >> > also help with sjg's work on bringing in bearssl, though we may again >> > be looking for space in the LUA loader. >> > >> > Size table for clang 6.0.0: >> > default -O1 -Os -Oz >> > 4th 442368 417792 389120 376832 >> > lua 524288 479232 446464 430080 >> > >> > Tested by: kevans91@ (ubldr on armv7), dhw@ (loader on amdy64) >> > Differential Revision: https://reviews.freebsd.org/D16724 >> > >> >> This seems to have frustrated the MIPS build: >> >> --- ubldr --- >> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >> `block_map': >> /usr/src/stand/libsa/ufs.c:277: undefined reference to `__ashldi3' >> /usr/src/stand/libsa/ufs.c:277: relocation truncated to fit: R_MIPS_26 >> against `__ashldi3' >> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >> `buf_read_file': >> /usr/src/stand/libsa/ufs.c:402: undefined reference to `__ashrdi3' >> /usr/src/stand/libsa/ufs.c:402: relocation truncated to fit: R_MIPS_26 >> against `__ashrdi3' >> /usr/src/stand/libsa/ufs.c:403: undefined reference to `__ashldi3' >> /usr/src/stand/libsa/ufs.c:403: relocation truncated to fit: R_MIPS_26 >> against `__ashldi3' >> /usr/src/stand/libsa/ufs.c:418: undefined reference to `__ashldi3' >> /usr/src/stand/libsa/ufs.c:418: relocation truncated to fit: R_MIPS_26 >> against `__ashldi3' >> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >> `buf_write_file': >> /usr/src/stand/libsa/ufs.c:327: undefined reference to `__ashrdi3' >> /usr/src/stand/libsa/ufs.c:327: relocation truncated to fit: R_MIPS_26 >> against `__ashrdi3' >> /usr/src/stand/libsa/ufs.c:328: undefined reference to `__ashldi3' >> /usr/src/stand/libsa/ufs.c:328: relocation truncated to fit: R_MIPS_26 >> against `__ashldi3' >> /usr/src/stand/libsa/ufs.c:358: undefined reference to `__ashldi3' >> /usr/src/stand/libsa/ufs.c:358: relocation truncated to fit: R_MIPS_26 >> against `__ashldi3' >> /usr/src/stand/libsa/ufs.c:377: undefined reference to `__ashldi3' >> /usr/src/stand/libsa/ufs.c:377: relocation truncated to fit: R_MIPS_26 >> against `__ashldi3' >> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >> `read_inode': >> /usr/src/stand/libsa/ufs.c:166: undefined reference to `__ashldi3' >> /usr/src/stand/libsa/ufs.c:166: relocation truncated to fit: R_MIPS_26 >> against `__ashldi3' >> /usr/src/stand/libsa/ufs.c:166: undefined reference to `__ashldi3' >> /usr/src/stand/libsa/ufs.c:166: relocation truncated to fit: R_MIPS_26 >> against `__ashldi3' >> >> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o):/usr/src/stand/libsa/ufs.c:638: >> more undefined references to `__ashldi3' follow >> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >> `ufs_open': >> /usr/src/stand/libsa/ufs.c:638: additional relocation overflows >> omitted from the output >> > > From owner-svn-src-all@freebsd.org Wed Aug 15 23:53:41 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 CF19B1074BE4; Wed, 15 Aug 2018 23:53:40 +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 625CC837F4; Wed, 15 Aug 2018 23:53:40 +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 w7FNrbJk050686; Wed, 15 Aug 2018 16:53:37 -0700 (PDT) (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 w7FNrbfB050685; Wed, 15 Aug 2018 16:53:37 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808152353.w7FNrbfB050685@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc In-Reply-To: <1534375319.1005259.1475586528.5E9C2023@webmail.messagingengine.com> To: Brad Davis Date: Wed, 15 Aug 2018 16:53:37 -0700 (PDT) CC: rgrimes@FreeBSD.org, 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2018 23:53:41 -0000 > On Wed, Aug 15, 2018, at 11:34 AM, Rodney W. Grimes wrote: > > > > > Author: brd > > > > > Date: Wed Aug 15 16:22:12 2018 > > > > > New Revision: 337857 > > > > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > > > > > > > Log: > > > > > Fix build after r337849 > > > > > > > > > > This moves the symlink creation to after where the files are installed. > > > > > > > > > > This also inverts the shell change so that it only happens if MK_TCSH is on. > > > > > > > > > > Approved by: will (mentor) > > > > > Differential Revision: https://reviews.freebsd.org/D16725 > > > > > > > > > > Modified: > > > > > head/bin/csh/Makefile > > > > > head/bin/sh/Makefile > > > > > head/etc/master.passwd > > > > > > > > > > Modified: head/bin/csh/Makefile > > > > > ============================================================================== > > > > > --- head/bin/csh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > > > +++ head/bin/csh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > > > @@ -49,8 +49,7 @@ MLINKS= csh.1 tcsh.1 > > > > > > > > > > LIBADD= termcapw crypt > > > > > > > > > > -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ > > > > > - /root/.cshrc /.cshrc > > > > > +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh > > > > > > > > > > CLEANFILES= ${GENHDRS} gethost csh.1 > > > > > > > > > > @@ -158,7 +157,7 @@ beforeinstall: > > > > > rm -f ${DESTDIR}/.cshrc > > > > > > > > > > afterinstallconfig: > > > > > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > > > > > + sed -i "" -e 's;/bin/sh;/bin/csh;' ${DESTDIR}/etc/master.passwd > > > > > pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > > > > > > > > > > .include > > > > > > > > > > Modified: head/bin/sh/Makefile > > > > > ============================================================================== > > > > > --- head/bin/sh/Makefile Wed Aug 15 16:16:59 2018 (r337856) > > > > > +++ head/bin/sh/Makefile Wed Aug 15 16:22:12 2018 (r337857) > > > > > @@ -37,7 +37,6 @@ WFORMAT=0 > > > > > > > > > > CLEANFILES+= mknodes mksyntax > > > > > CLEANFILES+= ${GENSRCS} ${GENHDRS} > > > > > -LINKS= /root/.profile /.profile > > > > > > > > > > build-tools: mknodes mksyntax > > > > > > > > > > @@ -66,5 +65,8 @@ SUBDIR.${MK_TESTS}+= tests > > > > > > > > > > beforeinstall: > > > > > rm -f ${DESTDIR}/.profile > > > > > > > > Still unconditionally removing /.profile, but only replacing it > > > > when installconfig: is run. > > > > > > Yes, working on a separate review for this.. > > > > > > > > + > > > > > +afterinstallconfig: > > > > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile > > > > > > > > > > .include > > > > > > > > > > Modified: head/etc/master.passwd > > > > > ============================================================================== > > > > > --- head/etc/master.passwd Wed Aug 15 16:16:59 2018 (r337856) > > > > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 (r337857) > > > > > @@ -1,6 +1,6 @@ > > > > > # $FreeBSD$ > > > > > # > > > > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > > > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > > > > > > > I strongly object to this change to master.passwd, and feel it should > > > > be worked around if in anyway possible. I have pointed out in the > > > > review ways to not have to make this change. > > > > > > I opened up the following which addresses some of your feedback: > > > https://reviews.freebsd.org/D16728 > > > > Bleh, can we revert all of this, and take a second look with many more > > eyes on this. master.passwd coming from libc makes my head hurt! > > > > Also this is now a patch on a patch on a patch, time to end the dive > > down the rabbit hole! > > Yes, I did a partial revert of the problematic spots in r337882. :-( Partial reverts are a really bad idea, as only you know what parts of what commit got reverted, and when someone is reading svn log stuff on a file that you did not revert there is no revert to the change that went there.. and well.. its a messy can of worms. I would encorage you to rethink that as an approach for future work. > > I will redo with a better approach tomorrow. Please include those people that commented about all the different little pointy edges in that review. > > Sorry for the trouble and your .cshrc getting clobbered. Thankfully I isolate build machines, so it only effected one system. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 16 00:25: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 003101075974; Thu, 16 Aug 2018 00:25:00 +0000 (UTC) (envelope-from samy.mahmoudi@gmail.com) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (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 66CCA8470D; Thu, 16 Aug 2018 00:25:00 +0000 (UTC) (envelope-from samy.mahmoudi@gmail.com) Received: by mail-pf1-x42a.google.com with SMTP id e13-v6so1188497pff.7; Wed, 15 Aug 2018 17:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hzOHznmVQzqFFzHlRxqVGoZsaCP0LFHd/gkgA2fzjK4=; b=ANzwM4gsMiZ03ivsdWzlHcIrBgqJJpwRXbL5w8pGXeuArKYgxoHZ6Zc0Tl9UGKr7vw jpHBxQDjDEIdM9siJ1iInx0qn6yn0u2nFSVNg3oKYPafjytQJTsmRtoK8nni3OzVOBwt 353f/VdviSri1Lcr989j9dvcxb5fpmrZby6j29hfaM6AhBUxxwqxtY7eDID+GHmdsapT PlxoLqiiw/2t63C+qvD/xRY0VEy66EgCF7L8UwCpaPNZL5aqAtUnc4mPSS0lBGeD7i/7 wW93fNt2q2lvYeGTBRF68RCKM/5rgLYlObaWdW1kvSOYI/N/xTlvF0scONxkjaEpnNBl wExg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hzOHznmVQzqFFzHlRxqVGoZsaCP0LFHd/gkgA2fzjK4=; b=s6vMDJmWtU/bOtxecAk14Uxi4VT9G/EEk/Z9YoAyELMVy1GZFWGOjN0qHhUUiArTtI X8RYx8Q0+HcxYcfrSPkLGDGhMPTWbIZhVr8al5TxPdw5eE9QC60GhzWl+Hj010bhTgUS QmcwFeaZ7rZhz+LNEVaXFz6L2CGxrSkNsWGaFq6uVXwE+tIoHrmlirBhKWYGo19sFNl+ Aa7ol8X6MkG18S22kiyGmbTcC8a0wH2WGtbHOlRN15Ak3wxfnJ4SedNT903CCnP93iCK nqY5ZpeafrN8sCJTCkL43u8W1D1IyR0ceSc5INFYAmUEHe+5jdC0kkTwcIYxdocCxviO TJjg== X-Gm-Message-State: AOUpUlEGUfdcMKRuSvnnC7mTbdIHmjjTVOFs3RBh1MvB6pNOJ8dTXs76 cEI/1yPQYBeY2AhX4b5IxO9DlqRlGS4ni77+QTOjLNU1 X-Google-Smtp-Source: AA+uWPzUTPmjK7BG+uq1RQOMweEjCsdJVBzhS6GaVJbS79/6hOQV7cXlwRTIq04PvHDdgHOxN4FHSs+xSay64vHGUDc= X-Received: by 2002:a65:5a8a:: with SMTP id c10-v6mr26142687pgt.389.1534379097570; Wed, 15 Aug 2018 17:24:57 -0700 (PDT) MIME-Version: 1.0 References: <201808151734.w7FHYE9r048846@pdx.rh.CN85.dnsmgr.net> <1534375319.1005259.1475586528.5E9C2023@webmail.messagingengine.com> In-Reply-To: <1534375319.1005259.1475586528.5E9C2023@webmail.messagingengine.com> From: Samy Mahmoudi Date: Thu, 16 Aug 2018 02:24:45 +0200 Message-ID: Subject: Re: svn commit: r337857 - in head: bin/csh bin/sh etc To: brd@freebsd.org Cc: rgrimes@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 00:25:01 -0000 Two days ago, I changed my beadm-compatible layout to have /root on a dedicated filesystem, separated from /. Then I upgraded to current and noticed two ln output errors. After some time cruising the FreeBSD source tree, I came to the conclusion that .cshrc and .profile were installed to the /root filesystem and that the two subsequent hardlinks failed because the respective targets .cshrc and .profile were (in my case) on a different filesystem, namely /. Is there any historical reason for hardlinking instead of softlinking ? Anyway, I will definitely keep an eye on your better approach. Le jeu. 16 ao=C3=BBt 2018 =C3=A0 01:22, Brad Davis a =C3= =A9crit : > On Wed, Aug 15, 2018, at 11:34 AM, Rodney W. Grimes wrote: > > > > > Author: brd > > > > > Date: Wed Aug 15 16:22:12 2018 > > > > > New Revision: 337857 > > > > > URL: https://svnweb.freebsd.org/changeset/base/337857 > > > > > > > > > > Log: > > > > > Fix build after r337849 > > > > > > > > > > This moves the symlink creation to after where the files are > installed. > > > > > > > > > > This also inverts the shell change so that it only happens if > MK_TCSH is on. > > > > > > > > > > Approved by: will (mentor) > > > > > Differential Revision: https://reviews.freebsd.org/D1672= 5 > > > > > > > > > > Modified: > > > > > head/bin/csh/Makefile > > > > > head/bin/sh/Makefile > > > > > head/etc/master.passwd > > > > > > > > > > Modified: head/bin/csh/Makefile > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > > > > --- head/bin/csh/Makefile Wed Aug 15 16:16:59 2018 > (r337856) > > > > > +++ head/bin/csh/Makefile Wed Aug 15 16:22:12 2018 > (r337857) > > > > > @@ -49,8 +49,7 @@ MLINKS=3D csh.1 tcsh.1 > > > > > > > > > > LIBADD=3D termcapw crypt > > > > > > > > > > -LINKS=3D ${BINDIR}/csh ${BINDIR}/tcsh \ > > > > > - /root/.cshrc /.cshrc > > > > > +LINKS=3D ${BINDIR}/csh ${BINDIR}/tcsh > > > > > > > > > > CLEANFILES=3D ${GENHDRS} gethost csh.1 > > > > > > > > > > @@ -158,7 +157,7 @@ beforeinstall: > > > > > rm -f ${DESTDIR}/.cshrc > > > > > > > > > > afterinstallconfig: > > > > > - sed -i "" -e 's;/bin/csh;/bin/sh;' > ${DESTDIR}/etc/master.passwd > > > > > + sed -i "" -e 's;/bin/sh;/bin/csh;' > ${DESTDIR}/etc/master.passwd > > > > > pwd_mkdb -i -p -d ${DESTDIR}/etc > ${DESTDIR}/etc/master.passwd > > > > > > > > > > .include > > > > > > > > > > Modified: head/bin/sh/Makefile > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > > > > --- head/bin/sh/Makefile Wed Aug 15 16:16:59 2018 > (r337856) > > > > > +++ head/bin/sh/Makefile Wed Aug 15 16:22:12 2018 > (r337857) > > > > > @@ -37,7 +37,6 @@ WFORMAT=3D0 > > > > > > > > > > CLEANFILES+=3D mknodes mksyntax > > > > > CLEANFILES+=3D ${GENSRCS} ${GENHDRS} > > > > > -LINKS=3D /root/.profile /.profile > > > > > > > > > > build-tools: mknodes mksyntax > > > > > > > > > > @@ -66,5 +65,8 @@ SUBDIR.${MK_TESTS}+=3D tests > > > > > > > > > > beforeinstall: > > > > > rm -f ${DESTDIR}/.profile > > > > > > > > Still unconditionally removing /.profile, but only replacing it > > > > when installconfig: is run. > > > > > > Yes, working on a separate review for this.. > > > > > > > > + > > > > > +afterinstallconfig: > > > > > + ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile > ${DESTDIR}/.profile > > > > > > > > > > .include > > > > > > > > > > Modified: head/etc/master.passwd > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/master.passwd Wed Aug 15 16:16:59 2018 > (r337856) > > > > > +++ head/etc/master.passwd Wed Aug 15 16:22:12 2018 > (r337857) > > > > > @@ -1,6 +1,6 @@ > > > > > # $FreeBSD$ > > > > > # > > > > > -root::0:0::0:0:Charlie &:/root:/bin/csh > > > > > +root::0:0::0:0:Charlie &:/root:/bin/sh > > > > > > > > I strongly object to this change to master.passwd, and feel it shou= ld > > > > be worked around if in anyway possible. I have pointed out in the > > > > review ways to not have to make this change. > > > > > > I opened up the following which addresses some of your feedback: > > > https://reviews.freebsd.org/D16728 > > > > Bleh, can we revert all of this, and take a second look with many more > > eyes on this. master.passwd coming from libc makes my head hurt! > > > > Also this is now a patch on a patch on a patch, time to end the dive > > down the rabbit hole! > > Yes, I did a partial revert of the problematic spots in r337882. > > I will redo with a better approach tomorrow. > > Sorry for the trouble and your .cshrc getting clobbered. > > > Regards, > Brad Davis > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Thu Aug 16 00:50: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 5F0741076558; Thu, 16 Aug 2018 00:50:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1504E857D3; Thu, 16 Aug 2018 00:50:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA4A9121AB; Thu, 16 Aug 2018 00:50:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7G0oEiM091023; Thu, 16 Aug 2018 00:50:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G0oEud091021; Thu, 16 Aug 2018 00:50:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201808160050.w7G0oEud091021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 16 Aug 2018 00:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337883 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 00:50:15 -0000 Author: mav Date: Thu Aug 16 00:50:14 2018 New Revision: 337883 URL: https://svnweb.freebsd.org/changeset/base/337883 Log: Add couple tunables/sysctl, missed in r336949. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Wed Aug 15 23:18:34 2018 (r337882) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Aug 16 00:50:14 2018 (r337883) @@ -437,6 +437,10 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, spa_min_slop, CTLFLAG int spa_allocators = 4; +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_allocators, CTLFLAG_RWTUN, + &spa_allocators, 0, + "Number of allocators per metaslab group"); + /*PRINTFLIKE2*/ void spa_load_failed(spa_t *spa, const char *fmt, ...) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Wed Aug 15 23:18:34 2018 (r337882) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Thu Aug 16 00:50:14 2018 (r337883) @@ -267,6 +267,9 @@ SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, write_gap_limit, C SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, queue_depth_pct, CTLFLAG_RWTUN, &zfs_vdev_queue_depth_pct, 0, "Queue depth percentage for each top-level"); +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, def_queue_depth, CTLFLAG_RWTUN, + &zfs_vdev_def_queue_depth, 0, + "Default queue depth for each allocator"); static int sysctl_zfs_async_write_active_min_dirty_percent(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@freebsd.org Thu Aug 16 01:02:02 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 9F0AB1076803; Thu, 16 Aug 2018 01:02:02 +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 0C50185D5C; Thu, 16 Aug 2018 01:02:01 +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 w7G11x16051009; Wed, 15 Aug 2018 18:01:59 -0700 (PDT) (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 w7G11wZD051008; Wed, 15 Aug 2018 18:01:58 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808160101.w7G11wZD051008@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337826 - stable/11/bin/ls In-Reply-To: To: Kyle Evans Date: Wed, 15 Aug 2018 18:01:58 -0700 (PDT) CC: "Rodney W. Grimes" , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 01:02:02 -0000 > On Wed, Aug 15, 2018 at 2:55 PM, Rodney W. Grimes > wrote: > >> On Wed, Aug 15, 2018 at 2:34 PM, Rodney W. Grimes > >> wrote: > >> > [ Charset UTF-8 unsupported, converting... ] > >> >> On Wed, Aug 15, 2018 at 12:43 PM, Rodney W. Grimes > >> >> wrote: > >> >> > > >> >> > From the Linux man page at: http://man7.org/linux/man-pages/man1/ls.1.html > >> >> > > >> >> > Using color to distinguish file types is disabled both by default and > >> >> > with --color=never. With --color=auto, ls emits color codes only > >> >> > when standard output is connected to a terminal. The LS_COLORS > >> >> > environment variable can change the settings. Use the dircolors > >> >> > command to set it. > >> >> > > >> >> > Um, so by default we should not be doing any colour... and we are... > >> >> > > >> >> > >> >> I don't recall making any argument that we're trying to match GNU > >> >> ls(1) behavior. Furthermore, again, we aren't doing any color by > >> >> default- only when the COLORTERM environment variable is set. > >> > > >> > So we are intentially being different? > >> > > >> > >> No, we are not intentionally being different. See: the next paragraph, > >> where I described that we've now-historically been honoring an > >> environment variable for this and have simply added a more standard > >> name for this variable. > > > > And one that is set by default many more places than the one that > > had been set before, changing behavior people have been seeing for > > a long time, and some of those people did not expect that, > > nor seem to want it either. > > Will backing out the MFC and leaving this a 12.0 feature end this? =( >From some other private discussion with Warner I think it may be wise at this time to revert the MFC until some other things are done in 12.0 to address some of the concerns and merge a more complete solution. Thanks, Rod -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 16 01:05:41 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 619AF10769DF for ; Thu, 16 Aug 2018 01:05:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (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 6867B8608D for ; Thu, 16 Aug 2018 01:05:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id 72-v6so4204659itw.3 for ; Wed, 15 Aug 2018 18:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/BAEypin/3PcM7TlEV8VQ9LiVEogkgfwM37m43KpeA8=; b=QInY2lPMGM8V58tqbuPRv6uSvJD9RXGGRSmEM4Zy44ScKkStTi1moPDblr/KVmRjb+ V7AhLp0a2QFWu/ou8A+Ign987auxiMYYBRADZVMtCMmfb4yxWsQrAYaKPkip3B9ledFh O1t9g5RhO8+LF2+qrbO/HMWklTsmaA7ahnhGfievDqJuj4Mny/xqAMQJAKqQfKfoUEQP HKYoLhcCdSGB+tLla/bZAHjJXrQYOBpCCtI1UmO4mRZQr/L6yqKjtdXP5UcJNtHjgWnJ bfNTWhb0IKFhSdMnfVTz0zfronMxK5M3qLKGKjCO7Zlmspa2vId2uyQuf7FdThIgsbyi fO1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=/BAEypin/3PcM7TlEV8VQ9LiVEogkgfwM37m43KpeA8=; b=BYC4f3Sq4PfYgYl1njDlsKW9J7N+JqRHO+95E2vqmeV9ahD2U8Pj/d5GYqVXArFnd2 9T4TP6PJaV4fssWt0LRUGu0CQWwlKrfZQnJYAnTm+UZ+azU2EljqYoMegzX1JPBdOgay i1lGyxhqyw0r39eVVZgVLc6Y2rledKkMADS+cFlQgEZTZ10lGYX86Q5arYmp5NzPDi8w cxHC3SmCFSkoHBbJp4ErzLVyRq81g7+DtqsMRyrXb+hT04HllH9FMkN4Xwetp4NO40bP cWbNTsSNucRmFu3VEFNiTui3ihM7h2VtyAew0Slscf4u7SAWbHYV7mtDhPZqsUQ3J8Yi peiw== X-Gm-Message-State: AOUpUlH5krwi6od0OtoJi91e+saNbHlZU+QcYLo7kS31IC69V8SQCvrW iy0VWDdICkU/3DDSYPiKONwfFwJIrJ3RsCo4Fw+hJ1FTv0DiPA== X-Google-Smtp-Source: AA+uWPycQQ3zc6ES0XTh6ArSm/VyD82sorbFg7T72kgB/7ywS+MgqGhwpCvbB26I3o/a83lRdQt1Fsw4cIhrjeM8jFs= X-Received: by 2002:a24:3ec3:: with SMTP id s186-v6mr20006625its.73.1534381539623; Wed, 15 Aug 2018 18:05:39 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 18:05:38 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808152041.w7FKfbCU049764@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 15 Aug 2018 19:05:38 -0600 X-Google-Sender-Auth: WVhJ9sCkFsJYXDOohiJsAb3QA_M Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: "Rodney W. Grimes" Cc: Ian Lepore , Kyle Evans , Adam Weinberger , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Maste , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 01:05:41 -0000 On Wed, Aug 15, 2018 at 4:28 PM, Warner Losh wrote: > > > On Wed, Aug 15, 2018 at 2:41 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >> > On Wed, Aug 15, 2018 at 2:28 PM, Ian Lepore wrote: >> > >> > > On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: >> > > > > >> > > > > Will backing out the MFC and leaving this a 12.0 feature end this? >> > > > =( >> > > > >> > > > Sadly no, as the person responded with that reaction when >> > > > they installed 12.0-ALPHA :-(. >> > > >> > > So one whiner can demand of the project that any new feature be >> removed >> > > before a new release is made? >> > > >> > >> > This is a good change. I don't see why people are so fussed about it... >> For >> > people fighting colored environments a simple unsetenv COLORTERM seems >> to >> > solve this problem no only on FreeBSD but for any other system they have >> > access to... >> >> This is exactly the dismissive attitude by FreeBSD developers that >> I was speaking to in my reply to Ian. >> > > I see how it disagrees with you, but it's not dismissive. It's just asking > for better data to support your view given that in general when all systems > do X when Y happens, except FreeBSD, we generally make FreeBSD do X when Y > unless there's a compelling reason not to. I've not seen a compelling > reason not to yet. > > Basically, why should this be different than our general pattern of being > in line with industry standards? > > It has been pointed out privately to me that I was being dismissive in the second sentence. I accept that. I'd like to apologize for that. I just took a close look at both gnu coretuils' ls code and our ls code. There's one minor difference in behavior. With gnu ls, if COLORTERM is empty, it will be ignored. With our code, we'll assume an empty value means to use colors. That difference should be fixed. This difference is clear if you look at the unit-tests from coreutils ls as well. I'll leave for others to debate the meaning of 'standard behavior' and just focus on what gnu ls does, because that's what Linux users expect, and that is what the fix was designed to implement. There's a wide variety of terminals that set this, however. For info see https://gist. github.com/XVilka/8346728 which goes into detail about it wrt COLORTERM=truecolor, but is good reading. I have a patch to make the behavior the same that I've shared that fixes this, though it's a bit ugly. There's also -color=xxx in gnu ls that would be a more complete solution, but our current ls doesn't have long options at all, so it's more of a heavy lift to merge that functionality into our ls. Warner From owner-svn-src-all@freebsd.org Thu Aug 16 01:14: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 443A31076DEF for ; Thu, 16 Aug 2018 01:14:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (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 B4F028672E for ; Thu, 16 Aug 2018 01:14:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id z20-v6so2580067iol.0 for ; Wed, 15 Aug 2018 18:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=7aPG2bYa0x8p2miNEg9tBdPKobpwveAHxRWoHcoElyk=; b=fyvZuiitNwLWjg9iTkIAOYc0hXM7Pyk0LyAxgEa/5yvFpbNozgwdiQSbofyh9kv6rK E4vPZbdMxAEwZqjPZWzBPL0FNC/F60lhP/dzRtT7LGqBNUlEwmkWsIcxl1NhFWEdDHe8 +xZmfqPWny1oGiYjhwkwnptxNDoDwUOXFgnUfG+8UW4P4FANDGhcTGqZ2cKXCMwyIem0 sZZhCpF9Uhcvfsu/QuKdg6VuMEzHYa+PrCZ1LHO3s2ZS1PO+LPTuZzhelYPQ8OBv0EYH 7Y9fdaFUjnj7Uw+wM6l3Swu4zVvSvH2LZAUaTic3nUaoSxIUz8dQ/fSrn0iDNjsb6oiv TRlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=7aPG2bYa0x8p2miNEg9tBdPKobpwveAHxRWoHcoElyk=; b=BVSxzjp4/uUB7ha7bZ3liWFirW3qP6Dz207eJiyExO9cNUSx2sFJmGSSpK+sokOgTC zAFYVIIO1oXLjtrEOBuqbXCR7j512BC6rqD+1sXiOlWx+0og2cZWRXiDEce9zQPo1DVd 2JKuSi2JoxQhXmNCr3QNCAVLqB96AKatTv2xwIQUsHp8gqkYBYrNPZrs4Kl7kJdcbiRM LTYIGm58alGvfj/BWH+tSKjNef0fjRw54CytJMzdm71RNYRzOwEZrya2SDYDkEeGxK2i 1etMxWW/BZCUbALk5782zsz0TxFAxg8k8n4xEwVpViu/zBh2GnYUqB12yh9uTu3bYGNb POMg== X-Gm-Message-State: AOUpUlHJhxCYw9S/JhG689msw24Wjxi0OwxIaCzSXY3cwcbK+ILAB0k1 KrONkTCoCw1rc1nibDYO6TPoh5YY65WjAqfEfSpNLw== X-Google-Smtp-Source: AA+uWPypiT199q6B02eRPR1ujLGzYgOuCZfw9g3dJWQtRgaVvDNRbEmi3IeUdvn+lUrl9RNvqgIB7t4EmdewmaNpwZc= X-Received: by 2002:a6b:7117:: with SMTP id q23-v6mr7936373iog.37.1534382063037; Wed, 15 Aug 2018 18:14:23 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 18:14:22 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808152031.w7FKVCVa058677@repo.freebsd.org> From: Warner Losh Date: Wed, 15 Aug 2018 19:14:22 -0600 X-Google-Sender-Auth: o3kics-gVZJj27lFBlt_F32m_os Message-ID: Subject: Re: svn commit: r337868 - head/stand To: Kyle Evans Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 01:14:24 -0000 I'll give that a shot. I wonder why things are different in my test jig... Warner On Wed, Aug 15, 2018 at 5:49 PM, Kyle Evans wrote: > https://ci.freebsd.org/job/FreeBSD-head-mips-build/3874/console at least; > a local make -j8 TARGET_ARCH=mips buildworld also failed a while ago > > > On Wed, Aug 15, 2018, 18:36 Warner Losh wrote: > >> which mips builds? My automated mips and mips64 builds just work... >> >> Warner >> >> On Wed, Aug 15, 2018 at 3:22 PM, Kyle Evans wrote: >> >>> On Wed, Aug 15, 2018 at 3:31 PM, Warner Losh wrote: >>> > Author: imp >>> > Date: Wed Aug 15 20:31:11 2018 >>> > New Revision: 337868 >>> > URL: https://svnweb.freebsd.org/changeset/base/337868 >>> > >>> > Log: >>> > stand: Use -Oz/-Os for all loader/stand builds. >>> > >>> > While we're not super size constrained, the x86 BIOS /boot/loader has >>> > to be less than about 520k-530k to be reliable. The LUA loader is at >>> > this size today. -Oz saves 15-20% on the size, keeping us safely >>> small >>> > enough (comparable to where we were with the 4th loader). This will >>> > also help with sjg's work on bringing in bearssl, though we may again >>> > be looking for space in the LUA loader. >>> > >>> > Size table for clang 6.0.0: >>> > default -O1 -Os -Oz >>> > 4th 442368 417792 389120 376832 >>> > lua 524288 479232 446464 430080 >>> > >>> > Tested by: kevans91@ (ubldr on armv7), dhw@ (loader on amdy64) >>> > Differential Revision: https://reviews.freebsd.org/D16724 >>> > >>> >>> This seems to have frustrated the MIPS build: >>> >>> --- ubldr --- >>> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >>> `block_map': >>> /usr/src/stand/libsa/ufs.c:277: undefined reference to `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:277: relocation truncated to fit: R_MIPS_26 >>> against `__ashldi3' >>> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >>> `buf_read_file': >>> /usr/src/stand/libsa/ufs.c:402: undefined reference to `__ashrdi3' >>> /usr/src/stand/libsa/ufs.c:402: relocation truncated to fit: R_MIPS_26 >>> against `__ashrdi3' >>> /usr/src/stand/libsa/ufs.c:403: undefined reference to `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:403: relocation truncated to fit: R_MIPS_26 >>> against `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:418: undefined reference to `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:418: relocation truncated to fit: R_MIPS_26 >>> against `__ashldi3' >>> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >>> `buf_write_file': >>> /usr/src/stand/libsa/ufs.c:327: undefined reference to `__ashrdi3' >>> /usr/src/stand/libsa/ufs.c:327: relocation truncated to fit: R_MIPS_26 >>> against `__ashrdi3' >>> /usr/src/stand/libsa/ufs.c:328: undefined reference to `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:328: relocation truncated to fit: R_MIPS_26 >>> against `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:358: undefined reference to `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:358: relocation truncated to fit: R_MIPS_26 >>> against `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:377: undefined reference to `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:377: relocation truncated to fit: R_MIPS_26 >>> against `__ashldi3' >>> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >>> `read_inode': >>> /usr/src/stand/libsa/ufs.c:166: undefined reference to `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:166: relocation truncated to fit: R_MIPS_26 >>> against `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:166: undefined reference to `__ashldi3' >>> /usr/src/stand/libsa/ufs.c:166: relocation truncated to fit: R_MIPS_26 >>> against `__ashldi3' >>> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o):/ >>> usr/src/stand/libsa/ufs.c:638: >>> more undefined references to `__ashldi3' follow >>> /usr/obj/usr/src/mips.mips/stand/libsa/libsa.a(ufs.o): In function >>> `ufs_open': >>> /usr/src/stand/libsa/ufs.c:638: additional relocation overflows >>> omitted from the output >>> >> >> From owner-svn-src-all@freebsd.org Thu Aug 16 01:18:22 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 16DFB1076F4D; Thu, 16 Aug 2018 01:18:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C147B8690D; Thu, 16 Aug 2018 01:18:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 999CC1267D; Thu, 16 Aug 2018 01:18:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7G1ILxp006513; Thu, 16 Aug 2018 01:18:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G1IL90006511; Thu, 16 Aug 2018 01:18:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808160118.w7G1IL90006511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Aug 2018 01:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337884 - stable/11/bin/ls X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/bin/ls X-SVN-Commit-Revision: 337884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 01:18:22 -0000 Author: kevans Date: Thu Aug 16 01:18:20 2018 New Revision: 337884 URL: https://svnweb.freebsd.org/changeset/base/337884 Log: Revert r337826: MFC of ls(1) COLORTERM honoring It was not ready, and was much-objected-to. Modified: stable/11/bin/ls/ls.1 stable/11/bin/ls/ls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ls/ls.1 ============================================================================== --- stable/11/bin/ls/ls.1 Thu Aug 16 00:50:14 2018 (r337883) +++ stable/11/bin/ls/ls.1 Thu Aug 16 01:18:20 2018 (r337884) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd August 8, 2018 +.Dd December 1, 2015 .Dt LS 1 .Os .Sh NAME @@ -140,8 +140,6 @@ after each that is a Enable colorized output. This option is equivalent to defining .Ev CLICOLOR -or -.Ev COLORTERM in the environment. (See below.) This functionality can be compiled out by removing the definition of @@ -638,10 +636,6 @@ The variable still needs to reference a color capable terminal however otherwise it is not possible to determine which color sequences to use. -.It Ev COLORTERM -See description for -.Ev CLICOLOR -above. .It Ev COLUMNS If this variable contains a string representing a decimal integer, it is used as the @@ -666,9 +660,7 @@ for more information. .It Ev LSCOLORS The value of this variable describes what color to use for which attribute when colors are enabled with -.Ev CLICOLOR -or -.Ev COLORTERM . +.Ev CLICOLOR . This string is a concatenation of pairs of the format .Ar f Ns Ar b , where @@ -775,8 +767,6 @@ option for more details. .It Ev TERM The .Ev CLICOLOR -and -.Ev COLORTERM functionality depends on a terminal type with color capabilities. .It Ev TZ The timezone to use when displaying dates. Modified: stable/11/bin/ls/ls.c ============================================================================== --- stable/11/bin/ls/ls.c Thu Aug 16 00:50:14 2018 (r337883) +++ stable/11/bin/ls/ls.c Thu Aug 16 01:18:20 2018 (r337884) @@ -374,7 +374,7 @@ main(int argc, char *argv[]) f_listdot = 1; /* Enabling of colours is conditional on the environment. */ - if ((getenv("CLICOLOR") || getenv("COLORTERM")) && + if (getenv("CLICOLOR") && (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) #ifdef COLORLS if (tgetent(termcapbuf, getenv("TERM")) == 1) { From owner-svn-src-all@freebsd.org Thu Aug 16 01:24: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 5ECE210773E3; Thu, 16 Aug 2018 01:24:03 +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 CAAED86E81; Thu, 16 Aug 2018 01:24:02 +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 w7G1O1WM051119; Wed, 15 Aug 2018 18:24:01 -0700 (PDT) (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 w7G1O1mb051118; Wed, 15 Aug 2018 18:24:01 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808160124.w7G1O1mb051118@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337884 - stable/11/bin/ls In-Reply-To: <201808160118.w7G1IL90006511@repo.freebsd.org> To: Kyle Evans Date: Wed, 15 Aug 2018 18:24:01 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 01:24:03 -0000 > Author: kevans > Date: Thu Aug 16 01:18:20 2018 > New Revision: 337884 > URL: https://svnweb.freebsd.org/changeset/base/337884 > > Log: > Revert r337826: MFC of ls(1) COLORTERM honoring > > It was not ready, and was much-objected-to. Thanks, just objected to, not much. I think once the --color=foo and the NULL COLORTERM fix goes in this should work as expected and not cause the issue seen by the user, or if it does I can tell them how to get color VIM, but not color ls without too much magic. > > Modified: > stable/11/bin/ls/ls.1 > stable/11/bin/ls/ls.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/bin/ls/ls.1 > ============================================================================== > --- stable/11/bin/ls/ls.1 Thu Aug 16 00:50:14 2018 (r337883) > +++ stable/11/bin/ls/ls.1 Thu Aug 16 01:18:20 2018 (r337884) > @@ -32,7 +32,7 @@ > .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 > .\" $FreeBSD$ > .\" > -.Dd August 8, 2018 > +.Dd December 1, 2015 > .Dt LS 1 > .Os > .Sh NAME > @@ -140,8 +140,6 @@ after each that is a > Enable colorized output. > This option is equivalent to defining > .Ev CLICOLOR > -or > -.Ev COLORTERM > in the environment. > (See below.) > This functionality can be compiled out by removing the definition of > @@ -638,10 +636,6 @@ The > variable still needs to reference a color capable terminal however > otherwise it is not possible to determine which color sequences to > use. > -.It Ev COLORTERM > -See description for > -.Ev CLICOLOR > -above. > .It Ev COLUMNS > If this variable contains a string representing a > decimal integer, it is used as the > @@ -666,9 +660,7 @@ for more information. > .It Ev LSCOLORS > The value of this variable describes what color to use for which > attribute when colors are enabled with > -.Ev CLICOLOR > -or > -.Ev COLORTERM . > +.Ev CLICOLOR . > This string is a concatenation of pairs of the format > .Ar f Ns Ar b , > where > @@ -775,8 +767,6 @@ option for more details. > .It Ev TERM > The > .Ev CLICOLOR > -and > -.Ev COLORTERM > functionality depends on a terminal type with color capabilities. > .It Ev TZ > The timezone to use when displaying dates. > > Modified: stable/11/bin/ls/ls.c > ============================================================================== > --- stable/11/bin/ls/ls.c Thu Aug 16 00:50:14 2018 (r337883) > +++ stable/11/bin/ls/ls.c Thu Aug 16 01:18:20 2018 (r337884) > @@ -374,7 +374,7 @@ main(int argc, char *argv[]) > f_listdot = 1; > > /* Enabling of colours is conditional on the environment. */ > - if ((getenv("CLICOLOR") || getenv("COLORTERM")) && > + if (getenv("CLICOLOR") && > (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) > #ifdef COLORLS > if (tgetent(termcapbuf, getenv("TERM")) == 1) { > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 16 01:27:17 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 0F6581077588; Thu, 16 Aug 2018 01:27:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B94E087195; Thu, 16 Aug 2018 01:27:16 +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 9B99F1283C; Thu, 16 Aug 2018 01:27:16 +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 w7G1RGEn011483; Thu, 16 Aug 2018 01:27:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G1RGZr011482; Thu, 16 Aug 2018 01:27:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808160127.w7G1RGZr011482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Aug 2018 01:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337885 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 337885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 01:27:17 -0000 Author: kevans Date: Thu Aug 16 01:27:16 2018 New Revision: 337885 URL: https://svnweb.freebsd.org/changeset/base/337885 Log: ls(1): Fix color env var checking CLICOLOR will behavior as always- if present at all in the environment, allow colors. COLORTERM, recently enforced, will have to be both present and not empty. Submitted by: imp Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Thu Aug 16 01:18:20 2018 (r337884) +++ head/bin/ls/ls.c Thu Aug 16 01:27:16 2018 (r337885) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -152,6 +153,29 @@ char *enter_bold; /* ANSI sequence to set color to bo static int rval; +static bool +do_color_from_env(void) +{ + const char *p; + bool doit; + + doit = false; + p = getenv("CLICOLOR"); + if (p == NULL) { + /* + * COLORTERM is the more standard name for this variable. We'll + * honor it as long as it's both set and not empty. + */ + p = getenv("COLORTERM"); + if (p != NULL && *p != '\0') + doit = true; + } else + doit = true; + + return (doit && + (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))); +} + int main(int argc, char *argv[]) { @@ -368,8 +392,7 @@ main(int argc, char *argv[]) f_listdot = 1; /* Enabling of colours is conditional on the environment. */ - if ((getenv("CLICOLOR") || getenv("COLORTERM")) && - (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) + if (do_color_from_env()) #ifdef COLORLS if (tgetent(termcapbuf, getenv("TERM")) == 1) { ansi_fgcol = tgetstr("AF", &bp); From owner-svn-src-all@freebsd.org Thu Aug 16 06:20:26 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 1A526107EA6F; Thu, 16 Aug 2018 06:20:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C256F8F9EB; Thu, 16 Aug 2018 06:20:25 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1A5915873; Thu, 16 Aug 2018 06:20:25 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7G6KP3v059347; Thu, 16 Aug 2018 06:20:25 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G6KP9M059346; Thu, 16 Aug 2018 06:20:25 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201808160620.w7G6KP9M059346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 16 Aug 2018 06:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337886 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 337886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 06:20:26 -0000 Author: araujo Date: Thu Aug 16 06:20:25 2018 New Revision: 337886 URL: https://svnweb.freebsd.org/changeset/base/337886 Log: Increase the mask from 15 to 255 or otherwise NVME_FEAT_SOFTWARE_PROGRESS will never be reached. Discussed with: Leon Dang and Darius Mihai MFC after: 1 week. Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 01:27:16 2018 (r337885) +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 (r337886) @@ -653,7 +653,7 @@ static int nvme_opc_set_features(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { - int feature = command->cdw10 & 0x0F; + int feature = command->cdw10 & 0xFF; uint32_t iv; DPRINTF(("%s feature 0x%x\r\n", __func__, feature)); @@ -748,7 +748,7 @@ static int nvme_opc_get_features(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { - int feature = command->cdw10 & 0x0F; + int feature = command->cdw10 & 0xFF; DPRINTF(("%s feature 0x%x\r\n", __func__, feature)); From owner-svn-src-all@freebsd.org Thu Aug 16 06:31:55 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 27A06107EE77; Thu, 16 Aug 2018 06:31:55 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFF918FF89; Thu, 16 Aug 2018 06:31:54 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B13B715B7C; Thu, 16 Aug 2018 06:31:54 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7G6VsRm064580; Thu, 16 Aug 2018 06:31:54 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G6VsS8064579; Thu, 16 Aug 2018 06:31:54 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201808160631.w7G6VsS8064579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 16 Aug 2018 06:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337887 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 337887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 06:31:55 -0000 Author: araujo Date: Thu Aug 16 06:31:54 2018 New Revision: 337887 URL: https://svnweb.freebsd.org/changeset/base/337887 Log: Add a comment explaining how the PSN works and why there is no need for a null terminator. Also mark CID 1394825 as intentional. Reported by: Coverity CID: 1394825 MFC after: 1 week Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 (r337886) +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 (r337887) @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o } else if (!strcmp("sectsz", xopts)) { sectsz = atoi(config); } else if (!strcmp("ser", xopts)) { + /* + * This field indicates the Product Serial Number in + * 8-bit ASCII, unused bytes should be NULL characters. + * Ref: NVM Express Management Interface 1.0a. + */ memset(sc->ctrldata.sn, 0, sizeof(sc->ctrldata.sn)); strncpy(sc->ctrldata.sn, config, sizeof(sc->ctrldata.sn)); From owner-svn-src-all@freebsd.org Thu Aug 16 06:35:45 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 EE8C1107EFD5; Thu, 16 Aug 2018 06:35:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A355C702C8; Thu, 16 Aug 2018 06:35:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81AF115BAF; Thu, 16 Aug 2018 06:35:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7G6ZiqX069622; Thu, 16 Aug 2018 06:35:44 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G6Zi83069621; Thu, 16 Aug 2018 06:35:44 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201808160635.w7G6Zi83069621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 16 Aug 2018 06:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337888 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 337888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 06:35:45 -0000 Author: araujo Date: Thu Aug 16 06:35:44 2018 New Revision: 337888 URL: https://svnweb.freebsd.org/changeset/base/337888 Log: Remove duplicated code. Reported by: Coverity CID: 1394893 MFC after: 1 week Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 (r337887) +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:35:44 2018 (r337888) @@ -1159,11 +1159,6 @@ pci_nvme_io_done(struct blockif_req *br, int err) DPRINTF(("%s error %d %s\r\n", __func__, err, strerror(err))); /* TODO return correct error */ - if (err) - code = NVME_SC_DATA_TRANSFER_ERROR; - else - code = NVME_SC_SUCCESS; - code = err ? NVME_SC_DATA_TRANSFER_ERROR : NVME_SC_SUCCESS; pci_nvme_status_genc(&status, code); From owner-svn-src-all@freebsd.org Thu Aug 16 06:38:02 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 C00B9107F06B; Thu, 16 Aug 2018 06:38:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CC0270444; Thu, 16 Aug 2018 06:38:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B6D215BB1; Thu, 16 Aug 2018 06:38:02 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7G6c2TP069756; Thu, 16 Aug 2018 06:38:02 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G6c2CS069755; Thu, 16 Aug 2018 06:38:02 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201808160638.w7G6c2CS069755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 16 Aug 2018 06:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337889 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 337889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 06:38:02 -0000 Author: araujo Date: Thu Aug 16 06:38:01 2018 New Revision: 337889 URL: https://svnweb.freebsd.org/changeset/base/337889 Log: Fix a resource leak when using strdup(3) and also fix few style(9). Reported by: Coverity CID: 1394929 MFC after: 1 week Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:35:44 2018 (r337888) +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:38:01 2018 (r337889) @@ -1746,6 +1746,8 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o optidx++; } + free(uopt); + if (sc->nvstore.ctx == NULL || sc->nvstore.size == 0) { fprintf(stderr, "backing store not specified\n"); return (-1); @@ -1756,9 +1758,7 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o sc->nvstore.sectsz = blockif_sectsz(sc->nvstore.ctx); for (sc->nvstore.sectsz_bits = 9; (1 << sc->nvstore.sectsz_bits) < sc->nvstore.sectsz; - sc->nvstore.sectsz_bits++) - ; - + sc->nvstore.sectsz_bits++); if (sc->max_queues == 0) { fprintf(stderr, "Invalid maxq option\n"); From owner-svn-src-all@freebsd.org Thu Aug 16 06:50: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 8EFEA107F46C; Thu, 16 Aug 2018 06:50:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 451A470ADF; Thu, 16 Aug 2018 06:50:54 +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 25BCF15D6A; Thu, 16 Aug 2018 06:50:54 +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 w7G6or9a076221; Thu, 16 Aug 2018 06:50:53 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G6orwQ076220; Thu, 16 Aug 2018 06:50:53 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808160650.w7G6orwQ076220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 16 Aug 2018 06:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337890 - 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: 337890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 06:50:54 -0000 Author: tsoome Date: Thu Aug 16 06:50:53 2018 New Revision: 337890 URL: https://svnweb.freebsd.org/changeset/base/337890 Log: libi386: small style updates in biosdisk Use break instead of return in for loop, as done earlier. Insert and remove some blank lines. No functional changes intended. Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Thu Aug 16 06:38:01 2018 (r337889) +++ head/stand/i386/libi386/biosdisk.c Thu Aug 16 06:50:53 2018 (r337890) @@ -306,6 +306,7 @@ bd_print(int verbose) bdinfo[i].bd_sectorsize); if ((ret = pager_output(line)) != 0) break; + dev.dd.d_dev = &biosdisk; dev.dd.d_unit = i; dev.d_slice = -1; @@ -317,7 +318,7 @@ bd_print(int verbose) ret = disk_print(&dev, line, verbose); disk_close(&dev); if (ret != 0) - return (ret); + break; } } return (ret); @@ -385,7 +386,6 @@ bd_open(struct open_file *f, ...) BD(dev).bd_bcache = NULL; } } - return (rc); } From owner-svn-src-all@freebsd.org Thu Aug 16 06:59:28 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 02BDD107F7B5; Thu, 16 Aug 2018 06:59: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 90CF670F67; Thu, 16 Aug 2018 06:59:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [51.52.172.98]) by mail.baldwin.cx (Postfix) with ESMTPSA id 9E32010A87D; Thu, 16 Aug 2018 02:59:25 -0400 (EDT) Subject: Re: svn commit: r337878 - head/stand/i386/libi386 To: Warner Losh , Ian Lepore References: <201808152225.w7FMP5J2018006@repo.freebsd.org> <1534372134.1466.21.camel@freebsd.org> Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <05b36083-9f4d-658e-ab39-e8c317d01db7@FreeBSD.org> Date: Thu, 16 Aug 2018 07:59:23 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: 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); Thu, 16 Aug 2018 02:59:26 -0400 (EDT) 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.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 06:59:28 -0000 On 8/15/18 11:59 PM, Warner Losh wrote: > > > On Wed, Aug 15, 2018 at 4:28 PM, Ian Lepore > wrote: > > On Wed, 2018-08-15 at 22:25 +0000, Toomas Soome wrote: > > Author: tsoome > > Date: Wed Aug 15 22:25:05 2018 > > New Revision: 337878 > > URL: https://svnweb.freebsd.org/changeset/base/337878 > > > > Log: > >   libi386: remove bd_read() and bd_write() wrappers > >    > >   Those wroappers are nice, but do not really add much value. > > > > Modified: > >   head/stand/i386/libi386/biosdisk.c > > > > Modified: head/stand/i386/libi386/biosdisk.c > > ===================================================================== > > ========= > > --- head/stand/i386/libi386/biosdisk.c        Wed Aug 15 21:47:03 > > 2018  (r337877) > > +++ head/stand/i386/libi386/biosdisk.c        Wed Aug 15 22:25:05 > > 2018  (r337878) > > @@ -94,10 +94,7 @@ static int nbdinfo = 0; > >   > >  static void bd_io_workaround(struct disk_devdesc *dev); > >   > > -static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, > > -    caddr_t dest); > > -static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int > > blks, > > -    caddr_t dest); > > +static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, int); > >  static int bd_int13probe(struct bdinfo *bd); > >   > >  static int bd_init(void); > > @@ -506,7 +503,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > > dblk, s > >       case F_READ: > >               DEBUG("read %d from %lld to %p", blks, dblk, buf); > >   > > -             if (blks && (rc = bd_read(dev, dblk, blks, buf))) { > > +             if (blks && (rc = bd_io(dev, dblk, blks, buf, 0))) { > >                       /* Filter out floppy controller errors */ > >                       if (BD(dev).bd_flags != BD_FLOPPY || rc != > > 0x20) { > >                               printf("read %d from %lld to %p, > > error: 0x%x\n", > > @@ -518,7 +515,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > > dblk, s > >       case F_WRITE : > >               DEBUG("write %d from %lld to %p", blks, dblk, buf); > >   > > -             if (blks && bd_write(dev, dblk, blks, buf)) { > > +             if (blks && bd_io(dev, dblk, blks, buf, 1)) { > >                       DEBUG("write error"); > >                       return (EIO); > >               } > > @@ -713,20 +710,6 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, > > int blks > >       } > >   > >       return (0); > > -} > > - > > -static int > > -bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > > dest) > > -{ > > - > > -     return (bd_io(dev, dblk, blks, dest, 0)); > > -} > > - > > -static int > > -bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > > dest) > > -{ > > - > > -     return (bd_io(dev, dblk, blks, dest, 1)); > >  } > >   > >  /* > > > > This would be a more satisfying change if there were something like > >  #define BD_RD 0 >  #define BD_WR 1 > > so that it was clear at a glance what a bd_io() call is doing. > > > I think that's a good idea... Arguably the bd_read/write wrappers were even clearer (and there purpose was readability in that case). -- John Baldwin From owner-svn-src-all@freebsd.org Thu Aug 16 07:10: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 EB5B8107FCD7; Thu, 16 Aug 2018 07:10:10 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96D6C71622; Thu, 16 Aug 2018 07:10:10 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) id <0PDJ00100L89Q900@st13p35im-asmtp001.me.com>; Thu, 16 Aug 2018 07:10:09 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPSA id <0PDJ00OSSL8UXU10@st13p35im-asmtp001.me.com>; Thu, 16 Aug 2018 07:10:09 +0000 (GMT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1808160077 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-16_03:,, signatures=0 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r337878 - head/stand/i386/libi386 From: Toomas Soome In-reply-to: <05b36083-9f4d-658e-ab39-e8c317d01db7@FreeBSD.org> Date: Thu, 16 Aug 2018 10:10:05 +0300 Cc: Warner Losh , Ian Lepore , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <18E7897D-9985-44CE-B648-2A839417B1BC@me.com> References: <201808152225.w7FMP5J2018006@repo.freebsd.org> <1534372134.1466.21.camel@freebsd.org> <05b36083-9f4d-658e-ab39-e8c317d01db7@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 07:10:11 -0000 > On 16 Aug 2018, at 09:59, John Baldwin wrote: >=20 > On 8/15/18 11:59 PM, Warner Losh wrote: >>=20 >>=20 >> On Wed, Aug 15, 2018 at 4:28 PM, Ian Lepore > wrote: >>=20 >> On Wed, 2018-08-15 at 22:25 +0000, Toomas Soome wrote: >>> Author: tsoome >>> Date: Wed Aug 15 22:25:05 2018 >>> New Revision: 337878 >>> URL: https://svnweb.freebsd.org/changeset/base/337878 = >>>=20 >>> Log: >>> libi386: remove bd_read() and bd_write() wrappers >>> =20 >>> Those wroappers are nice, but do not really add much value. >>>=20 >>> Modified: >>> head/stand/i386/libi386/biosdisk.c >>>=20 >>> Modified: head/stand/i386/libi386/biosdisk.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/stand/i386/libi386/biosdisk.c Wed Aug 15 21:47:03 >>> 2018 (r337877) >>> +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:25:05 >>> 2018 (r337878) >>> @@ -94,10 +94,7 @@ static int nbdinfo =3D 0; >>> =20 >>> static void bd_io_workaround(struct disk_devdesc *dev); >>> =20 >>> -static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int = blks, >>> - caddr_t dest); >>> -static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int >>> blks, >>> - caddr_t dest); >>> +static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, = int); >>> static int bd_int13probe(struct bdinfo *bd); >>> =20 >>> static int bd_init(void); >>> @@ -506,7 +503,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t >>> dblk, s >>> case F_READ: >>> DEBUG("read %d from %lld to %p", blks, dblk, buf); >>> =20 >>> - if (blks && (rc =3D bd_read(dev, dblk, blks, buf))) { >>> + if (blks && (rc =3D bd_io(dev, dblk, blks, buf, 0))) { >>> /* Filter out floppy controller errors */ >>> if (BD(dev).bd_flags !=3D BD_FLOPPY || rc !=3D >>> 0x20) { >>> printf("read %d from %lld to %p, >>> error: 0x%x\n", >>> @@ -518,7 +515,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t >>> dblk, s >>> case F_WRITE : >>> DEBUG("write %d from %lld to %p", blks, dblk, buf); >>> =20 >>> - if (blks && bd_write(dev, dblk, blks, buf)) { >>> + if (blks && bd_io(dev, dblk, blks, buf, 1)) { >>> DEBUG("write error"); >>> return (EIO); >>> } >>> @@ -713,20 +710,6 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, >>> int blks >>> } >>> =20 >>> return (0); >>> -} >>> - >>> -static int >>> -bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t >>> dest) >>> -{ >>> - >>> - return (bd_io(dev, dblk, blks, dest, 0)); >>> -} >>> - >>> -static int >>> -bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t >>> dest) >>> -{ >>> - >>> - return (bd_io(dev, dblk, blks, dest, 1)); >>> } >>> =20 >>> /* >>>=20 >>=20 >> This would be a more satisfying change if there were something = like >>=20 >> #define BD_RD 0 >> #define BD_WR 1 >>=20 >> so that it was clear at a glance what a bd_io() call is doing. >>=20 >>=20 >> I think that's a good idea... >=20 > Arguably the bd_read/write wrappers were even clearer (and there = purpose > was readability in that case). Yes thats true, but also will leave us in mercy of inlining etc.. = anyhow, *my* purpose is to get the line of changes done (to be able to = perform IO with >512 sector size, merge with bioscd.c and split up = floppy, cd and hdd cases, so the user can distinguish the devices.=20 rgds, toomas From owner-svn-src-all@freebsd.org Thu Aug 16 07:13:37 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 EBCAB107FFE9; Thu, 16 Aug 2018 07:13:36 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FE3E71A88; Thu, 16 Aug 2018 07:13:36 +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 817091625E; Thu, 16 Aug 2018 07:13:36 +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 w7G7DaCl090215; Thu, 16 Aug 2018 07:13:36 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G7DaPs090214; Thu, 16 Aug 2018 07:13:36 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808160713.w7G7DaPs090214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 16 Aug 2018 07:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337891 - 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: 337891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 07:13:37 -0000 Author: tsoome Date: Thu Aug 16 07:13:36 2018 New Revision: 337891 URL: https://svnweb.freebsd.org/changeset/base/337891 Log: libi386: bd_io_workaround() is to be called for reads only bd_io() can perform either reads or writes, we only need bd_io_workaround() for reads. Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Thu Aug 16 06:50:53 2018 (r337890) +++ head/stand/i386/libi386/biosdisk.c Thu Aug 16 07:13:36 2018 (r337891) @@ -601,7 +601,7 @@ bd_io_workaround(struct disk_devdesc *dev) { uint8_t buf[8 * 1024]; - bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, 0); + bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, BD_RD); } @@ -628,7 +628,7 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks * the buggy read. It is not immediately known whether other models * are similarly affected. */ - if (dblk >= 0x100000000) + if (dowrite == BD_RD && dblk >= 0x100000000) bd_io_workaround(dev); /* Decide whether we have to bounce */ From owner-svn-src-all@freebsd.org Thu Aug 16 07:34: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 8918810807B5; Thu, 16 Aug 2018 07:34:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8DD724AD; Thu, 16 Aug 2018 07:34:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F18C1658B; Thu, 16 Aug 2018 07:34:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7G7YBkd000365; Thu, 16 Aug 2018 07:34:11 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G7YBCL000364; Thu, 16 Aug 2018 07:34:11 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808160734.w7G7YBCL000364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 16 Aug 2018 07:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337892 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 337892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 07:34:11 -0000 Author: eadler Date: Thu Aug 16 07:34:10 2018 New Revision: 337892 URL: https://svnweb.freebsd.org/changeset/base/337892 Log: [pci_vendors] Update pci_vendors to 2018.08.12 Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Thu Aug 16 07:13:36 2018 (r337891) +++ head/share/misc/pci_vendors Thu Aug 16 07:34:10 2018 (r337892) @@ -2,8 +2,8 @@ # List of PCI ID's # -# Version: 2018.04.06 -# Date: 2018-04-06 03:15:02 +# Version: 2018.08.12 +# Date: 2018-08-12 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -27,6 +27,7 @@ # This is a relabelled RTL-8139 8139 AT-2500TX V3 Ethernet 0014 Loongson Technology LLC + 7a00 Hyper Transport Bridge Controller 7a02 APB (Advanced Peripheral Bus) Controller 7a03 Gigabit Ethernet Controller 7a04 OTG USB Controller @@ -34,9 +35,15 @@ 7a06 DC (Display Controller) 7a07 HDA (High Definition Audio) Controller 7a08 SATA AHCI Controller + 7a09 PCI-to-PCI Bridge + 7a0b SPI Controller + 7a0c LPC Controller 7a0f DMA (Direct Memory Access) Controller 7a14 EHCI USB Controller + 7a15 Vivante GPU (Graphics Processing Unit) + 7a19 PCI-to-PCI Bridge 7a24 OHCI USB Controller + 7a29 PCI-to-PCI Bridge 001c PEAK-System Technik GmbH 0001 PCAN-PCI CAN-Bus controller 001c 0004 2 Channel CAN Bus SJC1000 @@ -74,6 +81,7 @@ 000a TTP-Monitoring Card V2.0 0432 SCM Microsystems, Inc. 0001 Pluto2 DVB-T Receiver for PCMCIA [EasyWatch MobilSet] +0497 Dell Inc. (wrong ID) 0675 Dynalink 1700 IS64PH ISDN Adapter 1702 IS64PH ISDN Adapter @@ -421,6 +429,7 @@ 17aa 1052 ThinkServer RAID 720i 17aa 1053 ThinkServer RAID 720ix 1d49 0600 ThinkSystem RAID 730-8i 1GB Cache PCIe 12Gb Adapter + 1d49 0608 ThinkSystem RAID 730-8i 2GB Flash PCIe 12Gb Adapter 1d49 0609 ThinkSystem RAID 730-8i 4GB Flash PCIe 12Gb Adapter 8086 351e RMS3CC080 RAID Controller 8086 351f RMS3CC040 RAID Controller @@ -476,6 +485,7 @@ 0070 SAS2004 PCI-Express Fusion-MPT SAS-2 [Spitfire] 0071 MR SAS HBA 2004 0072 SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] + 1000 30b0 9200-8e [LSI SAS 6Gb/s SAS/SATA PCIe x8 External HBA] 1028 1f1c 6Gbps SAS HBA Adapter 1028 1f1d PERC H200 Adapter 1028 1f1e PERC H200 Integrated @@ -643,6 +653,8 @@ 02b0 Virtual Endpoint on PCIe Switch 1d49 0001 ThinkSystem 1610-4P NVMe Switch Adapter 1d49 0002 ThinkSystem 810-4P NVMe Switch Adapter + 02b1 Virtual Endpoint on PCIe Switch (9749) + 1d49 0004 Lenovo ThinkSystem 1610-8P NVMe Switch Adapter 0407 MegaRAID 1000 0530 MegaRAID 530 SCSI 320-0X RAID Controller 1000 0531 MegaRAID 531 SCSI 320-4X RAID Controller @@ -765,10 +777,11 @@ 131b Kaveri [Radeon R4 Graphics] 131c Kaveri [Radeon R7 Graphics] 131d Kaveri [Radeon R6 Graphics] + 15d8 Picasso 15dd Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 103c 83c6 Radeon Vega 8 Mobile 1458 d000 Radeon RX Vega 11 - 15ff Vega [Radeon Vega 28 Mobile] + 15ff Vega 11 [Radeon Vega 28 Mobile] 1714 BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series] 103c 168b ProBook 4535s 3150 RV380/M24 [Mobility Radeon X600] @@ -1200,7 +1213,7 @@ 13bd 1019 PC-AR10 4c50 Rage 3 LT [3D Rage LT PRO PCI] 1002 4c50 Rage LT Pro - 4c52 Rage Mobility-M1 PCI + 4c52 M1 [Rage Mobility-M1 PCI] 1033 8112 Versa Note VXi 4c54 264LT [Mach64 LT] 4c57 RV200/M7 [Mobility Radeon 7500] @@ -1616,6 +1629,7 @@ 6602 Mars 6603 Mars 6604 Opal XT [Radeon R7 M265/M365X/M465] + 1025 0776 Aspire V5 Radeon R7 M265 103c 8006 FirePro M4170 103c 814f Litho XT [Radeon R7 M365X] 103c 82aa Litho XT [Radeon R7 M465] @@ -1708,11 +1722,11 @@ 17aa 368f Radeon R5 A230 6667 Jet ULT [Radeon R5 M230] 666f Sun LE [Radeon HD 8550M / R5 M230] - 66a0 Vega 20 + 66a0 Vega 20 [Radeon Instinct] 66a1 Vega 20 66a2 Vega 20 66a3 Vega 20 - 66a7 Vega 20 + 66a7 Vega 20 [Radeon Pro Vega 20] 66af Vega 20 6704 Cayman PRO GL [FirePro V7900] 6707 Cayman LE GL [FirePro V5900] @@ -2314,12 +2328,17 @@ 67cc Ellesmere [Polaris10] 67cf Ellesmere [Polaris10] 67d0 Ellesmere [Radeon Pro V7300X / V7350x2] - 67df Ellesmere [Radeon RX 470/480/570/580] + 67df Ellesmere [Radeon RX 470/480/570/570X/580/580X] 1002 0b37 Radeon RX 480 + 1028 1722 Radeon RX 570X + 1028 1723 Radeon RX 580X 1043 04a8 Radeon RX 480 1043 04b0 Radeon RX 470 1043 04fb Radeon RX 480 1043 04fd Radeon RX 480 8GB + 106b 0161 Radeon Pro 580 + 106b 0162 Radeon Pro 575 + 106b 0163 Radeon Pro 570 1458 22f0 Radeon RX 570 1458 22f7 Radeon RX 570 Gaming 4G 1462 3411 Radeon RX 470 @@ -2335,6 +2354,7 @@ 174b e349 Radeon RX 470 1787 a470 Radeon RX 470 1787 a480 Radeon RX 480 + 1849 5001 Phantom Gaming X RX 580 OC 1da2 e353 Sapphire Radeon RX 580 Pulse 8GB 1da2 e366 Nitro+ Radeon RX 580 4GB 67e0 Baffin [Radeon Pro WX 4170] @@ -2353,15 +2373,21 @@ 103c 8277 Radeon Pro WX 4150 67e9 Baffin [Polaris11] 67eb Baffin [Radeon Pro V5300X] - 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/560] + 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] 106b 0160 Radeon Pro 460 106b 0166 Radeon Pro 455 106b 0167 Radeon Pro 450 106b 0179 Radeon Pro 560 + 106b 017a Radeon Pro 555 + 106b 018f Radeon Pro 560X + 106b 0190 Radeon Pro 555X 1642 1727 Polaris 21 XL [Radeon RX 560D] 1682 956d Polaris 21 XL [Radeon RX 560D] - 67ff Baffin [Radeon RX 550 640SP / RX 560] + 67ff Baffin [Radeon RX 550 640SP / RX 560/560X] 1002 0b04 Radeon RX 560 + 1028 1721 Radeon RX 560X + 1028 1726 Radeon RX 560DX + 103c 8479 Radeon RX 560X Mobile 1043 04bc Radeon RX 560 1458 22ed Radeon RX 560 148c 2381 Radeon RX 560 @@ -2574,15 +2600,19 @@ 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] 6860 Vega 10 [Radeon Instinct MI25] + 1002 0c35 Radeon PRO V320 + 1002 6c75 Radeon PRO V320 106b 017c Radeon Pro Vega 64 6861 Vega 10 XT [Radeon PRO WX 9100] 6862 Vega 10 XT [Radeon PRO SSG] 6863 Vega 10 XTX [Radeon Vega Frontier Edition] 6864 Vega 6867 Vega 10 XL [Radeon Pro Vega 56] - 6868 Vega + 6868 Vega 10 [Radeon PRO WX 8100] 686c Vega 10 [Radeon Instinct MI25 MxGPU] 687f Vega 10 XT [Radeon RX Vega 64] + 6880 Lexington [Radeon HD 6550M] + 103c 163c Pavilion dv6 Radeon HD 6550M 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] 1002 0301 FirePro V7800P @@ -2789,7 +2819,7 @@ 17aa 3928 Mobility Radeon HD 5650 17aa 3951 Mobility Radeon HD 5650 17aa 3977 Radeon HD 6550M - 68c7 Madison [Mobility Radeon HD 5570/6550A] + 68c7 Pinewood [Mobility Radeon HD 5570/6550A] 1462 2241 Mobility Radeon HD 5570 1462 2243 Mobility Radeon HD 5570 1462 2244 Mobility Radeon HD 5570 @@ -3097,16 +3127,22 @@ # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 694c Polaris 22 [Radeon RX Vega M GH] - 694e Polaris 22 [Radeon RX Vega M GL] + 694e Polaris 22 XL [Radeon RX Vega M GL] 6980 Polaris12 6981 Polaris12 6985 Lexa XT [Radeon PRO WX 3100] 6986 Polaris12 6987 Lexa [Radeon E9171 MCM] 6995 Lexa XT [Radeon PRO WX 2100] - 699f Lexa PRO [Radeon RX 550] + 699f Lexa PRO [Radeon RX 550/550X] + 1028 1720 Radeon RX 550X 148c 2380 Lexa XL [Radeon RX 550] 1da2 e367 Lexa PRO [Radeon RX 550] + 69a0 Vega 12 + 69a1 Vega 12 + 69a2 Vega 12 + 69a3 Vega 12 + 69af Vega 12 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge 7100 R520 [Radeon X1800 XT] @@ -3541,7 +3577,7 @@ 17aa 5113 Radeon R6 Graphics 17aa 5116 Radeon R6 Graphics 17aa 5118 Radeon R5 Graphics - 98e4 Radeon R2 Graphics + 98e4 Stoney [Radeon R2/R3/R4/R5 Graphics] 9900 Trinity [Radeon HD 7660G] 103c 1985 Pavilion 17-e163sg Notebook PC # AMD A10-5800K CPU @@ -5342,6 +5378,7 @@ 3306 Integrated Lights-Out Standard Slave Instrumentation & System Support 103c 330e iLO3 103c 3381 iLO4 + 1590 00e4 iLO5 3307 Integrated Lights-Out Standard Management Processor Support and Messaging # HP DL380 G6 103c 3309 iLO 2 @@ -5353,6 +5390,7 @@ 4030 zx2 System Bus Adapter 4031 zx2 I/O Controller 4037 PCIe Local Bus Adapter + 9602 AMD RS780/RS880 PCI to PCI bridge (int gfx) 103e Solliday Engineering 103f Synopsys/Logic Modeling Group 1040 Accelgraphics Inc. @@ -5862,7 +5900,7 @@ 3070 Hitachi FIVE-FX Fibre Channel to PCIe HBA 3505 SH7751 PCI Controller (PCIC) 350e SH7751R PCI Controller (PCIC) -1055 Efar Microsystems +1055 Microchip Technology / SMSC 9130 SLC90E66 [Victory66] IDE 9460 SLC90E66 [Victory66] ISA 9462 SLC90E66 [Victory66] USB @@ -6288,15 +6326,19 @@ 1644 FastLinQ QL45000 Series 100GbE Controller 1077 e4f8 FastLinQ QL45611H 100GbE Adapter 1654 FastLinQ QL45000 Series 50GbE Controller + 1077 0032 QL45212 Flex 50Gb 2-port Ethernet Adapter 1590 0223 Synergy 6810C 25/50Gb Ethernet Adapter 1656 FastLinQ QL45000 Series 25GbE Controller + 1077 0033 QL45214 Flex 25Gb 4-port Ethernet Adapter 1077 02a7 QL45212-DE 25GbE Adapter 1077 e4f6 FastLinQ QL45211H 25GbE Adapter 1077 e4f7 FastLinQ QL45212H 25GbE Adapter 165c FastLinQ QL45000 Series 10/25/40/50GbE Controller (FCoE) + 1077 0034 QL45262 Flex 50Gb 2-port Ethernet Adapter w/ iSCSI/FCoE 1077 e4f1 FastLinQ QL45462H 40GbE FCoE Adapter 1077 e4f2 FastLinQ QL45461H 40GbE FCoE Adapter 165e FastLinQ QL45000 Series 10/25/40/50GbE Controller (iSCSI) + 1077 0034 QL45262 Flex 50Gb 2-port Ethernet Adapter w/ iSCSI/FCoE 1077 e4f1 FastLinQ QL45462H 40GbE iSCSI Adapter 1077 e4f2 FastLinQ QL45461H 40GbE iSCSI Adapter 1664 FastLinQ QL45000 Series Gigabit Ethernet Controller (SR-IOV VF) @@ -6394,6 +6436,7 @@ 8070 FastLinQ QL41000 Series 10/25/40/50GbE Controller 1077 0001 10GE 2P QL41162HxRJ-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 0004 4x10GE QL41164HFCU CNA 1077 0005 QLogic 4x10GE QL41164HMRJ CNA 1077 0006 QLogic 4x10GE QL41164HMCU CNA 1077 0007 QLogic 2x1GE+2x10GE QL41264HMCU CNA @@ -6401,6 +6444,7 @@ 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 0011 FastLinQ QL41212HLCU 25GbE Adapter 1077 0012 FastLinQ QL41112H 10GbE Adapter + 1077 0019 QL41232HOCU - Dual Port 25/10GbE SFP28 OCP Adapter 1077 0039 QLogic QL41262 PCIe 25Gb 2-Port SFP28 Ethernet Adapter 1590 021d 10/25GbE 2P QL41222HLCU-HP Adapter 1590 021e 10/25GbE 2P QL41162HMRJ-HP Adapter @@ -6409,6 +6453,7 @@ 8080 FastLinQ QL41000 Series 10/25/40/50GbE Controller (FCoE) 1077 0001 10GE 2P QL41162HxRJ-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 0004 4x10GE QL41164HFCU CNA 1077 0005 QLogic 4x10GE QL41164HMRJ CNA 1077 0006 QLogic 4x10GE QL41164HMCU CNA 1077 0007 QLogic 2x1GE+2x10GE QL41264HMCU CNA @@ -6420,6 +6465,8 @@ 8084 FastLinQ QL41000 Series 10/25/40/50GbE Controller (iSCSI) 1077 0001 10GE 2P QL41162HxRJ-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 0003 4x10GE QL41164HxRJ CNA + 1077 0004 4x10GE QL41164HFCU CNA 1077 0005 QLogic 4x10GE QL41164HMRJ CNA 1077 0006 QLogic 4x10GE QL41164HMCU CNA 1077 0007 QLogic 2x25GE QL41262HMCU CNA @@ -6431,6 +6478,8 @@ 8090 FastLinQ QL41000 Series Gigabit Ethernet Controller (SR-IOV VF) 1077 0001 25GE 2P QL41262HxCU-DE Adapter 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 0003 4x10GE QL41164HxRJ CNA + 1077 0004 4x10GE QL41164HFCU CNA 1077 0005 QLogic 4x10GE QL41164HMRJ CNA 1077 0006 QLogic 4x10GE QL41164HMCU CNA 1077 0007 QLogic 2x1GE+2x10GE QL41264HMCU CNA @@ -7901,6 +7950,7 @@ 1d49 0001 ThinkSystem 1610-4P NVMe Switch Adapter 1d49 0002 ThinkSystem 810-4P NVMe Switch Adapter 9749 PEX 9749 49-lane, 13-port PCI Express Gen 3 (8.0 GT/s) Switch + 1d49 0004 ThinkSystem 1610-8P NVMe Switch Adapter a100 Blackmagic Design DeckLink bb04 B&B 3PCIOSD1A Isolated PCI Serial c001 CronyxOmega-PCI (8-port RS232) @@ -10282,6 +10332,7 @@ 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] 0fc2 GK107 [GeForce GT 630 OEM] + 0fc5 GK107 0fc6 GK107 [GeForce GTX 650] 1043 8428 GTX650-DC-1GD5 0fc8 GK107 [GeForce GT 740] @@ -10362,7 +10413,7 @@ # 06G-P4-2795-KR 3842 2795 GeForce GTX Titan SC Hydro Copper Signature 1007 GK110 [GeForce GTX 780 Rev. 2] - 1008 GK110 [GeForce GTX 780 Ti Rev. 2] + 1008 GK110 [GeForce GTX 780 Ti 6GB] 100a GK110B [GeForce GTX 780 Ti] 100c GK110B [GeForce GTX TITAN Black] 101e GK110GL [Tesla K20X] @@ -10387,6 +10438,7 @@ 1040 GF119 [GeForce GT 520] 1043 83a0 ENGT520 SILENT 1042 GF119 [GeForce 510] + 1045 GF119 1048 GF119 [GeForce 605] 1049 GF119 [GeForce GT 620 OEM] 104a GF119 [GeForce GT 610] @@ -10847,6 +10899,7 @@ 11b6 GK104GLM [Quadro K3100M] 11b7 GK104GLM [Quadro K4100M] 11b8 GK104GLM [Quadro K5100M] + 11b9 GK104GLM 11ba GK104GL [Quadro K5000] 11bb GK104GL [Quadro 4100] 11bc GK104GLM [Quadro K5000M] @@ -11002,6 +11055,7 @@ 17aa 3647 GeForce GTX 950A 17aa 36b9 GeForce GTX 950A 139b GM107M [GeForce GTX 960M] + 1028 06e4 XPS 15 9550 103c 2b4c GeForce GTX 960A 139c GM107M [GeForce 940M] 139d GM107M [GeForce GTX 750 Ti] @@ -11075,6 +11129,7 @@ 1b00 GP102 [TITAN X] 1b01 GP102 1b02 GP102 [TITAN Xp] + 1b04 GP102 1b06 GP102 [GeForce GTX 1080 Ti] 1b07 GP102 [P102-100] 1b30 GP102GL [Quadro P6000] @@ -11093,6 +11148,7 @@ 1462 11e8 GeForce GTX 1070 Max-Q 1462 11e9 GeForce GTX 1070 Max-Q 1558 9501 GeForce GTX 1070 Max-Q + 1ba2 GP104M [GeForce GTX 1070 Mobile] 1bad GP104 [GeForce GTX 1070 Engineering Sample] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL [Quadro P4000] @@ -11103,12 +11159,13 @@ 1bb7 GP104GLM [Quadro P4000 Mobile] 1462 11e9 Quadro P4000 Max-Q 1bb8 GP104GLM [Quadro P3000 Mobile] + 1bb9 GP104GLM [Quadro P4200 Mobile] 1bbb GP104GLM [Quadro P3200 Mobile] 1bc7 GP104 [P104-101] - 1be0 GP104M [GeForce GTX 1080 Mobile] + 1be0 GP104BM [GeForce GTX 1080 Mobile] 1028 07c0 GeForce GTX 1080 Max-Q 1458 355b GeForce GTX 1080 Max-Q - 1be1 GP104M [GeForce GTX 1070 Mobile] + 1be1 GP104BM [GeForce GTX 1070 Mobile] 1c00 GP106 1c01 GP106 1c02 GP106 [GeForce GTX 1060 3GB] @@ -11123,17 +11180,19 @@ 1c22 GP106M [GeForce GTX 1050 Mobile] 1c30 GP106GL [Quadro P2000] 1c35 GP106 - 1c60 GP106M [GeForce GTX 1060 Mobile 6GB] + 1c60 GP106BM [GeForce GTX 1060 Mobile 6GB] 103c 8390 GeForce GTX 1060 Max-Q 6GB - 1c61 GP106M [GeForce GTX 1050 Ti Mobile] - 1c62 GP106M [GeForce GTX 1050 Mobile] + 1c61 GP106BM [GeForce GTX 1050 Ti Mobile] + 1c62 GP106BM [GeForce GTX 1050 Mobile] 1c70 GP106GL - 1c80 GP107 1c81 GP107 [GeForce GTX 1050] 1c82 GP107 [GeForce GTX 1050 Ti] + 1c83 GP107 [GeForce GTX 1050 3GB] 1c8c GP107M [GeForce GTX 1050 Ti Mobile] 1c8d GP107M [GeForce GTX 1050 Mobile] 1c8e GP107M + 1c8f GP107M [GeForce GTX 1050 Ti Max-Q] + 1c92 GP107M [GeForce GTX 1050 Mobile] 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL @@ -11141,18 +11200,30 @@ 1cb2 GP107GL [Quadro P600] 1cb3 GP107GL [Quadro P400] 1cb6 GP107GL [Quadro P620] + 1cba GP107GLM [Quadro P2000 Mobile] + 1cbb GP107GLM [Quadro P1000 Mobile] + 1cbc GP107GLM [Quadro P600 Mobile] + 1ccc GP107BM [GeForce GTX 1050 Ti Mobile] + 1ccd GP107BM [GeForce GTX 1050 Mobile] 1d01 GP108 [GeForce GT 1030] 1d10 GP108M [GeForce MX150] 1d12 GP108M [GeForce MX150] 1d72 1701 Mi Notebook Pro [GeForce MX150] - 1d33 GP108GL [Quadro P500] + 1d33 GP108GLM [Quadro P500 Mobile] 1d81 GV100 [TITAN V] 1db1 GV100GL [Tesla V100 SXM2 16GB] + 1db3 GV100GL [Tesla V100 FHHL 16GB] 1db4 GV100GL [Tesla V100 PCIe 16GB] 1db5 GV100GL [Tesla V100 SXM2 32GB] 1db6 GV100GL [Tesla V100 PCIe 32GB] 1db7 GV100GL [Tesla V100 DGXS 32GB] 1dba GV100GL [Quadro GV100] + 10de 12eb TITAN V CEO Edition + 1e07 GV102 + 1e3c GV102GL + 1e82 GV104 + 1e87 GV104 + 1eab GV104M 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -11215,6 +11286,7 @@ f400 LPe36000 Fibre Channel Host Adapter [Prism] 10df f401 LPe35000 Fibre Channel Host Adapter [Prism] 10df f402 LPe35000 Fibre Channel Host Adapter [Prism] + 10df f410 LPe35002-M2-D 2-Port 32Gb Fibre Channel Adapter f700 LP7000 Fibre Channel Host Adapter f701 LP7000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) f800 LP8000 Fibre Channel Host Adapter @@ -11262,6 +11334,7 @@ 1775 1100 VR11 Single Board Computer 0860 CA91C860 [QSpan] 0862 CA91C862A [QSpan-II] + 8111 Tsi381 PCIe to PCI Bridge 8260 CA91L8200B [Dual PCI PowerSpan II] 8261 CA91L8260B [Single PCI PowerSpan II] a108 Tsi109 Host Bridge for Dual PowerPC @@ -11337,6 +11410,7 @@ 524a RTS524A PCI Express Card Reader 5250 RTS5250 PCI Express Card Reader 525a RTS525A PCI Express Card Reader + 1028 06e4 XPS 15 9550 17aa 224f ThinkPad X1 Carbon 5th Gen 5286 RTS5286 PCI Express Card Reader 5287 RTL8411B PCI Express Card Reader @@ -12535,12 +12609,13 @@ 111b Teledyne Electronic Systems 111c Tricord Systems Inc. 0001 Powerbis Bridge -111d Integrated Device Technology, Inc. [IDT] +# now owned by Microchip Technology +111d Microsemi / PMC / IDT 0001 IDT77201/77211 155Mbps ATM SAR Controller [NICStAR] 0003 IDT77222/77252 155Mbps ATM MICRO ABR SAR Controller 0004 IDT77V252 155Mbps ATM MICRO ABR SAR Controller 0005 IDT77V222 155Mbps ATM MICRO ABR SAR Controller - 8018 PES12N3A PCI Express Switch + 8018 PES12N3A 12-lane 3-Port PCI Express Switch 801c PES24N3A PCI Express Switch 8028 PES4T4 PCI Express Switch 802b PES8T5A PCI Express Switch @@ -12581,6 +12656,7 @@ 806c PES16T4A/4T4G2 PCI Express Gen2 Switch 806e PES24T6G2 PCI Express Gen2 Switch 806f HIO524G2 PCI Express Gen2 Switch + 8077 89HPES64H16G2 64-Lane 16-Port PCIe Gen2 System Interconnect Switch 8088 PES32NT8BG2 PCI Express Switch 1093 752f PXIe-8383mc Device 1093 7543 PXIe-8383mc System Host @@ -12589,9 +12665,14 @@ 1093 75ff PXIe-8383mc DMA 1093 7600 PXIe-8383mc DMA 1093 7602 PXIe-8384 +# 32-lanes 24-ports Gen.2 + 808a 89HPES32NT24BG2 PCI Express Switch +# 32-lanes 24-ports Gen.2 + 808c 89HPES32NT24AG2 PCI Express Switch 808e PES24NT24G2 PCI Express Switch -# 32 port / 8 lane PCIe Gen 2 packet switch - 808f PES32NT8AG2 + 808f 89HPES32NT8AG2 32-Lane 8-Port PCIe Gen2 System Interconnect Switch with Non-Transparent Bridging + 8090 89HPES16NT16G2 16-Lane 16-Port PCIe Gen2 System Interconnect Switch + 8092 89HPES12NT12G2 12-Lane 12-Port PCIe Gen2 System Interconnect Switch 80cf F32P08xG3 [PCIe boot mode] 80d2 F32P08xG3 NVMe controller 111e Eldec @@ -12620,7 +12701,8 @@ 1127 0400 ForeRunnerHE ATM 1129 Firmworks 112a Hermes Electronics Company, Ltd. -112b Linotype - Hell AG +# nee Linotype - Hell AG +112b Heidelberger Druckmaschinen AGHeidelberger Druckmaschinen AG 112c Zenith Data Systems 112d Ravicad 112e Infomedia Microelectronics Inc. @@ -13751,6 +13833,10 @@ 0003 FireStream 50 119f Bull HN Information Systems 1081 BXI Host Channel Adapter +# BXI stands for Bull eXascale Interconnect + 1101 BXI Host Channel Adapter v1.2 +# BXI stands for Bull eXascale Interconnect + 1121 BXI Host Channel Adapter v1.3 11a0 Convex Computer Corporation 11a1 Hamamatsu Photonics K.K. 11a2 Sierra Research and Technology @@ -14419,7 +14505,6 @@ 0001 Roadrunner serial HIPPI 1210 Hyperparallel Technologies 1211 Braintech Inc -1212 Kingston Technology Corp. 1213 Applied Intelligent Systems, Inc. 1214 Performance Technologies, Inc. 1215 Interware Co., Ltd @@ -15057,6 +15142,7 @@ 8872 IT887xF PCI to ISA I/O chip with SMB, GPIO, Serial or Parallel Port 8888 IT8888F/G PCI to ISA Bridge with SMB [Golden Gate] 8889 IT8889F PCI to ISA Bridge + 8892 IT8892E PCIe to PCI Bridge 8893 IT8893E PCIe to PCI Bridge e886 IT8330G 1284 Sahara Networks, Inc. @@ -16567,6 +16653,9 @@ 5016 T580-OCP-SO Unified Wire Ethernet Controller 5017 T520-OCP-SO Unified Wire Ethernet Controller 5018 T540-BT Unified Wire Ethernet Controller + 5019 T540-LP-BT Unified Wire Ethernet Controller + 501a T540-SO-BT Unified Wire Ethernet Controller + 501b T540-SO-CR Unified Wire Ethernet Controller 5080 T540-5080 Unified Wire Ethernet Controller 5081 T540-5081 Unified Wire Ethernet Controller 5082 T504-5082 Unified Wire Ethernet Controller @@ -16606,6 +16695,8 @@ 50aa T580-50AA Unified Wire Ethernet Controller 50ab T520-50AB Unified Wire Ethernet Controller 50ac T540-50AC Unified Wire Ethernet Controller + 50ad T520-50AD Unified Wire Ethernet Controller + 50ae T540-50AE Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16630,6 +16721,9 @@ 5416 T580-OCP-SO Unified Wire Ethernet Controller 5417 T520-OCP-SO Unified Wire Ethernet Controller 5418 T540-BT Unified Wire Ethernet Controller + 5419 T540-LP-BT Unified Wire Ethernet Controller + 541a T540-SO-BT Unified Wire Ethernet Controller + 541b T540-SO-CR Unified Wire Ethernet Controller 5480 T540-5080 Unified Wire Ethernet Controller 5481 T540-5081 Unified Wire Ethernet Controller 5482 T504-5082 Unified Wire Ethernet Controller @@ -16669,6 +16763,8 @@ 54aa T580-50AA Unified Wire Ethernet Controller 54ab T520-50AB Unified Wire Ethernet Controller 54ac T540-50AC Unified Wire Ethernet Controller + 54ad T520-50AD Unified Wire Ethernet Controller + 54ae T540-50AE Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16693,6 +16789,9 @@ 5516 T580-OCP-SO Unified Wire Storage Controller 5517 T520-OCP-SO Unified Wire Storage Controller 5518 T540-BT Unified Wire Storage Controller + 5519 T540-LP-BT Unified Wire Storage Controller + 551a T540-SO-BT Unified Wire Storage Controller + 551b T540-SO-CR Unified Wire Storage Controller 5580 T540-5080 Unified Wire Storage Controller 5581 T540-5081 Unified Wire Storage Controller 5582 T504-5082 Unified Wire Storage Controller @@ -16732,6 +16831,8 @@ 55aa T580-50AA Unified Wire Storage Controller 55ab T520-50AB Unified Wire Storage Controller 55ac T540-50AC Unified Wire Storage Controller + 55ad T520-50AD Unified Wire Storage Controller + 55ae T540-50AE Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16756,6 +16857,9 @@ 5616 T580-OCP-SO Unified Wire Storage Controller 5617 T520-OCP-SO Unified Wire Storage Controller 5618 T540-BT Unified Wire Storage Controller + 5619 T540-LP-BT Unified Wire Storage Controller + 561a T540-SO-BT Unified Wire Storage Controller + 561b T540-SO-CR Unified Wire Storage Controller 5680 T540-5080 Unified Wire Storage Controller 5681 T540-5081 Unified Wire Storage Controller 5682 T504-5082 Unified Wire Storage Controller @@ -16795,6 +16899,8 @@ 56aa T580-50AA Unified Wire Storage Controller 56ab T520-50AB Unified Wire Storage Controller 56ac T540-50AC Unified Wire Storage Controller + 56ad T520-50AD Unified Wire Storage Controller + 56ae T540-50AE Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16858,6 +16964,9 @@ 5816 T580-OCP-SO Unified Wire Ethernet Controller [VF] 5817 T520-OCP-SO Unified Wire Ethernet Controller [VF] 5818 T540-BT Unified Wire Ethernet Controller [VF] + 5819 T540-LP-BT Unified Wire Ethernet Controller [VF] + 581a T540-SO-BT Unified Wire Ethernet Controller [VF] + 581b T540-SO-CR Unified Wire Ethernet Controller [VF] 5880 T540-5080 Unified Wire Ethernet Controller [VF] 5881 T540-5081 Unified Wire Ethernet Controller [VF] 5882 T504-5082 Unified Wire Ethernet Controller [VF] @@ -16897,6 +17006,8 @@ 58aa T580-50AA Unified Wire Ethernet Controller [VF] 58ab T520-50AB Unified Wire Ethernet Controller [VF] 58ac T540-50AC Unified Wire Ethernet Controller [VF] + 58ad T520-50AD Unified Wire Ethernet Controller [VF] + 58ae T540-50AE Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16918,6 +17029,8 @@ 6085 T6240-6085 Unified Wire Ethernet Controller 6086 T6225-6086 Unified Wire Ethernet Controller 6087 T6225-6087 Unified Wire Ethernet Controller + 6088 T62100-6088 Unified Wire Ethernet Controller + 6089 T62100-6089 Unified Wire Ethernet Controller 6401 T6225-CR Unified Wire Ethernet Controller 6402 T6225-SO-CR Unified Wire Ethernet Controller 6403 T6425-CR Unified Wire Ethernet Controller @@ -16939,6 +17052,8 @@ 6485 T6240-6085 Unified Wire Ethernet Controller 6486 T6225-6086 Unified Wire Ethernet Controller 6487 T6225-6087 Unified Wire Ethernet Controller + 6488 T62100-6088 Unified Wire Ethernet Controller + 6489 T62100-6089 Unified Wire Ethernet Controller 6501 T6225-CR Unified Wire Storage Controller 6502 T6225-SO-CR Unified Wire Storage Controller 6503 T6425-CR Unified Wire Storage Controller @@ -16960,6 +17075,8 @@ 6585 T6240-6085 Unified Wire Storage Controller 6586 T6225-6086 Unified Wire Storage Controller 6587 T6225-6087 Unified Wire Storage Controller + 6588 T62100-6088 Unified Wire Storage Controller + 6589 T62100-6089 Unified Wire Storage Controller 6601 T6225-CR Unified Wire Storage Controller 6602 T6225-SO-CR Unified Wire Storage Controller 6603 T6425-CR Unified Wire Storage Controller @@ -16981,6 +17098,8 @@ 6685 T6240-6085 Unified Wire Storage Controller 6686 T6225-6086 Unified Wire Storage Controller 6687 T6225-6087 Unified Wire Storage Controller + 6688 T62100-6088 Unified Wire Storage Controller + 6689 T62100-6089 Unified Wire Storage Controller 6801 T6225-CR Unified Wire Ethernet Controller [VF] 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] 6803 T6425-CR Unified Wire Ethernet Controller [VF] @@ -17002,6 +17121,8 @@ 6885 T6240-6085 Unified Wire Ethernet Controller [VF] 6886 T6225-6086 Unified Wire Ethernet Controller [VF] 6887 T6225-6087 Unified Wire Ethernet Controller [VF] + 6888 T62100-6088 Unified Wire Ethernet Controller [VF] + 6889 T62100-6089 Unified Wire Ethernet Controller [VF] a000 PE10K Unified Wire Ethernet Controller 1426 Storage Technology Corp. 1427 Better On-Line Solutions @@ -17075,6 +17196,7 @@ a800 XP941 PCIe SSD a802 NVMe SSD Controller SM951/PM951 a804 NVMe SSD Controller SM961/PM961 + a808 NVMe SSD Controller SM981/PM981 a820 NVMe SSD Controller 171X 1028 1f95 Express Flash NVMe XS1715 SSD 400GB 1028 1f96 Express Flash NVMe XS1715 SSD 800GB @@ -17365,8 +17487,7 @@ 14e1 INVERTEX 14e2 INFOLIBRIA 14e3 AMTELCO -# Formerly Broadcom Corporation -14e4 Broadcom Limited +14e4 Broadcom Inc. and subsidiaries 0576 BCM43224 802.11a/b/g/n 0800 Sentry5 Chipcommon I/O Controller 0804 Sentry5 PCI Bridge @@ -17606,6 +17727,7 @@ 1680 NetXtreme BCM5761e Gigabit Ethernet PCIe 1681 NetXtreme BCM5761 Gigabit Ethernet PCIe 1682 NetXtreme BCM57762 Gigabit Ethernet PCIe + 106b 00f6 Thunderbolt to Gigabit Ethernet Adapter 1683 NetXtreme BCM57767 Gigabit Ethernet PCIe 1684 NetXtreme BCM5764M Gigabit Ethernet PCIe 1685 NetXtreme II BCM57500S Gigabit Ethernet @@ -17780,8 +17902,9 @@ 16d5 BCM57407 NetXtreme-E 10GBase-T Ethernet Controller 16d6 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller 16d7 BCM57414 NetXtreme-E 10Gb/25Gb RDMA Ethernet Controller - 14e4 1202 BCM957412M4122 OCP 1x25G Type1 wRoCE - 14e4 1404 BCM957414M4142 OCP 2x25G Type1 wRoCE + 14e4 1202 BCM957412M4122C OCP 1x25G Type1 wRoCE + 14e4 1402 BCM957414A4142CC 10Gb/25Gb Ethernet PCIe + 14e4 1404 BCM957414M4142C OCP 2x25G Type1 wRoCE 1590 020e Ethernet 25Gb 2-port 631SFP28 Adapter 1590 0211 Ethernet 25Gb 2-port 631FLR-SFP28 Adapter 16d8 BCM57416 NetXtreme-E Dual-Media 10G RDMA Ethernet Controller @@ -18078,6 +18201,7 @@ 5840 BCM5840 Crypto Accelerator 5841 BCM5841 Crypto Accelerator 5850 BCM5850 Crypto Accelerator + 5e87 Valkyrie offload engine 8602 BCM7400/BCM7405 Serial ATA Controller a8d8 BCM43224/5 Wireless Network Adapter aa52 BCM43602 802.11ac Wireless LAN SoC @@ -18096,6 +18220,10 @@ b850 Broadcom BCM56850 Switch ASIC # Tomahawk b960 Broadcom BCM56960 Switch ASIC + d802 BCM58802 Stingray 50Gb Ethernet SoC + 14e4 8024 Stingray Dual-Port 25Gb Ethernet PCIe SmartNIC w4GB DRAM + 14e4 8028 Stingray Dual-Port 25Gb Ethernet PCIe SmartNIC w8GB DRAM + d804 BCM58804 Stingray 100Gb Ethernet SoC 14e5 Pixelfusion Ltd 14e6 SHINING Technology Inc 14e7 3CX @@ -18841,6 +18969,9 @@ 1021 MT28861 1974 MT28800 Family [ConnectX-5 PCIe Bridge] 1975 MT416842 Family [BlueField SoC PCIe Bridge] + 4117 MT27712A0-FDCF-AE + 1bd4 0039 SN10XMP2P25 + 1bd4 004d SN10XMP2P25,YZPC-01191-101 5274 MT21108 InfiniBridge 5a44 MT23108 InfiniHost 5a45 MT23108 [Infinihost HCA Flash Recovery] @@ -18851,12 +18982,13 @@ 6278 MT25208 InfiniHost III Ex (Tavor compatibility mode) 6279 MT25208 [InfiniHost III Ex HCA Flash Recovery] 6282 MT25208 [InfiniHost III Ex] - 6340 MT25408 [ConnectX VPI - IB SDR / 10GigE] - 634a MT25418 [ConnectX VPI PCIe 2.0 2.5GT/s - IB DDR / 10GigE] + 6340 MT25408A0-FCC-SI ConnectX, Dual Port 10Gb/s InfiniBand / 10GigE Adapter IC with PCIe 2.0 x8 2.5GT/s Interface + 634a MT25408A0-FCC-DI ConnectX, Dual Port 20Gb/s InfiniBand / 10GigE Adapter IC with PCIe 2.0 x8 2.5GT/s Interface + 1014 1014 4X InfiniBand DDR Expansion Card (CFFh) for IBM BladeCenter 6368 MT25448 [ConnectX EN 10GigE, PCIe 2.0 2.5GT/s] - 6372 MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe 2.0 2.5GT/s] - 6732 MT26418 [ConnectX VPI PCIe 2.0 5GT/s - IB DDR / 10GigE] - 673c MT26428 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE] + 6372 MT25458 ConnectX EN 10GBASE-T PCIe 2.5 GT/s + 6732 MT25408A0-FCC-GI ConnectX, Dual Port 20Gb/s InfiniBand / 10GigE Adapter IC with PCIe 2.0 x8 5.0GT/s Interface + 673c MT25408A0-FCC-QI ConnectX, Dual Port 40Gb/s InfiniBand / 10GigE Adapter IC with PCIe 2.0 x8 5.0GT/s Interface 1014 0415 PCIe2 2-port 4X InfiniBand QDR Adapter for Power 1014 0487 GX++ 1-port 4X IB QDR Adapter for Power 795 103c 1782 4X QDR InfiniBand Mezzanine HCA for c-Class BladeSystem @@ -18865,11 +18997,12 @@ 103c 1781 NC543i 1-port 4x QDR IB/Flex-10 10Gb Adapter 103c 3349 NC543i 2-port 4xQDR IB/10Gb Adapter 6750 MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s] - 1014 0461 2-Port 10 GbE RoCE SR LP PCIe2 (rev b0) + 1014 0416 PCIe2 2-Port 10GbE RoCE SFP+ Adapter + 1014 0461 PCIe2 2-Port 10GbE RoCE SR Adapter 15b3 0018 HP 10 GbE PCI-e G2 Dual-Port NIC (rev C1) # FC EC26 15b3 6572 IBM Flex System EN4132 2-port 10Gb RoCE Adapter - 675a MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe Gen2 5GT/s] + 675a MT26458 ConnectX EN 10GBASE-T PCIe Gen2 5.0 GT/s 6764 MT26468 [ConnectX EN 10GigE, PCIe 2.0 5GT/s Virtualization+] 103c 3313 NC542m Dual Port Flex-10 10GbE BLc Adapter 676e MT26478 [ConnectX EN 40GigE, PCIe 2.0 5GT/s] @@ -18895,7 +19028,7 @@ cb84 MT52100 cf08 MT53236 cf6c MT53100 [Spectrum-2] - d2f0 Switch-IB 3 HDR (200Gbps) switch + d2f0 Quantum HDR (200Gbps) switch 15b4 CCI/TRIAD 15b5 Cimetrics Inc 15b6 Texas Memory Systems Inc @@ -19087,7 +19220,8 @@ 5449 SmartPCI561 Modem 1641 MKNet Corp. 1642 Bitland(ShenZhen) Information Technology Co., Ltd. -1657 Brocade Communications Systems, Inc. +# nee Brocade Communications Systems, Inc. +1657 Cavium QLogic 0013 425/825/42B/82B 4Gbps/8Gbps PCIe dual port FC HBA 103c 1742 82B 8Gbps dual port FC HBA 103c 1744 42B 4Gbps dual port FC HBA @@ -19100,8 +19234,7 @@ 103c 1743 81B 8Gbps single port FC HBA 1657 0014 415/815 4Gbps/8Gbps single port PCIe FC HBA 0021 804 8Gbps FC HBA for HP Bladesystem c-class -# AnyIO Adapter - 0022 1860 16Gbps/10Gbps Fabric Adapter + 0022 BR-1860 Fabric Adapter 1657 0022 10Gbps CNA - FCOE 1657 0023 10Gbps CNA - LL 1657 0024 16Gbps FC HBA @@ -19183,6 +19316,7 @@ 7191 Proc10a_48S 71a1 Proc10a_66S 71b1 Proc10A + 73b1 Proc10s 165d Hsing Tech. Enterprise Co., Ltd. 165f Linux Media Labs, LLC 1020 LMLM4 MPEG-4 encoder @@ -19448,6 +19582,7 @@ 0040 QCA9980/9990 802.11ac Wireless Network Adapter 0041 QCA6164 802.11ac Wireless Network Adapter 0042 QCA9377 802.11ac Wireless Network Adapter + 0046 QCA9984 802.11ac Wave 2 Wireless Network Adapter 0050 QCA9887 802.11ac Wireless Network Adapter 0207 AR5210 Wireless Network Adapter [AR5000 802.11a] 1014 AR5212 802.11abg NIC @@ -19482,6 +19617,7 @@ 16b8 Sonnet Technologies, Inc. 16be Creatix Polymedia GmbH 16c3 Synopsys, Inc. + edda EPMockUp 16c6 Micrel-Kendin 8695 Centaur KS8695 ARM processor 8842 KSZ8842-PMQL 2-Port Ethernet Switch @@ -19962,6 +20098,7 @@ 1a09 Arria10 PCIe Darklite Design [DNPCIe_80G_A10_LL] 1a0a VirtexUS PCIe Darklite Design [DNVUF2_HPC_PCIe] 1a0b UltrascalePlus PCIe Darklite Design [DNPCIe_400G_VU_LL] + 1a0c KintexUS PCIe DRAM Packet Capture Design [DNPCIe_40G_KU_LL] 17e4 Sectra AB 0001 KK671 Cardbus encryption board 0002 KK672 Cardbus encryption board @@ -20449,15 +20586,19 @@ 1924 8019 SFN8542-R2 8000 Series 10/40G Adapter 1924 801a SFN8722-R1 8000 Series OCP 10G Adapter 1924 801b SFN8522-R3 8000 Series 10G Adapter - 0b03 SFC9250 10/25/40/50/100G Ethernet Controller + 1924 801c SFN8042-R3 8000 Series 10/40G Adapter + 1924 8021 SFN8041-R1 8000 Series 10/40G Adapter + 0b03 XtremeScale SFC9250 10/25/40/50/100G Ethernet Controller 1924 801d x2522-R1 2000 Series 10/25G Adapter 1924 801e x2542-R1 2000 Series 40/100G Adapter + 1924 8022 XtremeScale X2522 10G Network Adapter + 1924 8028 XtremeScale X2522-25G Network Adapter 1803 SFC9020 10G Ethernet Controller (Virtual Function) 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) 1903 SFC9120 10G Ethernet Controller (Virtual Function) 1923 SFC9140 10/40G Ethernet Controller (Virtual Function) 1a03 SFC9220 10/40G Ethernet Controller (Virtual Function) - 1b03 SFC9250 10/25/40/50/100G Ethernet Controller (Virtual Function) + 1b03 XtremeScale SFC9250 10/25/40/50/100G Ethernet Controller (Virtual Function) 6703 SFC4000 rev A iSCSI/Onload [Solarstorm] 10b8 0102 SMC10GPCIe-10BT (A2) [TigerCard] 10b8 0103 SMC10GPCIe-10BT (A3) [TigerCard] @@ -20756,8 +20897,51 @@ 5808 DDRdrive X8 dd52 DDRdrive X1-30 19e5 Huawei Technologies Co., Ltd. +# subvendor + 0123 ES3000 V3 NVMe PCIe SSD + 19e5 3022 NVMe SSD ES3600P V3 800GB 2.5" U.2 + 19e5 3023 NVMe SSD ES3600P V3 1200GB 2.5" U.2 + 19e5 3024 NVMe SSD ES3600P V3 1600GB 2.5" U.2 + 19e5 3025 NVMe SSD ES3600P V3 2000GB 2.5" U.2 + 19e5 3026 NVMe SSD ES3600P V3 3200GB 2.5" U.2 + 19e5 3033 NVMe SSD ES3600C V3 1200GB HHHL AIC + 19e5 3034 NVMe SSD ES3600C V3 1600GB HHHL AIC + 19e5 3036 NVMe SSD ES3600C V3 3200GB HHHL AIC + 0200 Hi1822 Family (2*25GE) + 0201 Hi1822 Family (2*100GE) 1710 iBMA Virtual Network Adapter 1711 Hi1710 [iBMC Intelligent Management system chip w/VGA support] + 1822 Hi1822 Family (4*25GE) + 371e Hi1822 Family Virtual Bridge + a120 HiSilicon PCIe Root Port with Gen4 + a121 HiSilicon PCI-PCI Bridge + a122 HiSilicon Embedded DMA Engine + a124 HiSilicon Internal SDI Function Engine + a125 HiSilicon SDI Network Controller + a126 HiSilicon SDI NVMe Storage Controller + a127 HiSilicon SDI Accelerator + a12a HiSilicon Add-on PCI-PCI Bridge + a220 HNS GE Network Controller + a221 HNS GE/10GE/25GE Network Controller + a222 HNS GE/10GE/25GE RDMA Network Controller + a224 HNS GE/10GE/25GE/50GE RDMA Network Controller + a226 HNS GE/10GE/25GE/50GE/100GE RDMA Network Controller + a22a HiSilicon Network For SDI + a22e HNS Network Controller (Virtual Function) + a22f HNS RDMA Network Controller (Virtual Function) + a230 HiSilicon SAS 3.0 HBA + a235 HiSilicon AHCI HBA + a238 HiSilicon USB 3.0 Host Controller + a239 HiSilicon USB 2.0 2-port Host Controller + a23a HiSilicon USB 2.0 Host Controller + a250 HiSilicon ZIP Engine + a251 HiSilicon ZIP Engine(Virtual Function) + a255 HiSilicon SEC Engine + a256 HiSilicon SEC Engine(Virtual Function) + a258 HiSilicon HPRE Engine + a259 HiSilicon HPRE Engine(Virtual Function) + a25a HiSilicon RDE Engine + a25b HiSilicon RDE Engine(Virtual Function) 19e7 NET (Network Equipment Technologies) 1001 STIX DSP Card 1002 STIX - 1 Port T1/E1 Card @@ -20872,7 +21056,7 @@ 0009 RAIDCore Controller 000a RAIDCore Controller 1aae Global Velocity, Inc. -1ab4 FFEI Ltd +1ab4 Distributed Management Task Force, Inc. (DMTF)Distributed Management Task Force, Inc. (DMTF) 1ab6 CalDigit, Inc. 6201 RAID Card # Parallels VM virtual devices @@ -21160,6 +21344,8 @@ 4263 10G-PCIE3-8E-4S Network Adapter 4264 10G-PCIE3-8E-2S Network Adapter 4265 10G-PCIE3-8E-2S Network Adapter + 5000 25G-PCIE3-8A-2S Security Intelligent Adapter + 5001 25G-PCIE3-8B-2S Security Intelligent Adapter 1c1c Symphony 0001 82C101 1c28 Lite-On IT Corp. / Plextor @@ -21181,6 +21367,9 @@ # Used on V120 VME Crate Controller 1c32 Highland Technology, Inc. 1c33 Daktronics, Inc +1c36 Annapurna Labs Ltd. + 0001 Gigabit Ethernet Adapter + 0002 SFP+ 10G Ethernet Adapter 1c3b Accensus, LLC 0200 Telas2 # http://www.accensusllc.com/accensustelas2.html @@ -21207,6 +21396,7 @@ 5100 EB5100 1c8a TSF5 Corporation 0001 Hunter PCI Express +1c8c Mobiveil, Inc. 1cb1 Collion UG & Co.KG 1cb8 Dawning Information Industry Co., Ltd. 1cc5 Embedded Intelligence, Inc. @@ -21224,6 +21414,8 @@ 0305 Simulyzer-RT CompactPCI Serial CAN-1 card 1cd7 Nanjing Magewell Electronics Co., Ltd. 0010 Pro Capture Endpoint + 0014 PRO CAPTURE AIO 4K PLUS + 0017 PRO CAPTURE AIO 4K 1cdd secunet Security Networks AG 1ce4 Exablaze 0001 ExaNIC X4 @@ -21234,8 +21426,11 @@ 0006 ExaNIC X10-HPT 0007 ExaNIC X40 0008 ExaNIC V5P + 0009 ExaNIC X25 + 0100 ExaDISK FX1 1cf7 Subspace Dynamics 1d00 Pure Storage +1d05 Tongfang Hongkong Limited 1d0f Amazon.com, Inc. cd01 NVMe SSD Controller ec20 Elastic Network Adapter (ENA) @@ -21306,6 +21501,7 @@ 0040 Turbocard2 Accelerator 0080 Open Network Interface Card 80G 00c0 Turbocard3 Accelerator + 0140 Open Network Interface Card 40G e004 AB01/EMB01 Development Board 1d40 Techman Electronics (Changshu) Co., Ltd. 1d44 DPT @@ -21318,12 +21514,14 @@ 1d65 Imagine Communications Corp. 04de Taurus/McKinley 1d6a Aquantia Corp. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 16 08:05: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 69AF01081581; Thu, 16 Aug 2018 08:05:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C42A7317C; Thu, 16 Aug 2018 08:05:05 +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 F20FA16A58; Thu, 16 Aug 2018 08:05:04 +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 w7G854xB015700; Thu, 16 Aug 2018 08:05:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G854Pi015699; Thu, 16 Aug 2018 08:05:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808160805.w7G854Pi015699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Aug 2018 08:05:04 +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: r337893 - stable/11/sys/i386/include X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/i386/include X-SVN-Commit-Revision: 337893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 08:05:05 -0000 Author: hselasky Date: Thu Aug 16 08:05:04 2018 New Revision: 337893 URL: https://svnweb.freebsd.org/changeset/base/337893 Log: MFC r337529: Implement missing atomic_fcmpset_XXX() support for i386. Sponsored by: Mellanox Technologies Modified: stable/11/sys/i386/include/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/include/atomic.h ============================================================================== --- stable/11/sys/i386/include/atomic.h Thu Aug 16 07:34:10 2018 (r337892) +++ stable/11/sys/i386/include/atomic.h Thu Aug 16 08:05:04 2018 (r337893) @@ -128,6 +128,7 @@ u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p) void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) int atomic_cmpset_64(volatile uint64_t *, uint64_t, uint64_t); +int atomic_fcmpset_64(volatile uint64_t *, uint64_t *, uint64_t); uint64_t atomic_load_acq_64(volatile uint64_t *); void atomic_store_rel_64(volatile uint64_t *, uint64_t); uint64_t atomic_swap_64(volatile uint64_t *, uint64_t); @@ -402,6 +403,18 @@ atomic_cmpset_64_i386(volatile uint64_t *dst, uint64_t return (res); } +static __inline int +atomic_fcmpset_64_i386(volatile uint64_t *dst, uint64_t *expect, uint64_t src) +{ + + if (atomic_cmpset_64_i386(dst, *expect, src)) { + return (1); + } else { + *expect = *dst; + return (0); + } +} + static __inline uint64_t atomic_load_acq_64_i386(volatile uint64_t *p) { @@ -481,6 +494,24 @@ atomic_cmpset_64_i586(volatile uint64_t *dst, uint64_t return (res); } +static __inline int +atomic_fcmpset_64_i586(volatile uint64_t *dst, uint64_t *expect, uint64_t src) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " cmpxchg8b %1 ; " + " sete %0" + : "=q" (res), /* 0 */ + "+m" (*dst), /* 1 */ + "+A" (*expect) /* 2 */ + : "b" ((uint32_t)src), /* 3 */ + "c" ((uint32_t)(src >> 32)) /* 4 */ + : "memory", "cc"); + return (res); +} + static __inline uint64_t atomic_load_acq_64_i586(volatile uint64_t *p) { @@ -540,6 +571,16 @@ atomic_cmpset_64(volatile uint64_t *dst, uint64_t expe return (atomic_cmpset_64_i586(dst, expect, src)); } +static __inline int +atomic_fcmpset_64(volatile uint64_t *dst, uint64_t *expect, uint64_t src) +{ + + if ((cpu_feature & CPUID_CX8) == 0) + return (atomic_fcmpset_64_i386(dst, expect, src)); + else + return (atomic_fcmpset_64_i586(dst, expect, src)); +} + static __inline uint64_t atomic_load_acq_64(volatile uint64_t *p) { @@ -653,6 +694,14 @@ atomic_cmpset_long(volatile u_long *dst, u_long expect (u_int)src)); } +static __inline int +atomic_fcmpset_long(volatile u_long *dst, u_long *expect, u_long src) +{ + + return (atomic_fcmpset_int((volatile u_int *)dst, (u_int *)expect, + (u_int)src)); +} + static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long v) { @@ -832,6 +881,8 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); /* Operations on 64-bit quad words. */ #define atomic_cmpset_acq_64 atomic_cmpset_64 #define atomic_cmpset_rel_64 atomic_cmpset_64 +#define atomic_fcmpset_acq_64 atomic_fcmpset_64 +#define atomic_fcmpset_rel_64 atomic_fcmpset_64 #define atomic_fetchadd_acq_64 atomic_fetchadd_64 #define atomic_fetchadd_rel_64 atomic_fetchadd_64 #define atomic_add_acq_64 atomic_add_64 From owner-svn-src-all@freebsd.org Thu Aug 16 08:08: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 302EB1081688; Thu, 16 Aug 2018 08:08:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D747573330; Thu, 16 Aug 2018 08:08:30 +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 B882216A5A; Thu, 16 Aug 2018 08:08:30 +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 w7G88UwI015904; Thu, 16 Aug 2018 08:08:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G88UdZ015903; Thu, 16 Aug 2018 08:08:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808160808.w7G88UdZ015903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Aug 2018 08:08: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: r337894 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 337894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 08:08:31 -0000 Author: hselasky Date: Thu Aug 16 08:08:30 2018 New Revision: 337894 URL: https://svnweb.freebsd.org/changeset/base/337894 Log: MFC r337232: Implement ktime_add_ms() and ktime_before() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Thu Aug 16 08:05:04 2018 (r337893) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Thu Aug 16 08:08:30 2018 (r337894) @@ -86,6 +86,13 @@ ktime_add_ns(ktime_t kt, int64_t ns) } static inline ktime_t +ktime_add_ms(ktime_t kt, int64_t ms) +{ + + return (ktime_add_ns(kt, ms * NSEC_PER_MSEC)); +} + +static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { return (kt - ns); @@ -144,6 +151,13 @@ ktime_after(const ktime_t cmp1, const ktime_t cmp2) { return (ktime_compare(cmp1, cmp2) > 0); +} + +static inline bool +ktime_before(const ktime_t cmp1, const ktime_t cmp2) +{ + + return (ktime_compare(cmp1, cmp2) < 0); } static inline ktime_t From owner-svn-src-all@freebsd.org Thu Aug 16 08:09:26 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 D26BE1081735; Thu, 16 Aug 2018 08:09:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 881927347C; Thu, 16 Aug 2018 08:09:26 +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 6949C16A5C; Thu, 16 Aug 2018 08:09:26 +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 w7G89QCm016006; Thu, 16 Aug 2018 08:09:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G89QE3016005; Thu, 16 Aug 2018 08:09:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808160809.w7G89QE3016005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Aug 2018 08:09: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: r337895 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 337895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 08:09:27 -0000 Author: hselasky Date: Thu Aug 16 08:09:26 2018 New Revision: 337895 URL: https://svnweb.freebsd.org/changeset/base/337895 Log: MFC r337373: Define __poll_t type in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/types.h Thu Aug 16 08:08:30 2018 (r337894) +++ stable/11/sys/compat/linuxkpi/common/include/linux/types.h Thu Aug 16 08:09:26 2018 (r337895) @@ -59,6 +59,7 @@ typedef uint64_t loff_t; typedef vm_paddr_t resource_size_t; typedef uint16_t __bitwise__ __sum16; typedef unsigned long pgoff_t; +typedef unsigned __poll_t; typedef u64 phys_addr_t; From owner-svn-src-all@freebsd.org Thu Aug 16 08:10: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 7A52410817CE; Thu, 16 Aug 2018 08:10:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F8A6735C0; Thu, 16 Aug 2018 08:10:12 +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 10A5616A62; Thu, 16 Aug 2018 08:10:12 +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 w7G8ABrX016123; Thu, 16 Aug 2018 08:10:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G8ABQT016122; Thu, 16 Aug 2018 08:10:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808160810.w7G8ABQT016122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Aug 2018 08:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337896 - stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 337896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 08:10:12 -0000 Author: hselasky Date: Thu Aug 16 08:10:11 2018 New Revision: 337896 URL: https://svnweb.freebsd.org/changeset/base/337896 Log: MFC r337374: Implement atomic_long_cmpxchg() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Aug 16 08:09:26 2018 (r337895) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Aug 16 08:10:11 2018 (r337896) @@ -81,6 +81,21 @@ atomic_long_xchg(atomic_long_t *v, long val) return atomic_swap_long(&v->counter, val); } +static inline long +atomic_long_cmpxchg(atomic_long_t *v, long old, long new) +{ + long ret = old; + + for (;;) { + if (atomic_cmpset_long(&v->counter, old, new)) + break; + ret = READ_ONCE(v->counter); + if (ret != old) + break; + } + return (ret); +} + static inline int atomic_long_add_unless(atomic_long_t *v, long a, long u) { From owner-svn-src-all@freebsd.org Thu Aug 16 08:11: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 4BA29108183E; Thu, 16 Aug 2018 08:11: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01C8973794; Thu, 16 Aug 2018 08:11: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 D716916B99; Thu, 16 Aug 2018 08:11:18 +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 w7G8BIf6017859; Thu, 16 Aug 2018 08:11:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G8BIBN017856; Thu, 16 Aug 2018 08:11:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808160811.w7G8BIBN017856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Aug 2018 08:11: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: r337897 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 337897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 08:11:19 -0000 Author: hselasky Date: Thu Aug 16 08:11:17 2018 New Revision: 337897 URL: https://svnweb.freebsd.org/changeset/base/337897 Log: MFC r337376: Implement current_work() function in the LinuxKPI. Tested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h stable/11/sys/compat/linuxkpi/common/src/linux_work.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Thu Aug 16 08:10:11 2018 (r337896) +++ stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Thu Aug 16 08:11:17 2018 (r337897) @@ -60,6 +60,7 @@ #define TASK_COMM_LEN (MAXCOMLEN + 1) +struct work_struct; struct task_struct { struct thread *task_thread; struct mm_struct *mm; @@ -78,6 +79,7 @@ struct task_struct { TAILQ_ENTRY(task_struct) rcu_entry; int rcu_recurse; int bsd_interrupt_value; + struct work_struct *work; /* current work struct, if set */ }; #define current ({ \ Modified: stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h Thu Aug 16 08:10:11 2018 (r337896) +++ stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h Thu Aug 16 08:11:17 2018 (r337897) @@ -209,6 +209,9 @@ do { \ #define destroy_workqueue(wq) \ linux_destroy_workqueue(wq) +#define current_work() \ + linux_current_work() + /* prototypes */ extern struct workqueue_struct *system_wq; @@ -232,5 +235,6 @@ extern bool linux_flush_work(struct work_struct *); extern bool linux_flush_delayed_work(struct delayed_work *); extern bool linux_work_pending(struct work_struct *); extern bool linux_work_busy(struct work_struct *); +extern struct work_struct *linux_current_work(void); #endif /* _LINUX_WORKQUEUE_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_work.c Thu Aug 16 08:10:11 2018 (r337896) +++ stable/11/sys/compat/linuxkpi/common/src/linux_work.c Thu Aug 16 08:11:17 2018 (r337897) @@ -220,8 +220,9 @@ linux_work_fn(void *context, int pending) struct work_struct *work; struct workqueue_struct *wq; struct work_exec exec; + struct task_struct *task; - linux_set_current(curthread); + task = current; /* setup local variables */ work = context; @@ -240,9 +241,15 @@ linux_work_fn(void *context, int pending) case WORK_ST_CANCEL: WQ_EXEC_UNLOCK(wq); + /* set current work structure */ + task->work = work; + /* call work function */ work->func(work); + /* set current work structure */ + task->work = NULL; + WQ_EXEC_LOCK(wq); /* check if unblocked */ if (exec.target != work) { @@ -577,6 +584,12 @@ linux_init_delayed_work(struct delayed_work *dwork, wo mtx_init(&dwork->timer.mtx, spin_lock_name("lkpi-dwork"), NULL, MTX_DEF | MTX_NOWITNESS); callout_init_mtx(&dwork->timer.callout, &dwork->timer.mtx, 0); +} + +struct work_struct * +linux_current_work(void) +{ + return (current->work); } static void From owner-svn-src-all@freebsd.org Thu Aug 16 08:12: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 3DC491081AA3; Thu, 16 Aug 2018 08:12: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6DDF73B02; Thu, 16 Aug 2018 08:12:37 +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 C8C6C16BED; Thu, 16 Aug 2018 08:12:37 +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 w7G8CbTU021091; Thu, 16 Aug 2018 08:12:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G8Cbvl021088; Thu, 16 Aug 2018 08:12:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808160812.w7G8Cbvl021088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Aug 2018 08:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337898 - in stable/11/sys/compat/linuxkpi/common/include: asm linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common/include: asm linux X-SVN-Commit-Revision: 337898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 08:12:38 -0000 Author: hselasky Date: Thu Aug 16 08:12:36 2018 New Revision: 337898 URL: https://svnweb.freebsd.org/changeset/base/337898 Log: MFC r337527: Use atomic_fcmpset_XXX() instead of atomic_cmpset_XXX() when possible in the LinuxKPI. Suggested by: mjg @ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Aug 16 08:11:17 2018 (r337897) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Aug 16 08:12:36 2018 (r337898) @@ -87,9 +87,8 @@ atomic_long_cmpxchg(atomic_long_t *v, long old, long n long ret = old; for (;;) { - if (atomic_cmpset_long(&v->counter, old, new)) + if (atomic_fcmpset_long(&v->counter, &ret, new)) break; - ret = READ_ONCE(v->counter); if (ret != old) break; } @@ -99,13 +98,12 @@ atomic_long_cmpxchg(atomic_long_t *v, long old, long n static inline int atomic_long_add_unless(atomic_long_t *v, long a, long u) { - long c; + long c = atomic_long_read(v); for (;;) { - c = atomic_long_read(v); if (unlikely(c == u)) break; - if (likely(atomic_cmpset_long(&v->counter, c, c + a))) + if (likely(atomic_fcmpset_long(&v->counter, &c, c + a))) break; } return (c != u); Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Aug 16 08:11:17 2018 (r337897) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Aug 16 08:12:36 2018 (r337898) @@ -108,13 +108,12 @@ atomic_dec(atomic_t *v) static inline int atomic_add_unless(atomic_t *v, int a, int u) { - int c; + int c = atomic_read(v); for (;;) { - c = atomic_read(v); if (unlikely(c == u)) break; - if (likely(atomic_cmpset_int(&v->counter, c, c + a))) + if (likely(atomic_fcmpset_int(&v->counter, &c, c + a))) break; } return (c != u); @@ -134,12 +133,10 @@ atomic_xchg(atomic_t *v, int i) defined(__powerpc__) return (atomic_swap_int(&v->counter, i)); #else - int ret; - for (;;) { - ret = READ_ONCE(v->counter); - if (atomic_cmpset_int(&v->counter, ret, i)) - break; - } + int ret = atomic_read(v); + + while (!atomic_fcmpset_int(&v->counter, &ret, i)) + ; return (ret); #endif } @@ -150,9 +147,8 @@ atomic_cmpxchg(atomic_t *v, int old, int new) int ret = old; for (;;) { - if (atomic_cmpset_int(&v->counter, old, new)) + if (atomic_fcmpset_int(&v->counter, &ret, new)) break; - ret = READ_ONCE(v->counter); if (ret != old) break; } Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h Thu Aug 16 08:11:17 2018 (r337897) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h Thu Aug 16 08:12:36 2018 (r337898) @@ -92,13 +92,12 @@ atomic64_dec(atomic64_t *v) static inline int64_t atomic64_add_unless(atomic64_t *v, int64_t a, int64_t u) { - int64_t c; + int64_t c = atomic64_read(v); for (;;) { - c = atomic64_read(v); if (unlikely(c == u)) break; - if (likely(atomic_cmpset_64(&v->counter, c, c + a))) + if (likely(atomic_fcmpset_64(&v->counter, &c, c + a))) break; } return (c != u); @@ -112,12 +111,10 @@ atomic64_xchg(atomic64_t *v, int64_t i) defined(__powerpc64__) return (atomic_swap_64(&v->counter, i)); #else - int64_t ret; - for (;;) { - ret = READ_ONCE(v->counter); - if (atomic_cmpset_64(&v->counter, ret, i)) - break; - } + int64_t ret = atomic64_read(v); + + while (!atomic_fcmpset_64(&v->counter, &ret, i)) + ; return (ret); #endif } @@ -128,9 +125,8 @@ atomic64_cmpxchg(atomic64_t *v, int64_t old, int64_t n int64_t ret = old; for (;;) { - if (atomic_cmpset_64(&v->counter, old, new)) + if (atomic_fcmpset_64(&v->counter, &ret, new)) break; - ret = READ_ONCE(v->counter); if (ret != old) break; } Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Aug 16 08:11:17 2018 (r337897) +++ stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Aug 16 08:12:36 2018 (r337898) @@ -282,10 +282,10 @@ test_and_clear_bit(long bit, volatile unsigned long *v var += BIT_WORD(bit); bit %= BITS_PER_LONG; bit = (1UL << bit); - do { - val = *var; - } while (atomic_cmpset_long(var, val, val & ~bit) == 0); + val = *var; + while (!atomic_fcmpset_long(var, &val, val & ~bit)) + ; return !!(val & bit); } @@ -312,10 +312,10 @@ test_and_set_bit(long bit, volatile unsigned long *var var += BIT_WORD(bit); bit %= BITS_PER_LONG; bit = (1UL << bit); - do { - val = *var; - } while (atomic_cmpset_long(var, val, val | bit) == 0); + val = *var; + while (!atomic_fcmpset_long(var, &val, val | bit)) + ; return !!(val & bit); } From owner-svn-src-all@freebsd.org Thu Aug 16 09:11: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 A7875108344B; Thu, 16 Aug 2018 09:11:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C8BF75FBE; Thu, 16 Aug 2018 09:11:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D97E1746A; Thu, 16 Aug 2018 09:11:35 +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 w7G9BZBE049620; Thu, 16 Aug 2018 09:11:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G9BZOJ049619; Thu, 16 Aug 2018 09:11:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201808160911.w7G9BZOJ049619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 16 Aug 2018 09:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337899 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 337899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 09:11:35 -0000 Author: emaste Date: Thu Aug 16 09:11:34 2018 New Revision: 337899 URL: https://svnweb.freebsd.org/changeset/base/337899 Log: Enable LLD_IS_LD by default on armv7 lld should now be a usable linker for armv7, and is already used as the bootstrap linker (for linking the kernel and userland). Also enable as the system linker now (/usr/bin/ld) for further testing and evaluation. (This change will be reverted in case of unexpected fallout.) Approved by: manu Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Aug 16 08:12:36 2018 (r337898) +++ head/share/mk/src.opts.mk Thu Aug 16 09:11:34 2018 (r337899) @@ -311,9 +311,9 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND .else __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif -.if ${__T} == "aarch64" || ${__T} == "amd64" +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD -.elif ${__T} == "armv7" || ${__T} == "i386" +.elif ${__T} == "i386" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP __DEFAULT_NO_OPTIONS+=LLD_IS_LD .else From owner-svn-src-all@freebsd.org Thu Aug 16 09:19: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 14AAF1083681; Thu, 16 Aug 2018 09:19:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B904E76280; Thu, 16 Aug 2018 09:19:06 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AB46175A1; Thu, 16 Aug 2018 09:19:06 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7G9J67c052860; Thu, 16 Aug 2018 09:19:06 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G9J63D052859; Thu, 16 Aug 2018 09:19:06 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808160919.w7G9J63D052859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 16 Aug 2018 09:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337900 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 337900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 09:19:07 -0000 Author: ae Date: Thu Aug 16 09:19:06 2018 New Revision: 337900 URL: https://svnweb.freebsd.org/changeset/base/337900 Log: Properly initialize IP version in IPv6 header. This was missed in r334673. Reported by: Lars Schotte Modified: head/sys/netinet6/in6_gif.c Modified: head/sys/netinet6/in6_gif.c ============================================================================== --- head/sys/netinet6/in6_gif.c Thu Aug 16 09:11:34 2018 (r337899) +++ head/sys/netinet6/in6_gif.c Thu Aug 16 09:19:06 2018 (r337900) @@ -201,6 +201,7 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ ip6 = malloc(sizeof(*ip6), M_GIF, M_WAITOK | M_ZERO); ip6->ip6_src = src->sin6_addr; ip6->ip6_dst = dst->sin6_addr; + ip6->ip6_vfc = IPV6_VERSION; if (sc->gif_family != 0) { /* Detach existing tunnel first */ CK_LIST_REMOVE(sc, chain); From owner-svn-src-all@freebsd.org Thu Aug 16 09:35: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 4BEE01083D9B; Thu, 16 Aug 2018 09:35:06 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E332676D7F; Thu, 16 Aug 2018 09:35:05 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id D8DEC1A932; Thu, 16 Aug 2018 09:35:05 +0000 (UTC) Date: Thu, 16 Aug 2018 09:35:05 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org Cc: Kyle Evans , src-committers , Ed Maste , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-11@freebsd.org, Adam Weinberger Subject: Re: svn commit: r337826 - stable/11/bin/ls Message-ID: <20180816093505.GB49543@FreeBSD.org> References: <201808160101.w7G11wZD051008@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201808160101.w7G11wZD051008@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 09:35:06 -0000 On Wed, Aug 15, 2018 at 06:01:58PM -0700, Rodney W. Grimes wrote: > ... > From some other private discussion with Warner I think it may > be wise at this time to revert the MFC until some other things > are done in 12.0 to address some of the concerns and merge a > more complete solution. +1. It was MFCed too promptly and should be backed out, reworked in -CURRENT to overall consensus and only then merged, after sufficient dust settle period (3-6 months). I also want to express appreciation to Rod for his relentless efforts to keep FreeBSD sanity despite all the negative feedback he's getting. ./danfe From owner-svn-src-all@freebsd.org Thu Aug 16 09:37: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 353AF1083E21; Thu, 16 Aug 2018 09:37:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF84D76F20; Thu, 16 Aug 2018 09:36:59 +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 BD680178E4; Thu, 16 Aug 2018 09:36:59 +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 w7G9axe9063239; Thu, 16 Aug 2018 09:36:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G9axq9063238; Thu, 16 Aug 2018 09:36:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201808160936.w7G9axq9063238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 16 Aug 2018 09:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337901 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 337901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 09:37:00 -0000 Author: emaste Date: Thu Aug 16 09:36:59 2018 New Revision: 337901 URL: https://svnweb.freebsd.org/changeset/base/337901 Log: src.conf.5: regen after r337899 WITH_LLD_IS_LD on armv7 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Aug 16 09:19:06 2018 (r337900) +++ head/share/man/man5/src.conf.5 Thu Aug 16 09:36:59 2018 (r337901) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd August 9, 2018 +.Dd August 16, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1011,12 +1011,12 @@ amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp This is a default setting on -amd64/amd64 and arm64/aarch64. +amd64/amd64, arm/armv7 and arm64/aarch64. .It Va WITHOUT_LLVM_COV Set to not build the .Xr llvm-cov 1 From owner-svn-src-all@freebsd.org Thu Aug 16 09:42: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 102A01084054; Thu, 16 Aug 2018 09:42:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3CF97753F; Thu, 16 Aug 2018 09:42:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8506817A5B; Thu, 16 Aug 2018 09:42:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7G9g97p067308; Thu, 16 Aug 2018 09:42:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7G9g9QG067307; Thu, 16 Aug 2018 09:42:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808160942.w7G9g9QG067307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 16 Aug 2018 09:42: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: r337902 - stable/11/sys/netpfil/ipfw/pmod X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw/pmod X-SVN-Commit-Revision: 337902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 09:42:10 -0000 Author: ae Date: Thu Aug 16 09:42:09 2018 New Revision: 337902 URL: https://svnweb.freebsd.org/changeset/base/337902 Log: MFC r337469: Use host byte order when comparing mss values. This fixes tcp-setmss action on little endian machines. PR: 225536 Submitted by: John Zielinski Modified: stable/11/sys/netpfil/ipfw/pmod/tcpmod.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/pmod/tcpmod.c ============================================================================== --- stable/11/sys/netpfil/ipfw/pmod/tcpmod.c Thu Aug 16 09:36:59 2018 (r337901) +++ stable/11/sys/netpfil/ipfw/pmod/tcpmod.c Thu Aug 16 09:42:09 2018 (r337902) @@ -98,7 +98,7 @@ tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, in ret = 0; /* report success */ bcopy(cp + 2, &oldmss, sizeof(oldmss)); /* Do not update lower MSS value */ - if (oldmss <= mss) + if (ntohs(oldmss) <= ntohs(mss)) break; bcopy(&mss, cp + 2, sizeof(mss)); /* Update checksum if it is not delayed. */ From owner-svn-src-all@freebsd.org Thu Aug 16 10:00: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 8BB2B1084A3E; Thu, 16 Aug 2018 10:00:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 420F579BD5; Thu, 16 Aug 2018 10:00:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24DD717C4F; Thu, 16 Aug 2018 10:00:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GA0qTV073597; Thu, 16 Aug 2018 10:00:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GA0pdG073595; Thu, 16 Aug 2018 10:00:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808161000.w7GA0pdG073595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 16 Aug 2018 10:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337903 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 337903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 10:00:52 -0000 Author: andrew Date: Thu Aug 16 10:00:51 2018 New Revision: 337903 URL: https://svnweb.freebsd.org/changeset/base/337903 Log: Remove the L1 and L2 xscale page defines and rename the generic macros to the common name. While here move the macros to check these into pmap-v4.c as they're only used there. Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/pmap-v4.c head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Thu Aug 16 09:42:09 2018 (r337902) +++ head/sys/arm/arm/pmap-v4.c Thu Aug 16 10:00:51 2018 (r337903) @@ -194,6 +194,11 @@ extern struct pv_addr systempage; extern int last_fault_code; +#define l1pte_section_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_S) +#define l2pte_index(v) (((v) & L1_S_OFFSET) >> L2_S_SHIFT) +#define l2pte_valid(pte) ((pte) != 0) +#define l2pte_pa(pte) ((pte) & L2_S_FRAME) + /* * Internal function prototypes */ @@ -444,13 +449,13 @@ pmap_pte_init_generic(void) { pte_l1_s_cache_mode = L1_S_B|L1_S_C; - pte_l1_s_cache_mask = L1_S_CACHE_MASK_generic; + pte_l1_s_cache_mask = L1_S_CACHE_MASK; pte_l2_l_cache_mode = L2_B|L2_C; - pte_l2_l_cache_mask = L2_L_CACHE_MASK_generic; + pte_l2_l_cache_mask = L2_L_CACHE_MASK; pte_l2_s_cache_mode = L2_B|L2_C; - pte_l2_s_cache_mask = L2_S_CACHE_MASK_generic; + pte_l2_s_cache_mask = L2_S_CACHE_MASK; /* * If we have a write-through cache, set B and C. If Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Thu Aug 16 09:42:09 2018 (r337902) +++ head/sys/arm/include/pmap-v4.h Thu Aug 16 10:00:51 2018 (r337903) @@ -249,59 +249,24 @@ extern int pmap_needs_pte_sync; /* * These macros define the various bit masks in the PTE. - * - * We use these macros since we use different bits on different processor - * models. */ -#define L1_S_CACHE_MASK_generic (L1_S_B|L1_S_C) -#define L1_S_CACHE_MASK_xscale (L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X)|\ - L1_S_XSCALE_TEX(TEX_XSCALE_T)) - -#define L2_L_CACHE_MASK_generic (L2_B|L2_C) -#define L2_L_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_L_TEX(TEX_XSCALE_X) | \ - L2_XSCALE_L_TEX(TEX_XSCALE_T)) - -#define L2_S_PROT_U_generic (L2_AP(AP_U)) -#define L2_S_PROT_W_generic (L2_AP(AP_W)) -#define L2_S_PROT_MASK_generic (L2_S_PROT_U|L2_S_PROT_W) - -#define L2_S_PROT_U_xscale (L2_AP0(AP_U)) -#define L2_S_PROT_W_xscale (L2_AP0(AP_W)) -#define L2_S_PROT_MASK_xscale (L2_S_PROT_U|L2_S_PROT_W) - -#define L2_S_CACHE_MASK_generic (L2_B|L2_C) -#define L2_S_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_T_TEX(TEX_XSCALE_X)| \ - L2_XSCALE_T_TEX(TEX_XSCALE_X)) - -#define L1_S_PROTO_generic (L1_TYPE_S | L1_S_IMP) -#define L1_S_PROTO_xscale (L1_TYPE_S) - -#define L1_C_PROTO_generic (L1_TYPE_C | L1_C_IMP2) -#define L1_C_PROTO_xscale (L1_TYPE_C) - +#define L1_S_CACHE_MASK (L1_S_B|L1_S_C) +#define L2_L_CACHE_MASK (L2_B|L2_C) +#define L2_S_PROT_U (L2_AP(AP_U)) +#define L2_S_PROT_W (L2_AP(AP_W)) +#define L2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_W) +#define L2_S_CACHE_MASK (L2_B|L2_C) +#define L1_S_PROTO (L1_TYPE_S | L1_S_IMP) +#define L1_C_PROTO (L1_TYPE_C | L1_C_IMP2) #define L2_L_PROTO (L2_TYPE_L) +#define L2_S_PROTO (L2_TYPE_S) -#define L2_S_PROTO_generic (L2_TYPE_S) -#define L2_S_PROTO_xscale (L2_TYPE_XSCALE_XS) - /* * User-visible names for the ones that vary with MMU class. */ #define L2_AP(x) (L2_AP0(x) | L2_AP1(x) | L2_AP2(x) | L2_AP3(x)) -#define L2_S_PROT_U L2_S_PROT_U_generic -#define L2_S_PROT_W L2_S_PROT_W_generic -#define L2_S_PROT_MASK L2_S_PROT_MASK_generic - -#define L1_S_CACHE_MASK L1_S_CACHE_MASK_generic -#define L2_L_CACHE_MASK L2_L_CACHE_MASK_generic -#define L2_S_CACHE_MASK L2_S_CACHE_MASK_generic - -#define L1_S_PROTO L1_S_PROTO_generic -#define L1_C_PROTO L1_C_PROTO_generic -#define L2_S_PROTO L2_S_PROTO_generic - #if defined(CPU_XSCALE_81342) #define CPU_XSCALE_CORE3 #define PMAP_NEEDS_PTE_SYNC 1 @@ -383,26 +348,6 @@ void pmap_pte_init_generic(void); #define PTE_KERNEL 0 #define PTE_USER 1 -#define l1pte_valid(pde) ((pde) != 0) -#define l1pte_section_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_S) -#define l1pte_page_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_C) -#define l1pte_fpage_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_F) - -#define l2pte_index(v) (((v) & L1_S_OFFSET) >> L2_S_SHIFT) -#define l2pte_valid(pte) ((pte) != 0) -#define l2pte_pa(pte) ((pte) & L2_S_FRAME) -#define l2pte_minidata(pte) (((pte) & \ - (L2_B | L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X)))\ - == (L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X))) - -/* L1 and L2 page table macros */ -#define pmap_pde_v(pde) l1pte_valid(*(pde)) -#define pmap_pde_section(pde) l1pte_section_p(*(pde)) -#define pmap_pde_page(pde) l1pte_page_p(*(pde)) -#define pmap_pde_fpage(pde) l1pte_fpage_p(*(pde)) - -#define pmap_pte_v(pte) l2pte_valid(*(pte)) -#define pmap_pte_pa(pte) l2pte_pa(*(pte)) /* * Flags that indicate attributes of pages or mappings of pages. From owner-svn-src-all@freebsd.org Thu Aug 16 09:29: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 EA0661083B92; Thu, 16 Aug 2018 09:29:28 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 921947692A; Thu, 16 Aug 2018 09:29:28 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 6D9441A76B; Thu, 16 Aug 2018 09:29:28 +0000 (UTC) Date: Thu, 16 Aug 2018 09:29:28 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: Ian Lepore , src-committers , Ed Maste , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-11@freebsd.org, Adam Weinberger , "Rodney W. Grimes" , Kyle Evans Subject: Re: svn commit: r337826 - stable/11/bin/ls Message-ID: <20180816092928.GA49543@FreeBSD.org> References: <201808152026.w7FKQGBN049627@pdx.rh.CN85.dnsmgr.net> <1534364937.1466.11.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-Mailman-Approved-At: Thu, 16 Aug 2018 10:28:42 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 09:29:29 -0000 On Wed, Aug 15, 2018 at 02:32:54PM -0600, Warner Losh wrote: > On Wed, Aug 15, 2018 at 2:28 PM, Ian Lepore wrote: > > On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: > > > > > > > > Will backing out the MFC and leaving this a 12.0 feature end this? > > > =( > > > > > > Sadly no, as the person responded with that reaction when > > > they installed 12.0-ALPHA :-(. > > > > So one whiner can demand of the project that any new feature be removed > > before a new release is made? > > This is a good change. It might be a good change, but it's also very controversial. Traditionally, ls(1) was colorless by default. I don't mind adding COLORTERM (albeit see no reason for this: those who wanted colors could always added -G option to their ls(1) alias or set CLICOLOR variable), but it should definitely lean to being colorless unless explicitly asked. As Rod had pointed out, colors mean you now have to stat(2) file listed which is a significant performance impact. So yeah, there are reasons why people are so fussed about it. Why fix something that ain't broken? Why break POLA? ./danfe From owner-svn-src-all@freebsd.org Thu Aug 16 11: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 00F8E1086DD2; Thu, 16 Aug 2018 11:37:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A12847D0E7; Thu, 16 Aug 2018 11:37:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 2DD271CFEB; Thu, 16 Aug 2018 11:37:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f53.google.com with SMTP id a134-v6so3153780lfe.6; Thu, 16 Aug 2018 04:37:49 -0700 (PDT) X-Gm-Message-State: AOUpUlGcV7jdcLJH39hhmx/fYRJe48ngRj9m/Rg3oMbdUd0u7M8KT4DG 6liFYvlcBZNN98K4HVKt3JoDl8mhw6a9fUSEmMM= X-Google-Smtp-Source: AA+uWPw4u+We9XRkfJC4RDoK9ZmHMUU/zsYqgSv0/XPONYzjo0ZYoORej9UhgM2B/yoZx8NghJZIAbAMEEjbqDX4sGo= X-Received: by 2002:a19:5154:: with SMTP id f81-v6mr1536499lfb.55.1534419467680; Thu, 16 Aug 2018 04:37:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 04:37:27 -0700 (PDT) In-Reply-To: <20180816092928.GA49543@FreeBSD.org> References: <201808152026.w7FKQGBN049627@pdx.rh.CN85.dnsmgr.net> <1534364937.1466.11.camel@freebsd.org> <20180816092928.GA49543@FreeBSD.org> From: Kyle Evans Date: Thu, 16 Aug 2018 06:37:27 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337826 - stable/11/bin/ls To: Alexey Dokuchaev Cc: Warner Losh , Ian Lepore , src-committers , Ed Maste , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-11@freebsd.org, Adam Weinberger , "Rodney W. Grimes" , Kyle Evans Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Thu, 16 Aug 2018 12:21:35 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 11:37:50 -0000 On Thu, Aug 16, 2018 at 4:29 AM, Alexey Dokuchaev wrote: > On Wed, Aug 15, 2018 at 02:32:54PM -0600, Warner Losh wrote: >> On Wed, Aug 15, 2018 at 2:28 PM, Ian Lepore wrote: >> > On Wed, 2018-08-15 at 13:26 -0700, Rodney W. Grimes wrote: >> > > > >> > > > Will backing out the MFC and leaving this a 12.0 feature end this? >> > > =( >> > > >> > > Sadly no, as the person responded with that reaction when >> > > they installed 12.0-ALPHA :-(. >> > >> > So one whiner can demand of the project that any new feature be removed >> > before a new release is made? >> >> This is a good change. > > It might be a good change, but it's also very controversial. Traditionally, > ls(1) was colorless by default. I don't mind adding COLORTERM (albeit see > no reason for this: those who wanted colors could always added -G option to > their ls(1) alias or set CLICOLOR variable), but it should definitely lean > to being colorless unless explicitly asked. As Rod had pointed out, colors > mean you now have to stat(2) file listed which is a significant performance > impact. > > So yeah, there are reasons why people are so fussed about it. Why fix > something that ain't broken? Why break POLA? > Please read the diff before responding with stuff like this and your below e-mail. It was already long backed out by the time you responded, and it behaves exactly as you mention in your first paragraph -- COLORTERM must be set to get color, with the caveat that people apparently don't realize their terminal modifies their environment and sets COLORTERM in addition to setting TERM appropriately. Agreed on the documentation, though there's a lot of other things that also invoke the stat(2). Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu Aug 16 13:03:45 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 2B0A91058BA5 for ; Thu, 16 Aug 2018 13:03:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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 9A23C80C0D for ; Thu, 16 Aug 2018 13:03:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x244.google.com with SMTP id q4-v6so3771272iob.8 for ; Thu, 16 Aug 2018 06:03:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=wcLLm0V7WGIXY0hjU54NL/n9IW7SngCRbU57o1eyPrs=; b=nsbub+TObULlxqVoXqWQUmbjFzXg7VKnUNNApcZwvsBhex95pcJSoAZnqchZNY2VHN 6MvoFaTZTaja0NdLU1xrtE45r0QaT06q4qj/Mj5v03kiyNHWJ2RgjCRVDF+bqMi81sVf C4c8C885R9t0qromKqzp6OzGF/dAaZkF85VvAJZ77fjdWZcfayuK9Gcyb72Frq4fV3Ah OH/SVSocZDdMZxLrid6Ik9CQguJdiX9lf24atmaTXxmGHZG+QeMoTO1LtCTJ4f755XfV cjkUr+r1jnzpD8SaUQy21msi/v5LYZiZ427W1HPU5uk4KCZnnv88wiJtK8mE5ZmHUaeW zhog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wcLLm0V7WGIXY0hjU54NL/n9IW7SngCRbU57o1eyPrs=; b=TMzikOtX0c7l+1G5J9j/3sg4N/6kHKu/8kGdIbcyeyPA92km9bAtO2FFX450FtH9in f4SZUF9sijrjkAXIb7rAvUQbuHUJ7Hxhea1gYv9zPv26+UpKyqcYskS9Z1H+PtONEkrP LIdC79hl7DM1vxKjh2aE2kkq1Kj6iBSdbjnKCt4U8GowJ/RoK8oM2WRAA2jAyaa8Brai dUKRfzlq7/DZzv/r2uZD+bQAigsqiPn9BgYINRi1AOP42eK/M9/UkD4PfFP2m8CdZ7s0 7QcIRvSAX0lOkWmpqwRQcMSKTboNtpvoDHw1z9+CIM7oqhQRoXAAdAaA4da8eqqJLZYs TBsA== X-Gm-Message-State: AOUpUlFqkh0rGwm3RGr904L7M2baLF5Q2GEIjX3rGqmJuJbVCi5hmfpb I1FMC08ZHqT/f2GIR5+w0CHZgjRqg3EH16wbVJvKpA== X-Google-Smtp-Source: AA+uWPz0E0n1nxBG2rX+mR/ID9SpetZ7IA7G46Xr7psK2d3yl/1epM8/Sw5qVGirO4UuvCbbI1sS4wteX/pv8UfuB9o= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr25792754ioa.168.1534424623290; Thu, 16 Aug 2018 06:03:43 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 06:03:42 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <18E7897D-9985-44CE-B648-2A839417B1BC@me.com> References: <201808152225.w7FMP5J2018006@repo.freebsd.org> <1534372134.1466.21.camel@freebsd.org> <05b36083-9f4d-658e-ab39-e8c317d01db7@FreeBSD.org> <18E7897D-9985-44CE-B648-2A839417B1BC@me.com> From: Warner Losh Date: Thu, 16 Aug 2018 07:03:42 -0600 X-Google-Sender-Auth: q9woTel_ek2jFMR9SoDAcZNHNKk Message-ID: Subject: Re: svn commit: r337878 - head/stand/i386/libi386 To: Toomas Soome Cc: John Baldwin , Ian Lepore , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 13:03:45 -0000 On Thu, Aug 16, 2018 at 1:10 AM, Toomas Soome wrote: > > > > On 16 Aug 2018, at 09:59, John Baldwin wrote: > > > > On 8/15/18 11:59 PM, Warner Losh wrote: > >> > >> > >> On Wed, Aug 15, 2018 at 4:28 PM, Ian Lepore ian@freebsd.org>> wrote: > >> > >> On Wed, 2018-08-15 at 22:25 +0000, Toomas Soome wrote: > >>> Author: tsoome > >>> Date: Wed Aug 15 22:25:05 2018 > >>> New Revision: 337878 > >>> URL: https://svnweb.freebsd.org/changeset/base/337878 < > https://svnweb.freebsd.org/changeset/base/337878> > >>> > >>> Log: > >>> libi386: remove bd_read() and bd_write() wrappers > >>> > >>> Those wroappers are nice, but do not really add much value. > >>> > >>> Modified: > >>> head/stand/i386/libi386/biosdisk.c > >>> > >>> Modified: head/stand/i386/libi386/biosdisk.c > >>> ===================================================================== > >>> ========= > >>> --- head/stand/i386/libi386/biosdisk.c Wed Aug 15 21:47:03 > >>> 2018 (r337877) > >>> +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:25:05 > >>> 2018 (r337878) > >>> @@ -94,10 +94,7 @@ static int nbdinfo = 0; > >>> > >>> static void bd_io_workaround(struct disk_devdesc *dev); > >>> > >>> -static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, > >>> - caddr_t dest); > >>> -static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int > >>> blks, > >>> - caddr_t dest); > >>> +static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, int); > >>> static int bd_int13probe(struct bdinfo *bd); > >>> > >>> static int bd_init(void); > >>> @@ -506,7 +503,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > >>> dblk, s > >>> case F_READ: > >>> DEBUG("read %d from %lld to %p", blks, dblk, buf); > >>> > >>> - if (blks && (rc = bd_read(dev, dblk, blks, buf))) { > >>> + if (blks && (rc = bd_io(dev, dblk, blks, buf, 0))) { > >>> /* Filter out floppy controller errors */ > >>> if (BD(dev).bd_flags != BD_FLOPPY || rc != > >>> 0x20) { > >>> printf("read %d from %lld to %p, > >>> error: 0x%x\n", > >>> @@ -518,7 +515,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > >>> dblk, s > >>> case F_WRITE : > >>> DEBUG("write %d from %lld to %p", blks, dblk, buf); > >>> > >>> - if (blks && bd_write(dev, dblk, blks, buf)) { > >>> + if (blks && bd_io(dev, dblk, blks, buf, 1)) { > >>> DEBUG("write error"); > >>> return (EIO); > >>> } > >>> @@ -713,20 +710,6 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, > >>> int blks > >>> } > >>> > >>> return (0); > >>> -} > >>> - > >>> -static int > >>> -bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > >>> dest) > >>> -{ > >>> - > >>> - return (bd_io(dev, dblk, blks, dest, 0)); > >>> -} > >>> - > >>> -static int > >>> -bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > >>> dest) > >>> -{ > >>> - > >>> - return (bd_io(dev, dblk, blks, dest, 1)); > >>> } > >>> > >>> /* > >>> > >> > >> This would be a more satisfying change if there were something like > >> > >> #define BD_RD 0 > >> #define BD_WR 1 > >> > >> so that it was clear at a glance what a bd_io() call is doing. > >> > >> > >> I think that's a good idea... > > > > Arguably the bd_read/write wrappers were even clearer (and there purpose > > was readability in that case). > > Yes thats true, but also will leave us in mercy of inlining etc.. anyhow, > *my* purpose is to get the line of changes done (to be able to perform IO > with >512 sector size, merge with bioscd.c and split up floppy, cd and hdd > cases, so the user can distinguish the devices. > OK, Now I'm confused. All this sounds like regression, apart from the >512 sector thing. Warner From owner-svn-src-all@freebsd.org Thu Aug 16 13:18:41 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 752A4105B36E; Thu, 16 Aug 2018 13:18:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23BB281812; Thu, 16 Aug 2018 13:18:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 042E919DB2; Thu, 16 Aug 2018 13:18:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GDIeVg076963; Thu, 16 Aug 2018 13:18:40 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GDIesD076962; Thu, 16 Aug 2018 13:18:40 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201808161318.w7GDIesD076962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 16 Aug 2018 13:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337904 - in head: lib/libc/resolv share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: lib/libc/resolv share/man/man5 X-SVN-Commit-Revision: 337904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 13:18:41 -0000 Author: bz Date: Thu Aug 16 13:18:40 2018 New Revision: 337904 URL: https://svnweb.freebsd.org/changeset/base/337904 Log: Allow the use of TCP instead of UDP for queries by setting options usevc in resolv.conf which sets RES_USEVC. Reviewed by: ume MFC after: 17 days Differential Revision: https://reviews.freebsd.org/D16607 Modified: head/lib/libc/resolv/res_init.c head/share/man/man5/resolver.5 Modified: head/lib/libc/resolv/res_init.c ============================================================================== --- head/lib/libc/resolv/res_init.c Thu Aug 16 10:00:51 2018 (r337903) +++ head/lib/libc/resolv/res_init.c Thu Aug 16 13:18:40 2018 (r337904) @@ -679,6 +679,8 @@ res_setoptions(res_state statp, const char *options, c statp->options |= RES_INSECURE2; } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) { statp->options |= RES_ROTATE; + } else if (!strncmp(cp, "usevc", sizeof("usevc") - 1)) { + statp->options |= RES_USEVC; } else if (!strncmp(cp, "no-check-names", sizeof("no-check-names") - 1)) { statp->options |= RES_NOCHECKNAME; Modified: head/share/man/man5/resolver.5 ============================================================================== --- head/share/man/man5/resolver.5 Thu Aug 16 10:00:51 2018 (r337903) +++ head/share/man/man5/resolver.5 Thu Aug 16 13:18:40 2018 (r337904) @@ -28,7 +28,7 @@ .\" @(#)resolver.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 12, 2015 +.Dd August 16, 2018 .Dt RESOLVER 5 .Os .Sh NAME @@ -127,6 +127,10 @@ is one of the following: sets .Dv RES_DEBUG in _res.options. +.It Sy usevc +sets +.Dv RES_USEVC +to use TCP instead of UDP for queries. .It Sy ndots: Ns Ar n sets a threshold for the number of dots which must appear in a name given to .Fn res_query From owner-svn-src-all@freebsd.org Thu Aug 16 13:27: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 6A888105B9A6; Thu, 16 Aug 2018 13:27:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 1B6B082294; Thu, 16 Aug 2018 13:27:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from dhcp-10-248-98-203.eduroam.wireless.private.cam.ac.uk (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by mail.baldwin.cx (Postfix) with ESMTPSA id C4D4410AFCD; Thu, 16 Aug 2018 09:27:04 -0400 (EDT) Subject: Re: svn commit: r337648 - in head: etc etc/defaults etc/periodic usr.sbin/periodic usr.sbin/periodic/etc usr.sbin/periodic/etc/daily usr.sbin/periodic/etc/monthly usr.sbin/periodic/etc/security usr.sbi... To: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808111711.w7BHB9bt042827@repo.freebsd.org> From: John Baldwin Message-ID: Date: Thu, 16 Aug 2018 14:27:03 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808111711.w7BHB9bt042827@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 16 Aug 2018 09:27:05 -0400 (EDT) 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.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 13:27:06 -0000 On 8/11/18 6:11 PM, Brad Davis wrote: > Author: brd > Date: Sat Aug 11 17:11:08 2018 > New Revision: 337648 > URL: https://svnweb.freebsd.org/changeset/base/337648 > > Log: > Move all periodic related config and scripts to usr.sbin/periodic/ > > This makes pkgbase easier by tagging these as CONFS so they are properly > tagged as config files. > > Approved by: will (mentor) > Sponsored by: Essen Hackathon > Differential Revision: https://reviews.freebsd.org/D16553 After this, 'make distribution' no longer installs /etc/defaults/periodic.conf and etcupdate wants to remove it (due to FILES vs CONF). I think mergemaster won't notice. In my case the differing $FreeBSD$ made etcupdate just emit a warning saying a modified file couldn't be removed, but if someone wasn't using an svn client that expanded the tags it would be removed. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Aug 16 13:29: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 EDA9D105BB0F; Thu, 16 Aug 2018 13:29:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A35C182558; Thu, 16 Aug 2018 13:29:23 +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 849DE19FD8; Thu, 16 Aug 2018 13:29:23 +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 w7GDTNNE082753; Thu, 16 Aug 2018 13:29:23 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GDTNhh082752; Thu, 16 Aug 2018 13:29:23 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201808161329.w7GDTNhh082752@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: Thu, 16 Aug 2018 13:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337905 - 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: 337905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 13:29:24 -0000 Author: 0mp (ports committer) Date: Thu Aug 16 13:29:23 2018 New Revision: 337905 URL: https://svnweb.freebsd.org/changeset/base/337905 Log: Tidy up the ports.7 manual page. - Use "Dq Li" for inline commands as we do in other manuals. - Pet "igor" and "mandoc -Tlint". - Reword some parts for clarity. - Add missing Xr macros. - Reformat SEE ALSO to make the section more readable. Reviewed by: eadler, krion, mat Approved by: krion (mentor), mat (mentor) Differential Revision: https://reviews.freebsd.org/D15350 Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Thu Aug 16 13:18:40 2018 (r337904) +++ head/share/man/man7/ports.7 Thu Aug 16 13:29:23 2018 (r337905) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 11, 2018 +.Dd August 16, 2018 .Dt PORTS 7 .Os .Sh NAME @@ -48,9 +48,8 @@ individual ports. Each port is a directory with metadata and patches necessary to make the original application source code compile and run on .Fx . -Compiling an -application is as simple as typing -.Nm make Cm build +Compiling an application is as simple as typing +.Dq Li "make build" in the port directory. The .Pa Makefile @@ -60,18 +59,24 @@ applies the patches, and compiles it. It also recursively handles dependencies \(em other pieces of software the port depends on in order to build and work. Afterwards, -.Nm make Cm install +.Dq Li "make install" installs the application. .Pp For more information about using ports, see the .Dq "Packages and Ports" section in -.%B "The FreeBSD Handbook": +.Sm off +.%B "The FreeBSD Handbook" +.No \&: +.Sm on .Pp .Lk https://www.FreeBSD.org/doc/en/books/handbook/ports.html .Pp For information about creating new ports, see -.%B "The Porter's Handbook": +.Sm off +.%B "The Porter's Handbook" +.No \&: +.Sm on .Pp .Lk https://www.FreeBSD.org/doc/en/books/porters-handbook/ .Sh TARGETS @@ -80,7 +85,7 @@ Some of the targets work recursively through subdirectories. This lets you, for example, install all of the .Dq Li biology -ports. +ports with one command. The targets that do this are .Cm build , checksum , clean , configure , .Cm depends , extract , fetch , install , @@ -91,9 +96,7 @@ The following targets will be run automatically by eac target in order. That is, .Cm build -will be run -(if necessary) -by +will be run (if necessary) by .Cm install , and so on all the way to .Cm fetch . @@ -446,7 +449,7 @@ Command to get .Cm fetchindex target). Defaults to -.Dq Nm fetch Fl am . +.Dq Li "fetch -am" . .It Va NOCLEANDEPENDS If defined, do not let .Cm clean @@ -459,7 +462,7 @@ Normally If set, overwrite any existing package registration on the system. .It Va MOTIFLIB Location of -.Pa libXm. Ns Brq Pa a , Ns Pa so . +.Pa "libXm\&." Ns Brq Pa a , Ns Pa so . .It Va INTERACTIVE If defined, only operate on a port if it requires interaction. .It Va BATCH @@ -528,12 +531,14 @@ If set, enables the use of .Xr ccache 1 for building ports. .It Va CCACHE_DIR -Which directory to use for the ccache data. +Which directory to use for the +.Xr ccache 1 +data. .El .Sh FILES .Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact .It Pa /usr/ports -The default ports directory +The default ports directory. .It Pa /usr/ports/Mk/bsd.port.mk The big Kahuna. .El @@ -546,19 +551,24 @@ make install .Sh SEE ALSO .Xr make 1 , .Xr make.conf 5 , -.Xr pkg 8 , +.Xr pkg 7 , .Xr portsnap 8 .Pp -The following are part of the ports collection: -.Pp -.Xr pkg 7 , +Additional developer documentation: +.Bl -dash -width "" -offset indent +.It .Xr portlint 1 -.Rs -.%B "The FreeBSD Handbook" -.Re +.It +.Pa /usr/ports/Mk/bsd.port.mk +.El .Pp -.Pa https://www.FreeBSD.org/ports -(searchable index of all ports) +Additional user documentation: +.Bl -dash -width "" -offset indent +.It +.Xr pkg 8 +.It +.Lk "https://www.FreeBSD.org/ports" "Searchable index of all ports" +.El .Sh HISTORY The Ports Collection appeared in From owner-svn-src-all@freebsd.org Thu Aug 16 13:42:09 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 489081066576; Thu, 16 Aug 2018 13:42:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2A1A82F51; Thu, 16 Aug 2018 13:42:08 +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 D40291A30D; Thu, 16 Aug 2018 13:42:08 +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 w7GDg8gV092976; Thu, 16 Aug 2018 13:42:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GDg8uE092974; Thu, 16 Aug 2018 13:42:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808161342.w7GDg8uE092974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Aug 2018 13:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337906 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 337906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 13:42:09 -0000 Author: kevans Date: Thu Aug 16 13:42:08 2018 New Revision: 337906 URL: https://svnweb.freebsd.org/changeset/base/337906 Log: build(7): Document KERNCONFDIR - directory in which KERNCONF resides MFC after: 1 week Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Thu Aug 16 13:29:23 2018 (r337905) +++ head/share/man/man7/build.7 Thu Aug 16 13:42:08 2018 (r337906) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 11, 2018 +.Dd August 16, 2018 .Dt BUILD 7 .Os .Sh NAME @@ -492,6 +492,14 @@ Overrides which kernel to build and install for the va make targets. It defaults to .Cm GENERIC . +.It Va KERNCONFDIR +Overrides the directory in which +.Va KERNCONF +and any files included by +.Va KERNCONF +should be found. +Defaults to +.Pa sys/${ARCH}/conf . .It Va KERNFAST If set, the build target .Cm buildkernel From owner-svn-src-all@freebsd.org Thu Aug 16 14:00: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 CD0E01066F5B; Thu, 16 Aug 2018 14:00:51 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp002.me.com (st13p35im-asmtp002.me.com [17.164.199.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7704C83BC0; Thu, 16 Aug 2018 14:00:51 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp002.me.com by st13p35im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) id <0PDK004003Q0K100@st13p35im-asmtp002.me.com>; Thu, 16 Aug 2018 14:00:43 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPSA id <0PDK00NZ748T3610@st13p35im-asmtp002.me.com>; Thu, 16 Aug 2018 14:00:39 +0000 (GMT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1808160147 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-16_03:,, signatures=0 From: Toomas Soome Message-id: <4A015D53-1336-4E7F-B53E-28ACEBA3318A@me.com> MIME-version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r337878 - head/stand/i386/libi386 Date: Thu, 16 Aug 2018 17:00:29 +0300 In-reply-to: Cc: John Baldwin , Ian Lepore , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Warner Losh References: <201808152225.w7FMP5J2018006@repo.freebsd.org> <1534372134.1466.21.camel@freebsd.org> <05b36083-9f4d-658e-ab39-e8c317d01db7@FreeBSD.org> <18E7897D-9985-44CE-B648-2A839417B1BC@me.com> X-Mailer: Apple Mail (2.3445.9.1) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 14:00:52 -0000 > On 16 Aug 2018, at 16:03, Warner Losh wrote: >=20 >=20 >=20 > On Thu, Aug 16, 2018 at 1:10 AM, Toomas Soome > wrote: >=20 >=20 > > On 16 Aug 2018, at 09:59, John Baldwin wrote: > >=20 > > On 8/15/18 11:59 PM, Warner Losh wrote: > >>=20 > >>=20 > >> On Wed, Aug 15, 2018 at 4:28 PM, Ian Lepore >> wrote: > >>=20 > >> On Wed, 2018-08-15 at 22:25 +0000, Toomas Soome wrote: > >>> Author: tsoome > >>> Date: Wed Aug 15 22:25:05 2018 > >>> New Revision: 337878 > >>> URL: https://svnweb.freebsd.org/changeset/base/337878 = = > > >>>=20 > >>> Log: > >>> libi386: remove bd_read() and bd_write() wrappers > >>> =20 > >>> Those wroappers are nice, but do not really add much value. > >>>=20 > >>> Modified: > >>> head/stand/i386/libi386/biosdisk.c > >>>=20 > >>> Modified: head/stand/i386/libi386/biosdisk.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/stand/i386/libi386/biosdisk.c Wed Aug 15 21:47:03 > >>> 2018 (r337877) > >>> +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:25:05 > >>> 2018 (r337878) > >>> @@ -94,10 +94,7 @@ static int nbdinfo =3D 0; > >>> =20 > >>> static void bd_io_workaround(struct disk_devdesc *dev); > >>> =20 > >>> -static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int = blks, > >>> - caddr_t dest); > >>> -static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int > >>> blks, > >>> - caddr_t dest); > >>> +static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, = int); > >>> static int bd_int13probe(struct bdinfo *bd); > >>> =20 > >>> static int bd_init(void); > >>> @@ -506,7 +503,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > >>> dblk, s > >>> case F_READ: > >>> DEBUG("read %d from %lld to %p", blks, dblk, buf); > >>> =20 > >>> - if (blks && (rc =3D bd_read(dev, dblk, blks, buf))) = { > >>> + if (blks && (rc =3D bd_io(dev, dblk, blks, buf, 0))) = { > >>> /* Filter out floppy controller errors */ > >>> if (BD(dev).bd_flags !=3D BD_FLOPPY || rc !=3D= > >>> 0x20) { > >>> printf("read %d from %lld to %p, > >>> error: 0x%x\n", > >>> @@ -518,7 +515,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > >>> dblk, s > >>> case F_WRITE : > >>> DEBUG("write %d from %lld to %p", blks, dblk, buf); > >>> =20 > >>> - if (blks && bd_write(dev, dblk, blks, buf)) { > >>> + if (blks && bd_io(dev, dblk, blks, buf, 1)) { > >>> DEBUG("write error"); > >>> return (EIO); > >>> } > >>> @@ -713,20 +710,6 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, > >>> int blks > >>> } > >>> =20 > >>> return (0); > >>> -} > >>> - > >>> -static int > >>> -bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > >>> dest) > >>> -{ > >>> - > >>> - return (bd_io(dev, dblk, blks, dest, 0)); > >>> -} > >>> - > >>> -static int > >>> -bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, = caddr_t > >>> dest) > >>> -{ > >>> - > >>> - return (bd_io(dev, dblk, blks, dest, 1)); > >>> } > >>> =20 > >>> /* > >>>=20 > >>=20 > >> This would be a more satisfying change if there were something = like > >>=20 > >> #define BD_RD 0 > >> #define BD_WR 1 > >>=20 > >> so that it was clear at a glance what a bd_io() call is doing. > >>=20 > >>=20 > >> I think that's a good idea... > >=20 > > Arguably the bd_read/write wrappers were even clearer (and there = purpose > > was readability in that case). >=20 > Yes thats true, but also will leave us in mercy of inlining etc.. = anyhow, *my* purpose is to get the line of changes done (to be able to = perform IO with >512 sector size, merge with bioscd.c and split up = floppy, cd and hdd cases, so the user can distinguish the devices. >=20 > OK, Now I'm confused. All this sounds like regression, apart from the = >512 sector thing. >=20 > Warner Oh sorry, it was bad wording I think - the split up in sense that = currently the BIOS loader can not distinguish floppy from disk, so the = user has to guess if diskX is floppy or disk - so I want to make the = device list for user very clear (fdX:, cdX:, diskX: as its already done = in EFI version). The code should be consolidated (biosdisk + bioscd). rgds, toomas From owner-svn-src-all@freebsd.org Thu Aug 16 14:03: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 8FAA41067245; Thu, 16 Aug 2018 14:03:57 +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 0259583FA2; Thu, 16 Aug 2018 14:03:56 +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 w7GE3qu5053697; Thu, 16 Aug 2018 07:03:52 -0700 (PDT) (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 w7GE3q3l053696; Thu, 16 Aug 2018 07:03:52 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808161403.w7GE3q3l053696@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve In-Reply-To: <201808160631.w7G6VsS8064579@repo.freebsd.org> To: Marcelo Araujo Date: Thu, 16 Aug 2018 07:03:52 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 14:03:57 -0000 > Author: araujo > Date: Thu Aug 16 06:31:54 2018 > New Revision: 337887 > URL: https://svnweb.freebsd.org/changeset/base/337887 > > Log: > Add a comment explaining how the PSN works and why there is no need for > a null terminator. Also mark CID 1394825 as intentional. > > Reported by: Coverity > CID: 1394825 > MFC after: 1 week > Sponsored by: iXsystems Inc. > > Modified: > head/usr.sbin/bhyve/pci_nvme.c > > Modified: head/usr.sbin/bhyve/pci_nvme.c > ============================================================================== > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 (r337886) > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 (r337887) > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o > } else if (!strcmp("sectsz", xopts)) { > sectsz = atoi(config); > } else if (!strcmp("ser", xopts)) { > + /* > + * This field indicates the Product Serial Number in > + * 8-bit ASCII, unused bytes should be NULL characters. > + * Ref: NVM Express Management Interface 1.0a. > + */ I have seen this before on ATA devices, if the vendor fills all bytes of PSN, there well be no unused bytes, so no null byte at the end, and you end up with an unterminated string. Can you please verify that this edge case is handled correctly? Thanks, Rod > memset(sc->ctrldata.sn, 0, sizeof(sc->ctrldata.sn)); > strncpy(sc->ctrldata.sn, config, > sizeof(sc->ctrldata.sn)); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 16 14:26: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 D63EA1067B50 for ; Thu, 16 Aug 2018 14:26:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (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 5785884DCA for ; Thu, 16 Aug 2018 14:26:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id j81-v6so6525018ite.0 for ; Thu, 16 Aug 2018 07:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=W0AjuYMKI/wKDM3kqg45MWRImSLQKJ1Ufp5CgNw/2Zw=; b=feqsV8gHmwGKbxAx9WwMY/sU58B1+T8iT0K0xE45x1NLXNaLCP1TYKqj76qWuG3dF9 xYZvm5MdXjDzFHsN2gRHwVB0ZRWv+180UzyfCBObvqIXBUX6rStDTqh2CsoKDkPJMZyH fghJjELJFHmXzJuNadS6b7aBDC0L2fbNmgLbESdhNmaWEf3uDYp+AOnaoQcUZM1kjBor FEdyq4ZPMICllXmbLPDXgUTYEitfnNYrTTja8XHKQMxd0NDTPcwH3cwgoGHoVZ+/VS6z QS0ralwcTDkiN5YI8BulmhV/SRBhT0wCmhwHZsyu3Rd+//V6Hs8WkYX707ZpU9pTdCJ6 AXuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=W0AjuYMKI/wKDM3kqg45MWRImSLQKJ1Ufp5CgNw/2Zw=; b=lqPeIks0jiZtj1L5TF3qVLvisk0TVvPWbUbAxStNYc59HPlzkd1mULWILK7lxHMeZn bMrU8NYRylGKouHlFpeEDepdPU3QHkB0Za0y9yNXrhe6QK/SiDuUAYouaZvx0NI6lVgC oTIR8lPU0yVPDj3x5olymr1JVgoKe4/ON1ZSfjw9nbTk/w8qTryt5Evl+mwqOy13CobQ bKZJ9D5kIYJE13c8mSzCQqt84sc/29VXAzom9pWtCKohjPYvkgxlYej9ujqbHKZtFmOe mhiOTnFOVKroSXH/Ko7/t9oKZE7XjwBRNhiBC3CCxlvs6wyYlzrWXnhIvZw02XhxI8kW ztcw== X-Gm-Message-State: AOUpUlEscSQkWuOwmL7XwymRnfCtY+k0B5uj/dSvXuXn/C8TIcYwrr0X EhDO1T4/lDyOuUsz5M5QQz2i10Ey4IJxnT6iLcwoOA== X-Google-Smtp-Source: AA+uWPwfNkF7nHI0U8hGb7KWkQTxJrqmLkcnWHfG/+xZ8fnzfSR25F/UaeiH4rOzbGCdJuXgT2blEvevYQ7PqSAz/b0= X-Received: by 2002:a02:a701:: with SMTP id k1-v6mr27332670jam.140.1534429602567; Thu, 16 Aug 2018 07:26:42 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 07:26:42 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201808161403.w7GE3q3l053696@pdx.rh.CN85.dnsmgr.net> References: <201808160631.w7G6VsS8064579@repo.freebsd.org> <201808161403.w7GE3q3l053696@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Thu, 16 Aug 2018 08:26:42 -0600 X-Google-Sender-Auth: bxUfy_OsOdvo_NA04YdDgnVC3hc Message-ID: Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve To: "Rodney W. Grimes" Cc: Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 14:26:44 -0000 On Thu, Aug 16, 2018 at 8:03 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: araujo > > Date: Thu Aug 16 06:31:54 2018 > > New Revision: 337887 > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > Log: > > Add a comment explaining how the PSN works and why there is no need for > > a null terminator. Also mark CID 1394825 as intentional. > > > > Reported by: Coverity > > CID: 1394825 > > MFC after: 1 week > > Sponsored by: iXsystems Inc. > > > > Modified: > > head/usr.sbin/bhyve/pci_nvme.c > > > > Modified: head/usr.sbin/bhyve/pci_nvme.c > > ============================================================ > ================== > > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > (r337886) > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > (r337887) > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, > char *o > > } else if (!strcmp("sectsz", xopts)) { > > sectsz = atoi(config); > > } else if (!strcmp("ser", xopts)) { > > + /* > > + * This field indicates the Product Serial Number > in > > + * 8-bit ASCII, unused bytes should be NULL > characters. > > + * Ref: NVM Express Management Interface 1.0a. > > + */ > > I have seen this before on ATA devices, > if the vendor fills all bytes of PSN, > there well be no unused bytes, > so no null byte at the end, > and you end up with an unterminated string. > > Can you please verify that this edge case is handled correctly? > Thanks, > Rod > > > memset(sc->ctrldata.sn, 0, sizeof(sc->ctrldata.sn > )); > > strncpy(sc->ctrldata.sn, config, > > sizeof(sc->ctrldata.sn)); > > > strncpy will not NUL terminate when there's exactly sizeof(ctrldata.sn) bytes in the 'config' string. Thus that case where all characters are non-NUL is handled properly (the standard says the string need not be NUL terminated). Keep in mind, though, that ATA is 100% irrelevant to NVMe, since the NVMe standard specifies everything. I've sent a followup to marcelo though about the 8-bit and NUL details, however, since I have conflicting info about that. Warner From owner-svn-src-all@freebsd.org Thu Aug 16 14:28:41 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 389B31067C24 for ; Thu, 16 Aug 2018 14:28:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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 B603D84F4E for ; Thu, 16 Aug 2018 14:28:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x244.google.com with SMTP id w11-v6so4029454iob.2 for ; Thu, 16 Aug 2018 07:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=jWzBgGpO9DbC25LpzoN0zuA8eIiodIkjAYSyBdgrAjY=; b=kUErp9tMuwolBaoDVZPdeYN1xkI1Ea/qyviShBr02OlI+CPNJWgU6k9T/8GkBuXwWm AIeS0OhAoOo+Sno2A3LffzD6Wp3cb3qVwra4Xcm5Wpau9aSufpPVKsC5lxVZ/ZVyNVIy UGRp/+O2wD+nNoDEx8nFKwpkv+AduPx4FkmDn5Tq587YSEEohfyFbJl77shGf4/2fByd mxtGmcl3HgySqx/OWbUi/Rb5p3qHdrHcsAZtlITtSiZsFG2wNF/VhSLZM7OTejxBhbWf G/q06Oulz8ZXfI/DThVrYUBH0/3SjQijA0yzPZFTWtVi2NDekkdsT8ySeOaYNsoMuXeD sbaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=jWzBgGpO9DbC25LpzoN0zuA8eIiodIkjAYSyBdgrAjY=; b=An7idWr08BpbzAh6yJE7HZIFSXQK3hzKPGdH6CstXbK7QM4omngI4/c7UuYqpXF/hm PBeal+vs6GNPVL9m2op+e7yvJUORn7EYz5N8VHG+1tfV4FaDMdr5fkumf+2Al2VYU5Gl m+ah6JwafJm3z+SVAHHqovFtj6hQuf5cxz8JAA9w2dXBCVmqhDm+NdPw3OMX/C9JKey3 5rCKn2IFC0TALAZQ5dOEJAD5lfTaeOO2YNeleL1DADZfEe3rlrIs5218VlWZyFGievx5 Nyv9/u5hc3/jrpmadi2/JmIKO5P2CKOnin/IcX/erm2WcX2A5ujZDU2nJjwAtvGGm7oC hYnQ== X-Gm-Message-State: AOUpUlELLCtFoqDtzYyhZWIBK/8w+o4BinaCcFhUa0cfBW323UITcbb2 Eag/7Ifd5v08XGEpPwSo+09sCXqy+TmtdqaN2dh8mA== X-Google-Smtp-Source: AA+uWPyXPwcb+j3wGbTYAUkWmLrIPsiYs//BBmj281fWOiDc0yBCQuXcPBjIpPi17e6uh3sQb81pg/J5a+KfyMq0XfY= X-Received: by 2002:a6b:d004:: with SMTP id x4-v6mr25460565ioa.299.1534429720002; Thu, 16 Aug 2018 07:28:40 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 07:28:39 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <4A015D53-1336-4E7F-B53E-28ACEBA3318A@me.com> References: <201808152225.w7FMP5J2018006@repo.freebsd.org> <1534372134.1466.21.camel@freebsd.org> <05b36083-9f4d-658e-ab39-e8c317d01db7@FreeBSD.org> <18E7897D-9985-44CE-B648-2A839417B1BC@me.com> <4A015D53-1336-4E7F-B53E-28ACEBA3318A@me.com> From: Warner Losh Date: Thu, 16 Aug 2018 08:28:39 -0600 X-Google-Sender-Auth: -irifzsMUHjhEN5YlqxjAh06wpM Message-ID: Subject: Re: svn commit: r337878 - head/stand/i386/libi386 To: Toomas Soome Cc: John Baldwin , Ian Lepore , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 14:28:41 -0000 On Thu, Aug 16, 2018 at 8:00 AM, Toomas Soome wrote: > > > On 16 Aug 2018, at 16:03, Warner Losh wrote: > > > > On Thu, Aug 16, 2018 at 1:10 AM, Toomas Soome wrote: > >> >> >> > On 16 Aug 2018, at 09:59, John Baldwin wrote: >> > >> > On 8/15/18 11:59 PM, Warner Losh wrote: >> >> >> >> >> >> On Wed, Aug 15, 2018 at 4:28 PM, Ian Lepore > ian@freebsd.org>> wrote: >> >> >> >> On Wed, 2018-08-15 at 22:25 +0000, Toomas Soome wrote: >> >>> Author: tsoome >> >>> Date: Wed Aug 15 22:25:05 2018 >> >>> New Revision: 337878 >> >>> URL: https://svnweb.freebsd.org/changeset/base/337878 > ps://svnweb.freebsd.org/changeset/base/337878> >> >>> >> >>> Log: >> >>> libi386: remove bd_read() and bd_write() wrappers >> >>> >> >>> Those wroappers are nice, but do not really add much value. >> >>> >> >>> Modified: >> >>> head/stand/i386/libi386/biosdisk.c >> >>> >> >>> Modified: head/stand/i386/libi386/biosdisk.c >> >>> ===================================================================== >> >>> ========= >> >>> --- head/stand/i386/libi386/biosdisk.c Wed Aug 15 21:47:03 >> >>> 2018 (r337877) >> >>> +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:25:05 >> >>> 2018 (r337878) >> >>> @@ -94,10 +94,7 @@ static int nbdinfo = 0; >> >>> >> >>> static void bd_io_workaround(struct disk_devdesc *dev); >> >>> >> >>> -static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, >> >>> - caddr_t dest); >> >>> -static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int >> >>> blks, >> >>> - caddr_t dest); >> >>> +static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, int); >> >>> static int bd_int13probe(struct bdinfo *bd); >> >>> >> >>> static int bd_init(void); >> >>> @@ -506,7 +503,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t >> >>> dblk, s >> >>> case F_READ: >> >>> DEBUG("read %d from %lld to %p", blks, dblk, buf); >> >>> >> >>> - if (blks && (rc = bd_read(dev, dblk, blks, buf))) { >> >>> + if (blks && (rc = bd_io(dev, dblk, blks, buf, 0))) { >> >>> /* Filter out floppy controller errors */ >> >>> if (BD(dev).bd_flags != BD_FLOPPY || rc != >> >>> 0x20) { >> >>> printf("read %d from %lld to %p, >> >>> error: 0x%x\n", >> >>> @@ -518,7 +515,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t >> >>> dblk, s >> >>> case F_WRITE : >> >>> DEBUG("write %d from %lld to %p", blks, dblk, buf); >> >>> >> >>> - if (blks && bd_write(dev, dblk, blks, buf)) { >> >>> + if (blks && bd_io(dev, dblk, blks, buf, 1)) { >> >>> DEBUG("write error"); >> >>> return (EIO); >> >>> } >> >>> @@ -713,20 +710,6 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, >> >>> int blks >> >>> } >> >>> >> >>> return (0); >> >>> -} >> >>> - >> >>> -static int >> >>> -bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t >> >>> dest) >> >>> -{ >> >>> - >> >>> - return (bd_io(dev, dblk, blks, dest, 0)); >> >>> -} >> >>> - >> >>> -static int >> >>> -bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t >> >>> dest) >> >>> -{ >> >>> - >> >>> - return (bd_io(dev, dblk, blks, dest, 1)); >> >>> } >> >>> >> >>> /* >> >>> >> >> >> >> This would be a more satisfying change if there were something like >> >> >> >> #define BD_RD 0 >> >> #define BD_WR 1 >> >> >> >> so that it was clear at a glance what a bd_io() call is doing. >> >> >> >> >> >> I think that's a good idea... >> > >> > Arguably the bd_read/write wrappers were even clearer (and there purpose >> > was readability in that case). >> >> Yes thats true, but also will leave us in mercy of inlining etc.. anyhow, >> *my* purpose is to get the line of changes done (to be able to perform IO >> with >512 sector size, merge with bioscd.c and split up floppy, cd and hdd >> cases, so the user can distinguish the devices. >> > > OK, Now I'm confused. All this sounds like regression, apart from the >512 > sector thing. > > Warner > > > Oh sorry, it was bad wording I think - the split up in sense that > currently the BIOS loader can not distinguish floppy from disk, so the user > has to guess if diskX is floppy or disk - so I want to make the device > list for user very clear (fdX:, cdX:, diskX: as its already done in EFI > version). The code should be consolidated (biosdisk + bioscd). > OK. I have concerns, but be sure to put me on the code review so we can talk about it there when there's a concrete example to talk about. Warner From owner-svn-src-all@freebsd.org Thu Aug 16 14:34: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 260DC1067E6D; Thu, 16 Aug 2018 14:34:19 +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 829E5853C5; Thu, 16 Aug 2018 14:34:18 +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 w7GEYEov053814; Thu, 16 Aug 2018 07:34:14 -0700 (PDT) (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 w7GEYEsm053813; Thu, 16 Aug 2018 07:34:14 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808161434.w7GEYEsm053813@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve In-Reply-To: To: Warner Losh Date: Thu, 16 Aug 2018 07:34:14 -0700 (PDT) CC: "Rodney W. Grimes" , Marcelo Araujo , src-committers , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 14:34:19 -0000 > On Thu, Aug 16, 2018 at 8:03 AM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > Author: araujo > > > Date: Thu Aug 16 06:31:54 2018 > > > New Revision: 337887 > > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > > > Log: > > > Add a comment explaining how the PSN works and why there is no need for > > > a null terminator. Also mark CID 1394825 as intentional. > > > > > > Reported by: Coverity > > > CID: 1394825 > > > MFC after: 1 week > > > Sponsored by: iXsystems Inc. > > > > > > Modified: > > > head/usr.sbin/bhyve/pci_nvme.c > > > > > > Modified: head/usr.sbin/bhyve/pci_nvme.c > > > ============================================================ > > ================== > > > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > > (r337886) > > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > > (r337887) > > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, > > char *o > > > } else if (!strcmp("sectsz", xopts)) { > > > sectsz = atoi(config); > > > } else if (!strcmp("ser", xopts)) { > > > + /* > > > + * This field indicates the Product Serial Number > > in > > > + * 8-bit ASCII, unused bytes should be NULL > > characters. > > > + * Ref: NVM Express Management Interface 1.0a. > > > + */ > > > > I have seen this before on ATA devices, > > if the vendor fills all bytes of PSN, > > there well be no unused bytes, > > so no null byte at the end, > > and you end up with an unterminated string. > > > > Can you please verify that this edge case is handled correctly? > > Thanks, > > Rod > > > > > memset(sc->ctrldata.sn, 0, sizeof(sc->ctrldata.sn > > )); > > > strncpy(sc->ctrldata.sn, config, > > > sizeof(sc->ctrldata.sn)); > > > > > > > strncpy will not NUL terminate when there's exactly sizeof(ctrldata.sn) > bytes in the 'config' string. Thus that case where all characters are > non-NUL is handled properly (the standard says the string need not be NUL > terminated). I get that, are we certain that all consumers of ctrldata.sn obey this, ie it is never attempted to print this string with a %s? > Keep in mind, though, that ATA is 100% irrelevant to NVMe, > since the NVMe standard specifies everything. I was using that as a case that has been seen where an assumption about there always being a null in the SN would be certain that strings are null terminated, not saying that ATA applied to NVMe. > > I've sent a followup to marcelo though about the 8-bit and NUL details, > however, since I have conflicting info about that. > > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 16 14:46: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 3B0D910698CE; Thu, 16 Aug 2018 14:46:50 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD7E785DA4; Thu, 16 Aug 2018 14:46:49 +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 BDDDB1AD2E; Thu, 16 Aug 2018 14:46:49 +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 w7GEknBR023959; Thu, 16 Aug 2018 14:46:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GEknrg023958; Thu, 16 Aug 2018 14:46:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808161446.w7GEknrg023958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 16 Aug 2018 14:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337907 - head/lib/libcasper/libcasper X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libcasper/libcasper X-SVN-Commit-Revision: 337907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 14:46:50 -0000 Author: trasz Date: Thu Aug 16 14:46:49 2018 New Revision: 337907 URL: https://svnweb.freebsd.org/changeset/base/337907 Log: Fix typo. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/lib/libcasper/libcasper/libcasper.3 Modified: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper.3 Thu Aug 16 13:42:08 2018 (r337906) +++ head/lib/libcasper/libcasper/libcasper.3 Thu Aug 16 14:46:49 2018 (r337907) @@ -262,7 +262,7 @@ functions always succeed. .Xr cap_dns 3 , .Xr cap_grp 3 , .Xr cap_pwd 3 , -.Xr cap_ranodm 3 , +.Xr cap_random 3 , .Xr cap_sysctl 3 , .Xr cap_syslog 3 , .Xr libcasper_service 3 , From owner-svn-src-all@freebsd.org Thu Aug 16 15:17: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 15562106A59E; Thu, 16 Aug 2018 15:17:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFE658707B; Thu, 16 Aug 2018 15:17:22 +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 9051E1B23F; Thu, 16 Aug 2018 15:17:22 +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 w7GFHMo1039887; Thu, 16 Aug 2018 15:17:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GFHMLZ039886; Thu, 16 Aug 2018 15:17:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808161517.w7GFHMLZ039886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Aug 2018 15:17:22 +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: r337908 - in stable: 10/release/tools 11/release/tools X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/tools 11/release/tools X-SVN-Commit-Revision: 337908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:17:23 -0000 Author: gjb Date: Thu Aug 16 15:17:22 2018 New Revision: 337908 URL: https://svnweb.freebsd.org/changeset/base/337908 Log: MFC r337717, r337718: r337717: Add lang/python2, lang/python3, and lang/python to GCE images to help avoid hard-coding 'python.' in several scripts in the client-side scripts. [1] r337718: Add a space between a variable and escaped new line. PR: 230248 [1] Sponsored by: The FreeBSD Foundation Modified: stable/10/release/tools/gce.conf Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/tools/gce.conf Directory Properties: stable/11/ (props changed) Modified: stable/10/release/tools/gce.conf ============================================================================== --- stable/10/release/tools/gce.conf Thu Aug 16 14:46:49 2018 (r337907) +++ stable/10/release/tools/gce.conf Thu Aug 16 15:17:22 2018 (r337908) @@ -5,10 +5,11 @@ # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ - google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine" + google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ + lang/python lang/python2 lang/python3" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="ntpd sshd growfs\ +export VM_RC_LIST="ntpd sshd growfs \ firstboot_pkgs firstboot_freebsd_update google_startup \ google_accounts_daemon google_clock_skew_daemon \ google_instance_setup google_network_daemon" From owner-svn-src-all@freebsd.org Thu Aug 16 15:17: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 6CEC3106A5A2; Thu, 16 Aug 2018 15:17:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 231368707C; Thu, 16 Aug 2018 15:17:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 044A31B240; Thu, 16 Aug 2018 15:17:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GFHMAf039893; Thu, 16 Aug 2018 15:17:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GFHMhv039892; Thu, 16 Aug 2018 15:17:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808161517.w7GFHMhv039892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Aug 2018 15:17:22 +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: r337908 - in stable: 10/release/tools 11/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/tools 11/release/tools X-SVN-Commit-Revision: 337908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:17:23 -0000 Author: gjb Date: Thu Aug 16 15:17:22 2018 New Revision: 337908 URL: https://svnweb.freebsd.org/changeset/base/337908 Log: MFC r337717, r337718: r337717: Add lang/python2, lang/python3, and lang/python to GCE images to help avoid hard-coding 'python.' in several scripts in the client-side scripts. [1] r337718: Add a space between a variable and escaped new line. PR: 230248 [1] Sponsored by: The FreeBSD Foundation Modified: stable/11/release/tools/gce.conf Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/release/tools/gce.conf Directory Properties: stable/10/ (props changed) Modified: stable/11/release/tools/gce.conf ============================================================================== --- stable/11/release/tools/gce.conf Thu Aug 16 14:46:49 2018 (r337907) +++ stable/11/release/tools/gce.conf Thu Aug 16 15:17:22 2018 (r337908) @@ -5,10 +5,11 @@ # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ - google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine" + google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ + lang/python lang/python2 lang/python3" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="ntpd sshd growfs\ +export VM_RC_LIST="ntpd sshd growfs \ firstboot_pkgs firstboot_freebsd_update google_startup \ google_accounts_daemon google_clock_skew_daemon \ google_instance_setup google_network_daemon" From owner-svn-src-all@freebsd.org Thu Aug 16 15:27: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 DD37B106AAD0; Thu, 16 Aug 2018 15:27:19 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9034388192; Thu, 16 Aug 2018 15:27:19 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7155F1B3FE; Thu, 16 Aug 2018 15:27:19 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GFRJJt045681; Thu, 16 Aug 2018 15:27:19 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GFRJSw045680; Thu, 16 Aug 2018 15:27:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201808161527.w7GFRJSw045680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 16 Aug 2018 15:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337909 - stable/11/sys/dev/sbni X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/sbni X-SVN-Commit-Revision: 337909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:27:20 -0000 Author: brooks Date: Thu Aug 16 15:27:19 2018 New Revision: 337909 URL: https://svnweb.freebsd.org/changeset/base/337909 Log: MFC r337727: Copy out from kernel to data, not the other way around. Sponsored by: DARPA, AFRL Modified: stable/11/sys/dev/sbni/if_sbni.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sbni/if_sbni.c ============================================================================== --- stable/11/sys/dev/sbni/if_sbni.c Thu Aug 16 15:17:22 2018 (r337908) +++ stable/11/sys/dev/sbni/if_sbni.c Thu Aug 16 15:27:19 2018 (r337909) @@ -1153,7 +1153,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t SBNI_LOCK(sc); bcopy(&sc->in_stats, in_stats, sizeof(struct sbni_in_stats)); SBNI_UNLOCK(sc); - error = copyout(ifr_data_get_ptr(ifr), in_stats, + error = copyout(in_stats, ifr_data_get_ptr(ifr), sizeof(struct sbni_in_stats)); free(in_stats, M_DEVBUF); break; From owner-svn-src-all@freebsd.org Thu Aug 16 15:30: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 29D0A106ABE0; Thu, 16 Aug 2018 15:30:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (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 8AE4488359; Thu, 16 Aug 2018 15:30:10 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-x229.google.com with SMTP id v9-v6so3995031ljk.4; Thu, 16 Aug 2018 08:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OBx9N67KF0+jbr5b2KoSmmOgbWXSNGoGUSIAsmxuomM=; b=eqYk4peadb33H66r8XzmzNYEe6Uv7Nrxi6A+46aTo/T9mDhWNjKC5AGfILlI0bHjd4 p0fpEWWfCZtGWbfnCbjElQBNy41VVzRdlCJwpMfeHs3S1GqhXEbcWxRdDdSrTlfUBNJC AtNKc+LxyivR8461PcKd5IybPFCjWCbPD0hsG7ze7ntZTpHYGK3ErhFxxkAmJvlw5YWP T2NiDXKGerG8rFdcknJ9Q81C1i455Kyf4WBxXbFO4IbaRYh4scPWt20vwARDfPdBU6Hw A8bA864vtw9OJFyIuEksx17FBbzTG+bp98WsAVg6uVBhHdNE6lFbG43mJgNXHe5lzuCk UzzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OBx9N67KF0+jbr5b2KoSmmOgbWXSNGoGUSIAsmxuomM=; b=RN1iUJwqNeIoLb5YkSvgbvVIIiozAJTDmbMbV6HVS93057I39FJ2FpqpoJbSEwVLa0 nFRsbzEJjg20SNAkUeHCenW4oG6FJ1dxMjw+4C8hM5WOs8D4/UvbAW8xA+nuyYaXNBWu hV1uETHruCafvq09n1bjqzay7UIFRjei12P4N19gQ6HSJn8hq53Ezqml84raVL5JUpye EA+t94MFHhvegaFeBG26iGPSu/rWqT7YWpXOREarjK6ge5CG49sgDJN+rRQ5OqUno/F3 VrnR2/55Yf43fbbR7NirnS8KsjxDLPfC6STidFDgHGk6uj5rGlVSzQ4q0jYBmt6Rdhc7 RHzg== X-Gm-Message-State: AOUpUlHUYomr0ggAlrUOgMbjWTcluxL7XiZx919aXhx9fC01ppYjR7RG IpfgC5jAVTtiMkPA8qVGWUJY1X5wlHnaPY86anOG/o+P X-Google-Smtp-Source: AA+uWPxQx8XsLh3pe2zKdJt/qEq54gWQqpUeZupJfne7JeD4gAdoG4WblImW2oCg++3ch0XLMHOcqo6Abz1XnkGoFsg= X-Received: by 2002:a2e:7815:: with SMTP id t21-v6mr5465430ljc.61.1534433408460; Thu, 16 Aug 2018 08:30:08 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 2002:ab3:7851:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 08:30:07 -0700 (PDT) In-Reply-To: <201808071447.w77Eld3I069906@repo.freebsd.org> References: <201808071447.w77Eld3I069906@repo.freebsd.org> From: Alan Somers Date: Thu, 16 Aug 2018 09:30:07 -0600 X-Google-Sender-Auth: cndtvQ-oBZuJrH3NG4JLkbHB6FI Message-ID: Subject: Re: svn commit: r337419 - head/usr.bin/sed To: "Pedro F. Giffuni" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:30:11 -0000 On Tue, Aug 7, 2018 at 8:47 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Aug 7 14:47:39 2018 > New Revision: 337419 > URL: https://svnweb.freebsd.org/changeset/base/337419 > > Log: > sed(1): partial fix for the case of the regex delimited with '['. > > We don't generally support the weird case of regular expresions delimited > by an opening square bracket ('[') but POSIX says that inside > bracket expressions, escaping is not possible and both '[' and '\' > represent themselves. > > PR: 230198 (exp-run) > Obtained from: OpenBSD > > Modified: > head/usr.bin/sed/compile.c > > Modified: head/usr.bin/sed/compile.c > ============================================================ > ================== > --- head/usr.bin/sed/compile.c Tue Aug 7 14:39:00 2018 (r337418) > +++ head/usr.bin/sed/compile.c Tue Aug 7 14:47:39 2018 (r337419) > @@ -393,11 +393,11 @@ compile_delimited(char *p, char *d, int is_tr) > if ((d = compile_ccl(&p, d)) == NULL) > errx(1, "%lu: %s: unbalanced brackets > ([])", linenum, fname); > continue; > + } else if (*p == '\\' && p[1] == c) { > + p++; > } else if (*p == '\\' && p[1] == '[') { > *d++ = *p++; > - } else if (*p == '\\' && p[1] == c) > - p++; > - else if (*p == '\\' && p[1] == 'n') { > + } else if (*p == '\\' && p[1] == 'n') { > *d++ = '\n'; > p += 2; > continue; > > This change seems to have caused a regression in multi_test.sh. https://ci.freebsd.org/job/FreeBSD-head-amd64-test/8630/testReport/usr.bin.sed/multi_test/main/ From owner-svn-src-all@freebsd.org Thu Aug 16 15:32: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 6F41A106AE10; Thu, 16 Aug 2018 15:32:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24F7688613; Thu, 16 Aug 2018 15:32:18 +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 0792E1B588; Thu, 16 Aug 2018 15:32:18 +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 w7GFWHv9050456; Thu, 16 Aug 2018 15:32:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GFWHiO050455; Thu, 16 Aug 2018 15:32:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808161532.w7GFWHiO050455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Aug 2018 15:32:17 +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: r337910 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 337910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:32:18 -0000 Author: gjb Date: Thu Aug 16 15:32:17 2018 New Revision: 337910 URL: https://svnweb.freebsd.org/changeset/base/337910 Log: Document SA-18:09 through SA-18:11. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Thu Aug 16 15:27:19 2018 (r337909) +++ stable/11/release/doc/share/xml/security.xml Thu Aug 16 15:32:17 2018 (r337910) @@ -25,6 +25,30 @@ Resource exhaustion in TCP reassembly + + + FreeBSD-SA-18:09.l1tf + 14 August 2018 + L1 Terminal Fault (L1TF) Kernel Information + Disclosure + + + + FreeBSD-SA-18:10.ip + 14 August 2018 + Resource exhaustion in IP fragment + reassembly + + + + FreeBSD-SA-18:11.hostapd + 14 August 2018 + Unauthenticated EAPOL-Key Decryption + Vulnerability + From owner-svn-src-all@freebsd.org Thu Aug 16 15:32: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 1EFE8106AE0B; Thu, 16 Aug 2018 15:32:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C907688611; Thu, 16 Aug 2018 15:32:17 +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 AA53D1B586; Thu, 16 Aug 2018 15:32:17 +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 w7GFWHaY050450; Thu, 16 Aug 2018 15:32:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GFWHYl050449; Thu, 16 Aug 2018 15:32:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808161532.w7GFWHYl050449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Aug 2018 15:32:17 +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: r337910 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 337910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:32:18 -0000 Author: gjb Date: Thu Aug 16 15:32:17 2018 New Revision: 337910 URL: https://svnweb.freebsd.org/changeset/base/337910 Log: Document SA-18:09 through SA-18:11. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/11/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/security.xml ============================================================================== --- stable/10/release/doc/share/xml/security.xml Thu Aug 16 15:27:19 2018 (r337909) +++ stable/10/release/doc/share/xml/security.xml Thu Aug 16 15:32:17 2018 (r337910) @@ -114,6 +114,30 @@ Resource exhaustion in TCP reassembly + + + FreeBSD-SA-18:09.l1tf + 14 August 2018 + L1 Terminal Fault (L1TF) Kernel Information + Disclosure + + + + FreeBSD-SA-18:10.ip + 14 August 2018 + Resource exhaustion in IP fragment + reassembly + + + + FreeBSD-SA-18:11.hostapd + 14 August 2018 + Unauthenticated EAPOL-Key Decryption + Vulnerability + From owner-svn-src-all@freebsd.org Thu Aug 16 15:33:41 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 342D1106AF2B for ; Thu, 16 Aug 2018 15:33:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (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 B6DB188A4D for ; Thu, 16 Aug 2018 15:33:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x232.google.com with SMTP id x5-v6so4179570iop.13 for ; Thu, 16 Aug 2018 08:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=iVr2OGrth5sR5hukVWWhoW0Mm2+HpATtcsQ3lkMiOxo=; b=UR2aoQGUBDlb0mbgbU/zXg9pBgOejW4iAMUq1+6NLTj2ea2WswSrvdv4MpXax165/9 sOhFyUIqAYdEzTJot7ohBlAqMFY5j9NO+jQbuhZ8CkeqAeJqYnAjimZ0+bIByacQ+fY9 1Tr8WvI7pt2I2FcemiUwoz/QbfkW0UnBBLL+ItUDF/EVLE+Feu8cPPqdGxJrY6OrnVIx ZnzWRB4RbfBNHfGVhhYY0OxzeLTqKztrw31biHwwHMzDk0sCSxwDgxy6ClRoiLBAeP+W Qcd39M+Ld1+n9zXD8L1FfcjFtjmIOV0J97tmwHFDMSKwyvo4z20XvwyNJz0gpDDDt+v7 jN1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=iVr2OGrth5sR5hukVWWhoW0Mm2+HpATtcsQ3lkMiOxo=; b=WxaK/ZOcBRAC+BdziaTZcivgXSc7An/+OX8V3IslGUIU87LPsUUdBsZGPgdMPI5a0R kZPTo4KwKLu1fL3ocD/QrXqnT3ebRMbPtW/IEdM29vdHsfyPevqx5zKR61aZIWYbyicy SkwWIDPeN5q99cYODc51Pxwz108Obvjhi1NYXIINVLxtrj+w1IZ+ljFD7YuGBY4uiKCp eH6O2/xNspbTlREe4IYz04S1iD0hYiq25OxZYwtYvVKK6cY2wlbdC6WsTRhvWauf6fkn CRAEZwi8yqlARhsbE7GYfXxchEaYn83pQmk/TThIgfnKuXgj7SlL7HN7Rla+IlM7hPpH iakw== X-Gm-Message-State: AOUpUlH/Kd4xINWBTk/Z+e1MbjwkpNIY6Iq5eYQrEcqEtBYaTPrUENhf eQVcR+LZG0wbCDGAdnjSc3mfCtiOivTlOsKzRKTcOA== X-Google-Smtp-Source: AA+uWPzIsMH4TOPgnZUMyGFTda3GBI+/Koj7U9GQ9HvT2NXm+5sXAolOM93+ApIlQU7VVIB0gVVwIi6Mtn1vsa6agYI= X-Received: by 2002:a6b:7117:: with SMTP id q23-v6mr10100656iog.37.1534433619827; Thu, 16 Aug 2018 08:33:39 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 08:33:39 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201808161434.w7GEYEsm053813@pdx.rh.CN85.dnsmgr.net> References: <201808161434.w7GEYEsm053813@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Thu, 16 Aug 2018 09:33:39 -0600 X-Google-Sender-Auth: _Mtyhda_J0A-mMn511C6ts7li64 Message-ID: Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve To: "Rodney W. Grimes" Cc: Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:33:41 -0000 On Thu, Aug 16, 2018 at 8:34 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Thu, Aug 16, 2018 at 8:03 AM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > Author: araujo > > > > Date: Thu Aug 16 06:31:54 2018 > > > > New Revision: 337887 > > > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > > > > > Log: > > > > Add a comment explaining how the PSN works and why there is no > need for > > > > a null terminator. Also mark CID 1394825 as intentional. > > > > > > > > Reported by: Coverity > > > > CID: 1394825 > > > > MFC after: 1 week > > > > Sponsored by: iXsystems Inc. > > > > > > > > Modified: > > > > head/usr.sbin/bhyve/pci_nvme.c > > > > > > > > Modified: head/usr.sbin/bhyve/pci_nvme.c > > > > ============================================================ > > > ================== > > > > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > > > (r337886) > > > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > > > (r337887) > > > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, > > > char *o > > > > } else if (!strcmp("sectsz", xopts)) { > > > > sectsz = atoi(config); > > > > } else if (!strcmp("ser", xopts)) { > > > > + /* > > > > + * This field indicates the Product Serial > Number > > > in > > > > + * 8-bit ASCII, unused bytes should be NULL > > > characters. > > > > + * Ref: NVM Express Management Interface 1.0a. > > > > + */ > > > > > > I have seen this before on ATA devices, > > > if the vendor fills all bytes of PSN, > > > there well be no unused bytes, > > > so no null byte at the end, > > > and you end up with an unterminated string. > > > > > > Can you please verify that this edge case is handled correctly? > > > Thanks, > > > Rod > > > > > > > memset(sc->ctrldata.sn, 0, sizeof(sc-> > ctrldata.sn > > > )); > > > > strncpy(sc->ctrldata.sn, config, > > > > sizeof(sc->ctrldata.sn)); > > > > > > > > > > > strncpy will not NUL terminate when there's exactly sizeof(ctrldata.sn) > > bytes in the 'config' string. Thus that case where all characters are > > non-NUL is handled properly (the standard says the string need not be NUL > > terminated). > > I get that, are we certain that all consumers of ctrldata.sn > obey this, ie it is never attempted to print this string > with a %s? Grep says "Yes." Warner From owner-svn-src-all@freebsd.org Thu Aug 16 15:44: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 A4643106B3A2; Thu, 16 Aug 2018 15:44:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52855891AB; Thu, 16 Aug 2018 15:44:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3486E1B749; Thu, 16 Aug 2018 15:44:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GFinvp055767; Thu, 16 Aug 2018 15:44:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GFinK3055766; Thu, 16 Aug 2018 15:44:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808161544.w7GFinK3055766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 16 Aug 2018 15:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337911 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 337911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:44:49 -0000 Author: asomers Date: Thu Aug 16 15:44:48 2018 New Revision: 337911 URL: https://svnweb.freebsd.org/changeset/base/337911 Log: Fix the sys/opencrypto/runtests test when aesni(4) is already loaded Apparently kldstat requires the full module name, including busname Reported by: Jenkins MFC after: 2 weeks Modified: head/tests/sys/opencrypto/runtests.sh Modified: head/tests/sys/opencrypto/runtests.sh ============================================================================== --- head/tests/sys/opencrypto/runtests.sh Thu Aug 16 15:32:17 2018 (r337910) +++ head/tests/sys/opencrypto/runtests.sh Thu Aug 16 15:44:48 2018 (r337911) @@ -50,9 +50,9 @@ cleanup_tests() } trap cleanup_tests EXIT INT TERM -for required_module in aesni cryptodev; do +for required_module in nexus/aesni cryptodev; do if ! kldstat -q -m $required_module; then - kldload $required_module + kldload ${required_module#nexus/} loaded_modules="$loaded_modules $required_module" fi done From owner-svn-src-all@freebsd.org Thu Aug 16 15:54: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 3F16C106BAD0; Thu, 16 Aug 2018 15:54:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E84AF899F5; Thu, 16 Aug 2018 15:54:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C95EB1B8DE; Thu, 16 Aug 2018 15:54:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GFsC8A061174; Thu, 16 Aug 2018 15:54:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GFsCGq061173; Thu, 16 Aug 2018 15:54:12 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201808161554.w7GFsCGq061173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 16 Aug 2018 15:54:12 +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: r337912 - stable/10/sys/dev/sbni X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/dev/sbni X-SVN-Commit-Revision: 337912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:54:13 -0000 Author: brooks Date: Thu Aug 16 15:54:12 2018 New Revision: 337912 URL: https://svnweb.freebsd.org/changeset/base/337912 Log: MFC r337727 (rewritten due to unmerged API change in 11+): Copy out from kernel to data, not the other way around. Sponsored by: DARPA, AFRL Modified: stable/10/sys/dev/sbni/if_sbni.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sbni/if_sbni.c ============================================================================== --- stable/10/sys/dev/sbni/if_sbni.c Thu Aug 16 15:44:48 2018 (r337911) +++ stable/10/sys/dev/sbni/if_sbni.c Thu Aug 16 15:54:12 2018 (r337912) @@ -1153,7 +1153,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t SBNI_LOCK(sc); bcopy(&sc->in_stats, in_stats, sizeof(struct sbni_in_stats)); SBNI_UNLOCK(sc); - error = copyout(ifr->ifr_data, in_stats, + error = copyout(in_stats, ifr->ifr_data, sizeof(struct sbni_in_stats)); free(in_stats, M_DEVBUF); break; From owner-svn-src-all@freebsd.org Thu Aug 16 15:59: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 D2C97106BD5E; Thu, 16 Aug 2018 15:59:03 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8765D89CF4; Thu, 16 Aug 2018 15:59:03 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 687131B8E5; Thu, 16 Aug 2018 15:59:03 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GFx3Oa061597; Thu, 16 Aug 2018 15:59:03 GMT (envelope-from ambrisko@FreeBSD.org) Received: (from ambrisko@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GFx3pg061595; Thu, 16 Aug 2018 15:59:03 GMT (envelope-from ambrisko@FreeBSD.org) Message-Id: <201808161559.w7GFx3pg061595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ambrisko set sender to ambrisko@FreeBSD.org using -f From: Doug Ambrisko Date: Thu, 16 Aug 2018 15:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337913 - in head/sys: dev/ipmi modules/ipmi X-SVN-Group: head X-SVN-Commit-Author: ambrisko X-SVN-Commit-Paths: in head/sys: dev/ipmi modules/ipmi X-SVN-Commit-Revision: 337913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 15:59:04 -0000 Author: ambrisko Date: Thu Aug 16 15:59:02 2018 New Revision: 337913 URL: https://svnweb.freebsd.org/changeset/base/337913 Log: Fix a module Makefile error on amd64 so the IPMI HW interfaces are built. When the module is being unloaded and no HW interfaces were created don't clean up. This was exposed by the amd64 module build issue. Modified: head/sys/dev/ipmi/ipmi.c head/sys/modules/ipmi/Makefile Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Thu Aug 16 15:54:12 2018 (r337912) +++ head/sys/dev/ipmi/ipmi.c Thu Aug 16 15:59:02 2018 (r337913) @@ -1053,6 +1053,8 @@ ipmi_unload(void *arg) int count; int i; + if (ipmi_devclass == NULL) + return; if (devclass_get_devices(ipmi_devclass, &devs, &count) != 0) return; for (i = 0; i < count; i++) Modified: head/sys/modules/ipmi/Makefile ============================================================================== --- head/sys/modules/ipmi/Makefile Thu Aug 16 15:54:12 2018 (r337912) +++ head/sys/modules/ipmi/Makefile Thu Aug 16 15:59:02 2018 (r337913) @@ -7,7 +7,7 @@ KMOD= ipmi SRCS= ipmi.c SRCS+= bus_if.h device_if.h -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= ipmi_kcs.c ipmi_smic.c ipmi_smbios.c ipmi_ssif.c SRCS+= ipmi_acpi.c ipmi_isa.c ipmi_pci.c ipmi_smbus.c SRCS+= opt_acpi.h From owner-svn-src-all@freebsd.org Thu Aug 16 16: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 A23B8106C4D4; Thu, 16 Aug 2018 16:11:05 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 591238A8E1; Thu, 16 Aug 2018 16:11:05 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.5] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id A72D91EB3E; Thu, 16 Aug 2018 16:11:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.10.0.180812 Date: Thu, 16 Aug 2018 09:11:01 -0700 Subject: Re: svn commit: r337913 - in head/sys: dev/ipmi modules/ipmi From: Ravi Pokala To: Doug Ambrisko , , , Message-ID: Thread-Topic: svn commit: r337913 - in head/sys: dev/ipmi modules/ipmi References: <201808161559.w7GFx3pg061595@repo.freebsd.org> In-Reply-To: <201808161559.w7GFx3pg061595@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 16:11:05 -0000 The confluence of these two issues is that on amd64 ipmi.ko loads, but does= n't attach to the BMC or create /dev/ipmi, and that the kernel panics when t= rying to unload. Right? If so, that's exactly the issue I hit on Monday, but didn't get a chance to= triage. Thanks! -Ravi =EF=BB=BF-----Original Message----- From: on behalf of Doug Ambrisko Date: 2018-08-16, Thursday at 08:59 To: , , Subject: svn commit: r337913 - in head/sys: dev/ipmi modules/ipmi Author: ambrisko Date: Thu Aug 16 15:59:02 2018 New Revision: 337913 URL: https://svnweb.freebsd.org/changeset/base/337913 Log: Fix a module Makefile error on amd64 so the IPMI HW interfaces are built. When the module is being unloaded and no HW interfaces were created don't clean up. This was exposed by the amd64 module build issue. Modified: head/sys/dev/ipmi/ipmi.c head/sys/modules/ipmi/Makefile Modified: head/sys/dev/ipmi/ipmi.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/dev/ipmi/ipmi.c Thu Aug 16 15:54:12 2018 (r337912) +++ head/sys/dev/ipmi/ipmi.c Thu Aug 16 15:59:02 2018 (r337913) @@ -1053,6 +1053,8 @@ ipmi_unload(void *arg) int count; int i; =20 + if (ipmi_devclass =3D=3D NULL) + return; if (devclass_get_devices(ipmi_devclass, &devs, &count) !=3D 0) return; for (i =3D 0; i < count; i++) Modified: head/sys/modules/ipmi/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/sys/modules/ipmi/Makefile Thu Aug 16 15:54:12 2018 (r337912) +++ head/sys/modules/ipmi/Makefile Thu Aug 16 15:59:02 2018 (r337913) @@ -7,7 +7,7 @@ KMOD=3D ipmi SRCS=3D ipmi.c SRCS+=3D bus_if.h device_if.h -.if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D "i386" +.if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D "amd64" SRCS+=3D ipmi_kcs.c ipmi_smic.c ipmi_smbios.c ipmi_ssif.c SRCS+=3D ipmi_acpi.c ipmi_isa.c ipmi_pci.c ipmi_smbus.c SRCS+=3D opt_acpi.h From owner-svn-src-all@freebsd.org Thu Aug 16 16:18: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 A8015106C9C6; Thu, 16 Aug 2018 16:18:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B1498AF38; Thu, 16 Aug 2018 16:18:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id ED2CB1EC3D; Thu, 16 Aug 2018 16:18:38 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f178.google.com with SMTP id j19-v6so4130370ljc.7; Thu, 16 Aug 2018 09:18:38 -0700 (PDT) X-Gm-Message-State: AOUpUlHft9YcBIbly9LJBEAK5giYmPJtncW4qSZ6kY8uy5+HxUEsFaqK 4+rOR/noqNtS3K2ip2dWVM62svr1s31gfwpmeV4= X-Google-Smtp-Source: AA+uWPz+wKz7DzDgkrZIMWQDhKBHxYiOX7ENVhC1ErPklZxJCS9fjn+1hoW9RPLPS2I0ieBZJZg5yP/NIsSk1PEcU+A= X-Received: by 2002:a2e:2b0e:: with SMTP id q14-v6mr21006787lje.147.1534436317603; Thu, 16 Aug 2018 09:18:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 09:18:17 -0700 (PDT) In-Reply-To: <201808160124.w7G1O1mb051118@pdx.rh.CN85.dnsmgr.net> References: <201808160118.w7G1IL90006511@repo.freebsd.org> <201808160124.w7G1O1mb051118@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Thu, 16 Aug 2018 11:18:17 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337884 - stable/11/bin/ls To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, Warner Losh Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 16:18:39 -0000 On Wed, Aug 15, 2018 at 8:24 PM, Rodney W. Grimes wrote: >> Author: kevans >> Date: Thu Aug 16 01:18:20 2018 >> New Revision: 337884 >> URL: https://svnweb.freebsd.org/changeset/base/337884 >> >> Log: >> Revert r337826: MFC of ls(1) COLORTERM honoring >> >> It was not ready, and was much-objected-to. > > Thanks, just objected to, not much. > I think once the --color=foo and the NULL COLORTERM > fix goes in this should work as expected and not > cause the issue seen by the user, or if it does > I can tell them how to get color VIM, but not > color ls without too much magic. > I've opened a review for my --color=foo implementation here: https://reviews.freebsd.org/D16741 Please take a look when you have time. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu Aug 16 16:23: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 5AAD5106CCB6; Thu, 16 Aug 2018 16:23:38 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (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 CBB718B41E; Thu, 16 Aug 2018 16:23:37 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io0-x241.google.com with SMTP id x5-v6so4320217iop.13; Thu, 16 Aug 2018 09:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hVlcRa1G89rT1+bszv1W6xDF/xmZ+u4rytJQFdapYoE=; b=nfS/EIVqv6Wxm8w58Amyy4PrOvD5DZmzag+yDt0k5t1JviSAEPRrbmTIs6pFPQDSrm GShstzj5eyvuiio0I+NACkShB4Y8srHZ87beD8O1R91sIMB+PpjGaHhr1O30XL2Twr0f JVuhq71S6T2cbVI45h0uAZvYIAJ1jPqNQg0+N+OfrGNgjLy/0yTCqvTWqto3GW9nYqk0 SkPQlc2JxGjG5FCt4q0fWtLhzgmmTbkNxtVt7RHJFp1eSVvcQi8d4/c2zcAh/VZFrhdS t7/RZTqcuw6BDVEoxYaHdVQc9zmYCychBGPcfEoUE4V0t+JFIsMdwMMudsVdvJTTmFX+ DEJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hVlcRa1G89rT1+bszv1W6xDF/xmZ+u4rytJQFdapYoE=; b=HwLKOanIhixvgtZPPbBLgm4Q+0ilPbTT7+pvDOZ0xK2EH7c9XCCYUQPvEjaFbs2RQG jfxV/ZfyDChBfcDridTvjwRZdAUMILjheO46TcH5Nxqh4jg5kCLpS81aSS6VP0QmEMIS grmyyRIpWoYZlpneFrhhfz5bElaYkJHDCTbfZnFDhEt8IoFz90xFt6ImE/rPvA2MKCx1 TLgrI3oxr8M+M5eYOabFuRMG+mAdI1mtJ/l47Kiis075+LP2mqv6rvbuOcMxqvQcfzBY IdCWmHSqYoIpEDqLgPZvUJ8yhd9JASGZq1HxSoOsrvooPNW3KgZxO3JwnhoPsMekCFzu 32jQ== X-Gm-Message-State: AOUpUlGcJt7Vra7NKYHOtItK8wWiaoqdvmuxBeDY7HeRXiDo1YcqqvUg Dps8ttAeUfgQWncVMbXNUw1GMPPbSezBzA== X-Google-Smtp-Source: AA+uWPwDiRc3i+ryylBzYleIr41zzqZLRthf/Zvvm/dGpXNsk4v68/EkgxLxWROdox2v+16twxNt9Q== X-Received: by 2002:a6b:f305:: with SMTP id m5-v6mr26179632ioh.253.1534436616774; Thu, 16 Aug 2018 09:23:36 -0700 (PDT) Received: from ralga.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id c3-v6sm660208itd.8.2018.08.16.09.23.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Aug 2018 09:23:36 -0700 (PDT) Date: Thu, 16 Aug 2018 11:23:31 -0500 From: Justin Hibbits To: Ravi Pokala Cc: Doug Ambrisko , , , Subject: Re: svn commit: r337913 - in head/sys: dev/ipmi modules/ipmi Message-ID: <20180816112331.2d6d638f@ralga.knownspace> In-Reply-To: References: <201808161559.w7GFx3pg061595@repo.freebsd.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; powerpc64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 16:23:38 -0000 Woops, my fault way back when I made powerpc64's IPMI OPAL buildable as a module. Can't believe I had i386 twice in there. - Justin On Thu, 16 Aug 2018 09:11:01 -0700 Ravi Pokala wrote: > The confluence of these two issues is that on amd64 ipmi.ko loads, > but doesn't attach to the BMC or create /dev/ipmi, and that the > kernel panics when trying to unload. Right? >=20 > If so, that's exactly the issue I hit on Monday, but didn't get a > chance to triage. Thanks! >=20 > -Ravi >=20 > =EF=BB=BF-----Original Message----- > From: on behalf of Doug Ambrisko > Date: 2018-08-16, Thursday at 08:59 > To: , , > Subject: svn commit: r337913 - in > head/sys: dev/ipmi modules/ipmi >=20 > Author: ambrisko > Date: Thu Aug 16 15:59:02 2018 > New Revision: 337913 > URL: https://svnweb.freebsd.org/changeset/base/337913 >=20 > Log: > Fix a module Makefile error on amd64 so the IPMI HW interfaces are > built. When the module is being unloaded and no HW interfaces were > created don't clean up. This was exposed by the amd64 module build > issue. >=20 > Modified: > head/sys/dev/ipmi/ipmi.c > head/sys/modules/ipmi/Makefile >=20 > Modified: head/sys/dev/ipmi/ipmi.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/dev/ipmi/ipmi.c Thu Aug 16 15:54:12 2018 > (r337912) +++ head/sys/dev/ipmi/ipmi.c Thu Aug 16 15:59:02 > 2018 (r337913) @@ -1053,6 +1053,8 @@ ipmi_unload(void *arg) > int count; > int i; > =20 > + if (ipmi_devclass =3D=3D NULL) > + return; > if (devclass_get_devices(ipmi_devclass, &devs, &count) !=3D 0) > return; > for (i =3D 0; i < count; i++) >=20 > Modified: head/sys/modules/ipmi/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/modules/ipmi/Makefile Thu Aug 16 15:54:12 > 2018 (r337912) +++ head/sys/modules/ipmi/Makefile Thu > Aug 16 15:59:02 2018 (r337913) @@ -7,7 +7,7 @@ > KMOD=3D ipmi > SRCS=3D ipmi.c > SRCS+=3D bus_if.h device_if.h > -.if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D "i386" > +.if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D "amd64" > SRCS+=3D ipmi_kcs.c ipmi_smic.c ipmi_smbios.c ipmi_ssif.c > SRCS+=3D ipmi_acpi.c ipmi_isa.c ipmi_pci.c ipmi_smbus.c > SRCS+=3D opt_acpi.h >=20 >=20 >=20 >=20 From owner-svn-src-all@freebsd.org Thu Aug 16 16:30: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 84DF1106D12B; Thu, 16 Aug 2018 16:30:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB9E8B9C3; Thu, 16 Aug 2018 16:30:24 +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 1CB291BDDC; Thu, 16 Aug 2018 16:30:24 +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 w7GGUNsH077723; Thu, 16 Aug 2018 16:30:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GGUNKo077722; Thu, 16 Aug 2018 16:30:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808161630.w7GGUNKo077722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Aug 2018 16:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337914 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 337914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 16:30:24 -0000 Author: imp Date: Thu Aug 16 16:30:23 2018 New Revision: 337914 URL: https://svnweb.freebsd.org/changeset/base/337914 Log: Install links for loader.efi. Submitted by: ben wilber Modified: head/stand/efi/loader/Makefile Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Thu Aug 16 15:59:02 2018 (r337913) +++ head/stand/efi/loader/Makefile Thu Aug 16 16:30:23 2018 (r337914) @@ -90,6 +90,10 @@ VERSION_FILE= ${.CURDIR}/../loader/version FILES+= ${LOADER}.efi FILESMODE_${LOADER}.efi= ${BINMODE} +.if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +LINKS+= ${BINDIR}/${LOADER}.efi ${BINDIR}/loader.efi +.endif + LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared From owner-svn-src-all@freebsd.org Thu Aug 16 16:48: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 EB961106DF1D; Thu, 16 Aug 2018 16:48:10 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id 25F398CBF3; Thu, 16 Aug 2018 16:48:10 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 16 Aug 2018 09:56:35 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.14.7/8.15.2) with ESMTP id w7GGm9H4054879 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Aug 2018 09:48:09 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.7/8.15.2/Submit) id w7GGm9IH054878; Thu, 16 Aug 2018 09:48:09 -0700 (PDT) (envelope-from ambrisko) Date: Thu, 16 Aug 2018 09:48:09 -0700 From: Doug Ambrisko To: Justin Hibbits Cc: Ravi Pokala , Doug Ambrisko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337913 - in head/sys: dev/ipmi modules/ipmi Message-ID: <20180816164809.GA54556@ambrisko.com> References: <201808161559.w7GFx3pg061595@repo.freebsd.org> <20180816112331.2d6d638f@ralga.knownspace> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180816112331.2d6d638f@ralga.knownspace> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 16:48:11 -0000 On Thu, Aug 16, 2018 at 11:23:31AM -0500, Justin Hibbits wrote: | Woops, my fault way back when I made powerpc64's IPMI OPAL buildable as | a module. Can't believe I had i386 twice in there. I was glad it was a simple fix ... the panic issue I'm not so happy about since I can't fix it on a live machine with a klunload/kldload :-( it was good to expose the panic bug to get that fixed for next time! Thanks, Doug A. | On Thu, 16 Aug 2018 09:11:01 -0700 | Ravi Pokala wrote: | | > The confluence of these two issues is that on amd64 ipmi.ko loads, | > but doesn't attach to the BMC or create /dev/ipmi, and that the | > kernel panics when trying to unload. Right? | > | > If so, that's exactly the issue I hit on Monday, but didn't get a | > chance to triage. Thanks! | > | > -Ravi | > | > -----Original Message----- | > From: on behalf of Doug Ambrisko | > Date: 2018-08-16, Thursday at 08:59 | > To: , , | > Subject: svn commit: r337913 - in | > head/sys: dev/ipmi modules/ipmi | > | > Author: ambrisko | > Date: Thu Aug 16 15:59:02 2018 | > New Revision: 337913 | > URL: https://svnweb.freebsd.org/changeset/base/337913 | > | > Log: | > Fix a module Makefile error on amd64 so the IPMI HW interfaces are | > built. When the module is being unloaded and no HW interfaces were | > created don't clean up. This was exposed by the amd64 module build | > issue. | > | > Modified: | > head/sys/dev/ipmi/ipmi.c | > head/sys/modules/ipmi/Makefile | > | > Modified: head/sys/dev/ipmi/ipmi.c | > ============================================================================== | > --- head/sys/dev/ipmi/ipmi.c Thu Aug 16 15:54:12 2018 | > (r337912) +++ head/sys/dev/ipmi/ipmi.c Thu Aug 16 15:59:02 | > 2018 (r337913) @@ -1053,6 +1053,8 @@ ipmi_unload(void *arg) | > int count; | > int i; | > | > + if (ipmi_devclass == NULL) | > + return; | > if (devclass_get_devices(ipmi_devclass, &devs, &count) != 0) | > return; | > for (i = 0; i < count; i++) | > | > Modified: head/sys/modules/ipmi/Makefile | > ============================================================================== | > --- head/sys/modules/ipmi/Makefile Thu Aug 16 15:54:12 | > 2018 (r337912) +++ head/sys/modules/ipmi/Makefile Thu | > Aug 16 15:59:02 2018 (r337913) @@ -7,7 +7,7 @@ | > KMOD= ipmi | > SRCS= ipmi.c | > SRCS+= bus_if.h device_if.h | > -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "i386" | > +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" | > SRCS+= ipmi_kcs.c ipmi_smic.c ipmi_smbios.c ipmi_ssif.c | > SRCS+= ipmi_acpi.c ipmi_isa.c ipmi_pci.c ipmi_smbus.c | > SRCS+= opt_acpi.h | > | > | > | > | From owner-svn-src-all@freebsd.org Thu Aug 16 17:05:25 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 DCFE6106F0A2 for ; Thu, 16 Aug 2018 17:05:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic317-20.consmr.mail.gq1.yahoo.com (sonic317-20.consmr.mail.gq1.yahoo.com [98.137.66.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66DBF8DF24 for ; Thu, 16 Aug 2018 17:05:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1534439123; bh=9PC7/AqnKU/3LxZKfw+gTwU6cEVBCDNtM/s1SnHlxYY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=alETOeQZH8uFx/fvKygzQgjCGREjPa7SixWoxArQGq2ki+04yj4Nrlm52xJMIKKjuPrQobXXGhcQMinmpFpbeGac2fb27f8AFwLD1/9NOIVvQ5awAeuCAbngwrAFxdfHA5WOB5pgguiUTeqXH8ZYgRtoZEKq2VOua2ZIg9vAvUQsUvC0m14vos8FsUVUNrqdn5Wsz8ceEcBZU+ukGApJM9/8dGk8GCrjj0fh74ZAhIMrQBEdyWTPCGFDZ+UrWKe/SICOfsPT+F9HIaaS2YL7flDy2OdS2HHke4NIA9HN//uVW5v2uEF4mJkVS4+0s+ZyMWgTs6tshxk1KJmseir+pw== X-YMail-OSG: RNUil2cVM1l_WSemxcJEu4VyFOvJT7NC8TEAqwyeZT5eQgmdiT5yWJcUEfjohNt 96Nrk8I57ajsX5CqF5QT9wmAVUbB_Yivpu6i0LOAymIel2xFqGm_e1qPHIGRvZrLeezcw7yCHUyn nz2xdJCdDNr6EF6b1JyW_WzcWC9dCkTuDWlwWbgm.ugjmvkYEQ90.sW345wjrhgdZICZY7IC7K7l NdEEJ_HlYtrQ0ylbFjQyzDIg9u1UTXRIWlc_hoBOa2bYeB3jNnJBOqphQQoxmnUHYjNNBgPxktl3 dsdMo7dUpsL2654aNnFrZ.wvlcXuOBJRo5ulfB76ZtCU6G_W4mbu4GUoCNPGWPkyHIvfnCxnrEEb y3W9rokxnwyKVK0WsuoC5X0p1ke9IfBtHav2D5PWTRhlxb4P5YQqhPQ7nTctdh8wGdknMDcIsv1f fUL66a..jNuMKQ2qbTmltk7Vyijml.pAdtkNZF_7tKMYxugmi8pmhEmKr2oIxI.kCcyVi94zn_Ng 1q9M_IHsyO5pQC0DUSfvpr0XgK3IRm9pFCuF65GSackDAmP2DlFfUgp6f6jfAZxBq9eRVXZTMb4y mLhLJ3xzgGC1InOOPCpX7qXnH4GVV_gb6rnKJ_Um50H9qs2xyFpMf6eFBoFPZl02sfTMz_ZQS2Ue qAbWYOP4zS4j8yQGvJVX22XLYCbsM_WQFNlAfrsuh.ovXr.jehdXzFDoxWL_Eeein1uI7Db7U92q _nuGhGkVTJkHtd3Wjk.mdPR8Vo78umSni7A26ipqjUiybYAi3EEEb8R6sqAN8rR.NcT693JNgoDQ AjKpx8.iLed707RJ.dAxB8HU9_KIefslGCG79BOmr12fOlGpUtdnmjvnbTWiex0Stu5xHxiifPkU gW7EH9Hj41CjXeTvBdagSYhseWLKoQV70TJAcAylTJoiSxxiISV0Sl0a8hr3KexOFzZmp3fQCeF7 S_o6lDIcyaoQok6k0qzLbdDdiW0AVvn8ImcDe8LPSVrIC_VzU89nGd0Qh8w-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.gq1.yahoo.com with HTTP; Thu, 16 Aug 2018 17:05:23 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.3]) ([181.52.72.201]) by smtp409.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 0792cd4424ae219a3ac29f1596391224; Thu, 16 Aug 2018 17:05:19 +0000 (UTC) Subject: Re: svn commit: r337419 - head/usr.bin/sed To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808071447.w77Eld3I069906@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <0df14e6a-ccaf-d55f-d7cf-d95a243cf8c8@FreeBSD.org> Date: Thu, 16 Aug 2018 12:05:19 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 17:05:25 -0000 On 8/16/2018 10:30 AM, Alan Somers wrote: > On Tue, Aug 7, 2018 at 8:47 AM, Pedro F. Giffuni > wrote: > > Author: pfg > Date: Tue Aug  7 14:47:39 2018 > New Revision: 337419 > URL: https://svnweb.freebsd.org/changeset/base/337419 > > > Log: >   sed(1): partial fix for the case of the regex delimited with '['. > >   We don't generally support the weird case of regular expresions > delimited >   by an opening square bracket ('[') but POSIX says that inside >   bracket expressions, escaping is not possible and both '[' and '\' >   represent themselves. > >   PR:           230198 (exp-run) >   Obtained from:        OpenBSD > > Modified: >   head/usr.bin/sed/compile.c > > Modified: head/usr.bin/sed/compile.c > ============================================================================== > --- head/usr.bin/sed/compile.c  Tue Aug  7 14:39:00 2018        > (r337418) > +++ head/usr.bin/sed/compile.c  Tue Aug  7 14:47:39 2018        > (r337419) > @@ -393,11 +393,11 @@ compile_delimited(char *p, char *d, int is_tr) >                         if ((d = compile_ccl(&p, d)) == NULL) >                                 errx(1, "%lu: %s: unbalanced > brackets ([])", linenum, fname); >                         continue; > +               } else if (*p == '\\' && p[1] == c) { > +                       p++; >                 } else if (*p == '\\' && p[1] == '[') { >                         *d++ = *p++; > -               } else if (*p == '\\' && p[1] == c) > -                       p++; > -               else if (*p == '\\' && p[1] == 'n') { > +               } else if (*p == '\\' && p[1] == 'n') { >                         *d++ = '\n'; >                         p += 2; >                         continue; > > > This change seems to have caused a regression in multi_test.sh. > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/8630/testReport/usr.bin.sed/multi_test/main/ ____ Seeding /usr/tests/usr.bin/sed/regress.multitest.out/2.23 with current result sed: 1: "s[\[.[X[ ": RE error: brackets ([ ]) not balanced sed: 1: "s[\[.[X\[[ ": RE error: brackets ([ ]) not balanced ____ Thanks for the report. The change is correct but incomplete, we also have to fix the first bug reported here: http://undeadly.org/cgi?action=article;sid=20180728110010 I honestly don't have time for this so I'll revert the bug for the second fix for now. Pedro. From owner-svn-src-all@freebsd.org Thu Aug 16 17:06: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 3B487106F143; Thu, 16 Aug 2018 17:06:52 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9730C8E0A6; Thu, 16 Aug 2018 17:06:51 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id w7GH6o0f066705 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Aug 2018 10:06:50 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id w7GH6osp066704; Thu, 16 Aug 2018 10:06:50 -0700 (PDT) (envelope-from jmg) Date: Thu, 16 Aug 2018 10:06:50 -0700 From: John-Mark Gurney To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve Message-ID: <20180816170650.GX97145@funkthat.com> Mail-Followup-To: John-Mark Gurney , Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808160631.w7G6VsS8064579@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201808160631.w7G6VsS8064579@repo.freebsd.org> X-Operating-System: FreeBSD 11.0-RELEASE-p7 amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Thu, 16 Aug 2018 10:06:50 -0700 (PDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 17:06:52 -0000 Marcelo Araujo wrote this message on Thu, Aug 16, 2018 at 06:31 +0000: > Author: araujo > Date: Thu Aug 16 06:31:54 2018 > New Revision: 337887 > URL: https://svnweb.freebsd.org/changeset/base/337887 > > Log: > Add a comment explaining how the PSN works and why there is no need for > a null terminator. Also mark CID 1394825 as intentional. > > Reported by: Coverity > CID: 1394825 > MFC after: 1 week > Sponsored by: iXsystems Inc. > > Modified: > head/usr.sbin/bhyve/pci_nvme.c > > Modified: head/usr.sbin/bhyve/pci_nvme.c > ============================================================================== > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 (r337886) > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 (r337887) > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o [...] > memset(sc->ctrldata.sn, 0, sizeof(sc->ctrldata.sn)); > strncpy(sc->ctrldata.sn, config, > sizeof(sc->ctrldata.sn)); This memset is unneeded, as strncpy will write NUL bytes to fill out the buffer: If src is less than len characters long, the remainder of dst is filled with `\0' characters. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@freebsd.org Thu Aug 16 17:42: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 F39B71070687; Thu, 16 Aug 2018 17:42:46 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A33488F966; Thu, 16 Aug 2018 17:42:46 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.5] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id EFD8A1F549; Thu, 16 Aug 2018 17:42:45 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.10.0.180812 Date: Thu, 16 Aug 2018 10:42:42 -0700 Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... From: Ravi Pokala To: Jung-uk Kim , , , Message-ID: Thread-Topic: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... References: <201808141748.w7EHm3wI027223@repo.freebsd.org> In-Reply-To: <201808141748.w7EHm3wI027223@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 17:42:47 -0000 -----Original Message----- From: on behalf of Jung-uk Kim Date: 2018-08-14, Tuesday at 10:48 To: , , Subject: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... > Author: jkim > Date: Tue Aug 14 17:48:02 2018 > New Revision: 337791 > URL: https://svnweb.freebsd.org/changeset/base/337791 > > Log: > Merge OpenSSL 1.0.2p. Is it just me, or did this change break all the worlds? I got errors like this: ---------------------------------------------------------------- /usr/bin/ld: error: undefined symbol: main >>> referenced by crt1.c:74 (/usr/home/rpokala/freebsd/clean/base/head/lib/csu/amd64/crt1.c:74) >>> /build/usr/home/rpokala/freebsd/clean/base/head/amd64.amd64/tmp/usr/lib/crt1.o:(_start) /usr/bin/ld: error: undefined symbol: Fssh_error >>> referenced by moduli.c:257 (/usr/home/rpokala/freebsd/clean/base/head/crypto/openssh/moduli.c:257) >>> /tmp/moduli-6780ab.o:(Fssh_gen_candidates) ---------------------------------------------------------------- At first I thought it was because I was rebuilding without cleaning, but I nuked the tree and rebuilt from scratch, and got the same error. I didn't bisect it to this change, but it's the only recent change to crypto... -Ravi (rpokala@) From owner-svn-src-all@freebsd.org Thu Aug 16 17:46: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 C376F10707CE; Thu, 16 Aug 2018 17:46:30 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:bb:dcff:fe50:d900]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.lerctr.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53ABA8FB54; Thu, 16 Aug 2018 17:46:30 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=a6VWgZKh/xZmagjybioAeuvmLzPHvNOZ8gk2clrVUew=; b=uZG+/cRz1V4YsM99t6qtOa0QnF PT6EbBf/1e0x5XuHsbu1VRTar2A04uwjImrInsg6vDg1FvSJBX4mwD7NsFcVQ8Pk2rf7V7kyCdo2Z Dv7UmcBasXjlG46vD2Rs+CVZuMe0nis4/HoJzQ86YB23PAcgeghm8InpwGtAtwQCbDTA=; Received: from [2600:1700:210:b18f:4c0:e5c4:68ef:d5be] (port=56370 helo=ler-imac.local) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1fqMLt-000Jac-Kt; Thu, 16 Aug 2018 12:46:29 -0500 Date: Thu, 16 Aug 2018 12:46:29 -0500 From: Larry Rosenman To: Ravi Pokala Cc: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... Message-ID: <20180816174629.jlmzxi2xrectp6m7@ler-imac.local> Mail-Followup-To: Ravi Pokala , Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808141748.w7EHm3wI027223@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dvvxvg67dsysafss" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 17:46:31 -0000 --dvvxvg67dsysafss Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 16, 2018 at 10:42:42AM -0700, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Jung-uk Kim > Date: 2018-08-14, Tuesday at 10:48 > To: , , > Subject: svn commit: r337791 - in head: crypto/openssl crypto/openssl/app= s crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bi= o crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... >=20 > > Author: jkim > > Date: Tue Aug 14 17:48:02 2018 > > New Revision: 337791 > > URL: https://svnweb.freebsd.org/changeset/base/337791 > >=20 > > Log: > > Merge OpenSSL 1.0.2p. >=20 > Is it just me, or did this change break all the worlds? >=20 > I got errors like this: >=20 > ---------------------------------------------------------------- > /usr/bin/ld: error: undefined symbol: main > >>> referenced by crt1.c:74 (/usr/home/rpokala/freebsd/clean/base/head/li= b/csu/amd64/crt1.c:74) > >>> /build/usr/home/rpokala/freebsd/clean/base/head/amd64.a= md64/tmp/usr/lib/crt1.o:(_start) >=20 > /usr/bin/ld: error: undefined symbol: Fssh_error > >>> referenced by moduli.c:257 (/usr/home/rpokala/freebsd/clean/base/head= /crypto/openssh/moduli.c:257) > >>> /tmp/moduli-6780ab.o:(Fssh_gen_candidates) > ---------------------------------------------------------------- >=20 > At first I thought it was because I was rebuilding without cleaning, but = I nuked the tree and rebuilt from scratch, and got the same error. >=20 > I didn't bisect it to this change, but it's the only recent change to cry= pto... >=20 see the discussion over on -current. a 2nd svn up post the error will fix it till the next one. > -Ravi (rpokala@) >=20 >=20 > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 5708 Sabbia Drive, Round Rock, TX 78665-2106 --dvvxvg67dsysafss Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHABAABCgCqFiEEHjgknedhWzvJgwVzaXyZsatIp30FAlt1uHQsFIAAAAAAFQAO cGthLWFkZHJlc3NAZ251cGcub3JnbGVyQGxlcmN0ci5vcmdfFIAAAAAALgAoaXNz dWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDFFMzgy NDlERTc2MTVCM0JDOTgzMDU3MzY5N0M5OUIxQUI0OEE3N0QACgkQaXyZsatIp32O IAf/cOg9YLOu/xT5eN5tU72pmoGEvbVfk6lDfoSB03dtCplzSQU5qH26KRYEKiL9 OdWs4bDG4UG2cOP2puk+OeglLDqj6FmdxpSe16yafoeIXvojJhmPbdK1uJCLq1Ny /sNwda8nX0BfErdglEW0Dhzp+EjCbxAsbQlzVwAfTvzErBVQreeBIbR49cs322tD Q6a8K/x0IUXoAdRBJDEQ8LrRPwSFkWb7Duu0SNYYarlq5lHRVTWK7+3ox13JaNY1 y6F+Nnw8/OZyh41tKsYbn74KFibo6/ymzSs12YpVTGbdnDCJyNvyoSq8yomhJrNI b7bP33FUoqneisBBm5DS1aDJ/w== =lxiv -----END PGP SIGNATURE----- --dvvxvg67dsysafss-- From owner-svn-src-all@freebsd.org Thu Aug 16 17:48: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 4EEB910708D1; Thu, 16 Aug 2018 17:48:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9D978FD0A; Thu, 16 Aug 2018 17:48:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (static-71-168-218-4.cmdnnj.fios.verizon.net [71.168.218.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 9D0131F54A; Thu, 16 Aug 2018 17:48:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... To: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808141748.w7EHm3wI027223@repo.freebsd.org> From: Jung-uk Kim Openpgp: preference=signencrypt Autocrypt: addr=jkim@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZWvZHoFIyunPTJWenybeV1xnxK7JkUdSvQR0 fA59RfTTECMwTrSEfYGUnxIDBraxJ7Ecs/0hGQ7sljIj8WBvlRDU5fU1xfF35aw56T8POQRq F4E6RVJW3YGuTpSwgtGZOTfygcLRhAiq3dFC3JNLaTVTpM8PjOinJyt9AU6RoITGOKwDABEB AAHNHkp1bmctdWsgS2ltIDxqa2ltQEZyZWVCU0Qub3JnPsLAfQQTAQoAJwUCUkHO1QIbAwUJ E0/POwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRB8n5Ym/NvxRqyzB/wL7QtsIpeGfGIA ZPMtgXMucM3NWzomyQMln2j2efUkDKthzh9jBxgF53TjOr7imwIt0PT2k1bqctPrq5IRqnu9 mGroqaCLE3LG2/E3jEaao4k9PO6efwlioyivUo5NrqIQOQ4k3EAXw7d2y0Dk1VpTgdMrnUAB hj7lGlLqS4ydcrf24DdbCRGdEQwqd9DBeBgbWynxAJMgbZBhYVEyIHuQKkJ8qY0ibIPXXuF0 KYDeH0qUHtWV2K3srNyPtymUkBQD84Pl1GWRYx05XdUHDmnX0JV3lg0BfYJZgZv0ehPQrMfY Fd9abTkf9FHQYz1JtsC8wUuRgqElRd6+YAGf8Tt9zsBNBFJBztUBCADLtSrP44El2VoJmH14 OFrlOgxzZnbn+Y/Gf1k12mJBiR+A+pBeRLD50p7AiTrjHRxO3cHcl9Dh0uf1VSbXgp8Or0ye iP/86fZPd4k5HXNmDTLL0HecPE08SCqGZ0W8vllQrokB1QxxRUB+fFMPJyMCjDAZ7P9fFTOS dTw1bJSTtOD8Sx8MpZUa9ti06bXFlVYDlaqSdgk181SSx+ZbSKkQR8CIMARlHwiLsa3Z9q9O EJr20HPyxe0AlTvwvFndH61hg7ds63eRvglwRnNON28VXO/lvKXq7Br/CiiyhFdKfINIx2Z5 htYq22tgGTW7mBURbIKoECFBTX9Lv6BXz6w9ABEBAAHCwGUEGAEKAA8FAlJBztUCGwwFCRNP zzsACgkQfJ+WJvzb8UZcJQf+IsTCxUEqY7W/pT84sMg5/QD3s6ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Message-ID: Date: Thu, 16 Aug 2018 13:48:40 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xwaQfYc8K6eL4bNjdd53z981ItrpXqYWV" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 17:48:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xwaQfYc8K6eL4bNjdd53z981ItrpXqYWV Content-Type: multipart/mixed; boundary="71hZAv7wwjHAWL7uUUhLm79RlrV7YobaO"; protected-headers="v1" From: Jung-uk Kim To: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... References: <201808141748.w7EHm3wI027223@repo.freebsd.org> In-Reply-To: --71hZAv7wwjHAWL7uUUhLm79RlrV7YobaO Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 18. 8. 16., Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Jung-uk Kim > Date: 2018-08-14, Tuesday at 10:48 > To: , , > Subject: svn commit: r337791 - in head: crypto/openssl crypto/openssl/a= pps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypt= o/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... >=20 >> Author: jkim >> Date: Tue Aug 14 17:48:02 2018 >> New Revision: 337791 >> URL: https://svnweb.freebsd.org/changeset/base/337791 >> >> Log: >> Merge OpenSSL 1.0.2p. >=20 > Is it just me, or did this change break all the worlds? >=20 > I got errors like this: >=20 > ---------------------------------------------------------------- > /usr/bin/ld: error: undefined symbol: main >>>> referenced by crt1.c:74 (/usr/home/rpokala/freebsd/clean/base/head/l= ib/csu/amd64/crt1.c:74) >>>> /build/usr/home/rpokala/freebsd/clean/base/head/amd64.= amd64/tmp/usr/lib/crt1.o:(_start) >=20 > /usr/bin/ld: error: undefined symbol: Fssh_error >>>> referenced by moduli.c:257 (/usr/home/rpokala/freebsd/clean/base/hea= d/crypto/openssh/moduli.c:257) >>>> /tmp/moduli-6780ab.o:(Fssh_gen_candidates) > ---------------------------------------------------------------- >=20 > At first I thought it was because I was rebuilding without cleaning, bu= t I nuked the tree and rebuilt from scratch, and got the same error. >=20 > I didn't bisect it to this change, but it's the only recent change to c= rypto... I built worlds many times and I haven't seen such problem. In fact, Jenkins didn't break on amd64 after the commit. https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ Jung-uk Kim --71hZAv7wwjHAWL7uUUhLm79RlrV7YobaO-- --xwaQfYc8K6eL4bNjdd53z981ItrpXqYWV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlt1uQAACgkQfJ+WJvzb 8UYR6Qf/VrkSYHTUdmIE2c4Fj2xDqeT4tDq1AcU+DuPw6J1HLILK4LmumQJ+YHjm a7b0g/mAkcbBCIaNZdqyL6OnPQE9RC/nv8PgiihNmUrwe7u5pdLZnG4pE4Xy6j1F o4w2uJ/MS7xMbfQKKdp7GvyNcBQIbjvZcQqpqcEJb4tXzxteY2ZV0+gbRNbcX8Vc BJpKEgjQc/GyrexPsFWILF/EzBlZSZ6SlZ3VM2IVURQrwX4XkKBl8GXMqE1AjYaj XSQ278a0apDaEaaSqgyDnWEU/w9t5nPLWkxw9bbwIOprEgOo3f8xMiorUlDaKQy3 D8mua32x9kS3RdMnoPpmhsuToCJSOw== =qTkN -----END PGP SIGNATURE----- --xwaQfYc8K6eL4bNjdd53z981ItrpXqYWV-- From owner-svn-src-all@freebsd.org Thu Aug 16 17:54: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 D0CB41070BFF; Thu, 16 Aug 2018 17:54:05 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:bb:dcff:fe50:d900]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.lerctr.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 644DF70212; Thu, 16 Aug 2018 17:54:05 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=gp86w+QsLnhRGaNQIg3orpivBakCcT16Ga73htLF0jY=; b=hSNbEe9U681VKMbVIb9vQSi0iw /DYf1Ye104KfcWPqDEbdtudnm7IieBfpE8C9hBnZIhPrQKBZMkp/6rUwtXrNJT2Y0RGX/8xnqzxyo 0ztoY9mQqwTDtKk4l2TvRilnvNyYIjN2uRaF5EbxfQd5+rhcbzXKrQDwBokXeXiXMJtE=; Received: from [2600:1700:210:b18f:4c0:e5c4:68ef:d5be] (port=56563 helo=ler-imac.local) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1fqMTE-000JkV-He; Thu, 16 Aug 2018 12:54:04 -0500 Date: Thu, 16 Aug 2018 12:54:04 -0500 From: Larry Rosenman To: Jung-uk Kim Cc: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... Message-ID: <20180816175403.ub22a5glkczrmfij@ler-imac.local> Mail-Followup-To: Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808141748.w7EHm3wI027223@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4sp62odmp6cdqtp7" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 17:54:06 -0000 --4sp62odmp6cdqtp7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 16, 2018 at 01:48:40PM -0400, Jung-uk Kim wrote: > On 18. 8. 16., Ravi Pokala wrote: > > -----Original Message----- > > From: on behalf of Jung-uk Kim > > Date: 2018-08-14, Tuesday at 10:48 > > To: , , > > Subject: svn commit: r337791 - in head: crypto/openssl crypto/openssl/a= pps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/= bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... > >=20 > >> Author: jkim > >> Date: Tue Aug 14 17:48:02 2018 > >> New Revision: 337791 > >> URL: https://svnweb.freebsd.org/changeset/base/337791 > >> > >> Log: > >> Merge OpenSSL 1.0.2p. > >=20 > > Is it just me, or did this change break all the worlds? > >=20 > > I got errors like this: > >=20 > > ---------------------------------------------------------------- > > /usr/bin/ld: error: undefined symbol: main > >>>> referenced by crt1.c:74 (/usr/home/rpokala/freebsd/clean/base/head/l= ib/csu/amd64/crt1.c:74) > >>>> /build/usr/home/rpokala/freebsd/clean/base/head/amd64.= amd64/tmp/usr/lib/crt1.o:(_start) > >=20 > > /usr/bin/ld: error: undefined symbol: Fssh_error > >>>> referenced by moduli.c:257 (/usr/home/rpokala/freebsd/clean/base/hea= d/crypto/openssh/moduli.c:257) > >>>> /tmp/moduli-6780ab.o:(Fssh_gen_candidates) > > ---------------------------------------------------------------- > >=20 > > At first I thought it was because I was rebuilding without cleaning, bu= t I nuked the tree and rebuilt from scratch, and got the same error. > >=20 > > I didn't bisect it to this change, but it's the only recent change to c= rypto... >=20 > I built worlds many times and I haven't seen such problem. In fact, > Jenkins didn't break on amd64 after the commit. >=20 > https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ Do you or jenkins run with meta-mode? That seems to be a necessary condition for the failure.=20 >=20 > Jung-uk Kim >=20 --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 5708 Sabbia Drive, Round Rock, TX 78665-2106 --4sp62odmp6cdqtp7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHABAABCgCqFiEEHjgknedhWzvJgwVzaXyZsatIp30FAlt1ujssFIAAAAAAFQAO cGthLWFkZHJlc3NAZ251cGcub3JnbGVyQGxlcmN0ci5vcmdfFIAAAAAALgAoaXNz dWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDFFMzgy NDlERTc2MTVCM0JDOTgzMDU3MzY5N0M5OUIxQUI0OEE3N0QACgkQaXyZsatIp32c Wgf/WqOWNLN24DNRlcrvmEoT7b+qEfiiPYqn4mOY14hNQ49eeFORUvNwTk7ZwMym L4AnrDuc6XmLXTY0ahdaqft9b+kaESl4haFn4TY2Or2Ye+gqD3TOkCZ6xSngdRP+ OmcIZdjYoIuR+UGCMtYWJcFVgRjkbH31+bU8kIHcmLXenKlKbLy5bnhmAUyFElIz z9N6S7mqwbDWWASyUCSpqBeCYGPICU2Z8uHUWPwdLPMKxLTba8BU6ogFIlpzWk2n yhz7C1YIZiaZuUlcz1wDpcqE9n2XNB/MsfioVUlysUnGBzX+h13w3GIOtX+79IA0 TkeLMXCmyfVxI6Yj/qS0MrKvJw== =DSW/ -----END PGP SIGNATURE----- --4sp62odmp6cdqtp7-- From owner-svn-src-all@freebsd.org Thu Aug 16 17:56: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 929DC1070CEA; Thu, 16 Aug 2018 17:56:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E586703AD; Thu, 16 Aug 2018 17:56:05 +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 0A7911CCB2; Thu, 16 Aug 2018 17:56:05 +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 w7GHu4j2024375; Thu, 16 Aug 2018 17:56:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GHu4jo024372; Thu, 16 Aug 2018 17:56:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808161756.w7GHu4jo024372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Aug 2018 17:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337915 - in head: lib/libbe sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libbe sbin/bectl X-SVN-Commit-Revision: 337915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 17:56:05 -0000 Author: kevans Date: Thu Aug 16 17:56:03 2018 New Revision: 337915 URL: https://svnweb.freebsd.org/changeset/base/337915 Log: libbe(3)/bectl(8): Hit rewind on a bunch of off-by-ones While here, use sizeof() in some places that it makes sense to reduce room for error and prefer strlcpy to strncpy Modified: head/lib/libbe/be.c head/lib/libbe/be_access.c head/lib/libbe/be_impl.h head/sbin/bectl/bectl_jail.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Thu Aug 16 16:30:23 2018 (r337914) +++ head/lib/libbe/be.c Thu Aug 16 17:56:03 2018 (r337915) @@ -66,7 +66,7 @@ be_locate_rootfs(zfs_handle_t *chkds, void *data) mntpoint = NULL; if (zfs_is_mounted(chkds, &mntpoint) && strcmp(mntpoint, "/") == 0) { - strlcpy(lbh->rootfs, zfs_get_name(chkds), BE_MAXPATHLEN + 1); + strlcpy(lbh->rootfs, zfs_get_name(chkds), sizeof(lbh->rootfs)); free(mntpoint); return (1); } else if(mntpoint != NULL) @@ -118,13 +118,14 @@ libbe_init(void) goto err; /* Obtain path to boot environment root */ - if ((kenv(KENV_GET, "zfs_be_root", lbh->root, BE_MAXPATHLEN)) == -1) + if ((kenv(KENV_GET, "zfs_be_root", lbh->root, + sizeof(lbh->root))) == -1) goto err; /* Remove leading 'zfs:' if present, otherwise use value as-is */ if (strcmp(lbh->root, "zfs:") == 0) strlcpy(lbh->root, strchr(lbh->root, ':') + sizeof(char), - BE_MAXPATHLEN + 1); + sizeof(lbh->root)); if ((pos = strchr(lbh->root, '/')) == NULL) goto err; @@ -134,13 +135,12 @@ libbe_init(void) if (poolname == NULL) goto err; - strncpy(poolname, lbh->root, pnamelen); - poolname[pnamelen] = '\0'; + strlcpy(poolname, lbh->root, pnamelen + 1); if ((lbh->active_phandle = zpool_open(lbh->lzh, poolname)) == NULL) goto err; if (zpool_get_prop(lbh->active_phandle, ZPOOL_PROP_BOOTFS, lbh->bootfs, - BE_MAXPATHLEN, NULL, true) != 0) + sizeof(lbh->bootfs), NULL, true) != 0) goto err; /* Obtain path to boot environment rootfs (currently booted) */ @@ -282,7 +282,7 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c } else { time(&rawtime); len = strlen(buf); - strftime(buf + len, BE_MAXPATHLEN - len, + strftime(buf + len, sizeof(buf) - len, "@%F-%T", localtime(&rawtime)); if (result != NULL) strcpy(result, strrchr(buf, '/') + 1); @@ -499,7 +499,7 @@ int be_validate_snap(libbe_handle_t *lbh, const char *snap_name) { zfs_handle_t *zfs_hdl; - char buf[BE_MAXPATHLEN + 1]; + char buf[BE_MAXPATHLEN]; char *delim_pos; int err = BE_ERR_SUCCESS; @@ -510,7 +510,7 @@ be_validate_snap(libbe_handle_t *lbh, const char *snap ZFS_TYPE_SNAPSHOT)) return (BE_ERR_NOENT); - strlcpy(buf, snap_name, BE_MAXPATHLEN + 1); + strlcpy(buf, snap_name, sizeof(buf)); /* Find the base filesystem of the snapshot */ if ((delim_pos = strchr(buf, '@')) == NULL) @@ -521,11 +521,11 @@ be_validate_snap(libbe_handle_t *lbh, const char *snap zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) return (BE_ERR_NOORIGIN); - if ((err = zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, buf, BE_MAXPATHLEN, - NULL, NULL, 0, 1)) != 0) + if ((err = zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, buf, + sizeof(buf), NULL, NULL, 0, 1)) != 0) err = BE_ERR_INVORIGIN; - if ((err != 0) && (strncmp(buf, "/", BE_MAXPATHLEN) != 0)) + if ((err != 0) && (strncmp(buf, "/", sizeof(buf)) != 0)) err = BE_ERR_INVORIGIN; zfs_close(zfs_hdl); @@ -558,7 +558,7 @@ be_root_concat(libbe_handle_t *lbh, const char *name, if (name_len >= BE_MAXPATHLEN) return (BE_ERR_PATHLEN); - strncpy(result, name, BE_MAXPATHLEN); + strlcpy(result, name, BE_MAXPATHLEN); return (BE_ERR_SUCCESS); } else if (name_len + root_len + 1 < BE_MAXPATHLEN) { snprintf(result, BE_MAXPATHLEN, "%s/%s", lbh->root, @@ -690,8 +690,7 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in time(&rawtime); len = strlen(buf); - strftime(buf + len, BE_MAXPATHLEN - len, - "@%F-%T", localtime(&rawtime)); + strftime(buf + len, sizeof(buf) - len, "@%F-%T", localtime(&rawtime)); if ((err = lzc_receive(buf, NULL, NULL, false, fd)) != 0) { switch (err) { Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Thu Aug 16 16:30:23 2018 (r337914) +++ head/lib/libbe/be_access.c Thu Aug 16 17:56:03 2018 (r337915) @@ -64,12 +64,12 @@ be_mountcheck_cb(zfs_handle_t *zfs_hdl, void *data) int be_mounted_at(libbe_handle_t *lbh, const char *path, nvlist_t *details) { - char be[BE_MAXPATHLEN + 1]; + char be[BE_MAXPATHLEN]; zfs_handle_t *root_hdl; struct be_mountcheck_info info; prop_data_t propinfo; - bzero(&be, BE_MAXPATHLEN + 1); + bzero(&be, BE_MAXPATHLEN); if ((root_hdl = zfs_open(lbh->lzh, lbh->root, ZFS_TYPE_FILESYSTEM)) == NULL) return (BE_ERR_ZFSOPEN); Modified: head/lib/libbe/be_impl.h ============================================================================== --- head/lib/libbe/be_impl.h Thu Aug 16 16:30:23 2018 (r337914) +++ head/lib/libbe/be_impl.h Thu Aug 16 17:56:03 2018 (r337915) @@ -38,9 +38,9 @@ struct libbe_handle { libzfs_handle_t *lzh; zpool_handle_t *active_phandle; - char root[BE_MAXPATHLEN + 1]; - char rootfs[BE_MAXPATHLEN + 1]; - char bootfs[BE_MAXPATHLEN + 1]; + char root[BE_MAXPATHLEN]; + char rootfs[BE_MAXPATHLEN]; + char bootfs[BE_MAXPATHLEN]; be_error_t error; bool print_on_err; }; Modified: head/sbin/bectl/bectl_jail.c ============================================================================== --- head/sbin/bectl/bectl_jail.c Thu Aug 16 16:30:23 2018 (r337914) +++ head/sbin/bectl/bectl_jail.c Thu Aug 16 17:56:03 2018 (r337915) @@ -57,7 +57,7 @@ static int bectl_locate_jail(const char *ident); static struct jailparam *jp; static int jpcnt; static int jpused; -static char mnt_loc[BE_MAXPATHLEN + 1]; +static char mnt_loc[BE_MAXPATHLEN]; static void jailparam_grow(void) @@ -147,7 +147,7 @@ jailparam_addarg(char *arg) *val++ = '\0'; if (strcmp(name, "path") == 0) { - if (strlen(val) > BE_MAXPATHLEN) { + if (strlen(val) >= BE_MAXPATHLEN) { fprintf(stderr, "bectl jail: skipping too long path assignment '%s' (max length = %d)\n", val, BE_MAXPATHLEN); @@ -283,7 +283,7 @@ bectl_cmd_jail(int argc, char *argv[]) static int bectl_search_jail_paths(const char *mnt) { - char jailpath[MAXPATHLEN + 1]; + char jailpath[MAXPATHLEN]; int jid; jid = 0; @@ -337,7 +337,7 @@ bectl_locate_jail(const char *ident) int bectl_cmd_unjail(int argc, char *argv[]) { - char path[MAXPATHLEN + 1]; + char path[MAXPATHLEN]; char *cmd, *name, *target; int jid; @@ -358,7 +358,7 @@ bectl_cmd_unjail(int argc, char *argv[]) return (1); } - bzero(&path, MAXPATHLEN + 1); + bzero(&path, MAXPATHLEN); name = jail_getname(jid); if (jail_getv(0, "name", name, "path", path, NULL) != jid) { free(name); From owner-svn-src-all@freebsd.org Thu Aug 16 17:59: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 2A2971070E10; Thu, 16 Aug 2018 17:59:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D494470597; Thu, 16 Aug 2018 17:59:49 +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 B70941CCB5; Thu, 16 Aug 2018 17:59:49 +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 w7GHxnfM024559; Thu, 16 Aug 2018 17:59:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GHxnCO024558; Thu, 16 Aug 2018 17:59:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808161759.w7GHxnCO024558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Aug 2018 17:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337916 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 337916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 17:59:50 -0000 Author: kevans Date: Thu Aug 16 17:59:49 2018 New Revision: 337916 URL: https://svnweb.freebsd.org/changeset/base/337916 Log: bectl(8): Appease clang-scan Use strlcpy instead of a plain strcpy Modified: head/sbin/bectl/bectl_jail.c Modified: head/sbin/bectl/bectl_jail.c ============================================================================== --- head/sbin/bectl/bectl_jail.c Thu Aug 16 17:56:03 2018 (r337915) +++ head/sbin/bectl/bectl_jail.c Thu Aug 16 17:59:49 2018 (r337916) @@ -153,7 +153,7 @@ jailparam_addarg(char *arg) val, BE_MAXPATHLEN); return (false); } - strcpy(mnt_loc, val); + strlcpy(mnt_loc, val, sizeof(mnt_loc)); } jailparam_add(name, val); return (true); From owner-svn-src-all@freebsd.org Thu Aug 16 18:02: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 B07A510710CA; Thu, 16 Aug 2018 18:02:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51F5970A28; Thu, 16 Aug 2018 18:02:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (static-71-168-218-4.cmdnnj.fios.verizon.net [71.168.218.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 242251F759; Thu, 16 Aug 2018 18:02:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... To: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> From: Jung-uk Kim Openpgp: preference=signencrypt Autocrypt: addr=jkim@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZWvZHoFIyunPTJWenybeV1xnxK7JkUdSvQR0 fA59RfTTECMwTrSEfYGUnxIDBraxJ7Ecs/0hGQ7sljIj8WBvlRDU5fU1xfF35aw56T8POQRq F4E6RVJW3YGuTpSwgtGZOTfygcLRhAiq3dFC3JNLaTVTpM8PjOinJyt9AU6RoITGOKwDABEB AAHNHkp1bmctdWsgS2ltIDxqa2ltQEZyZWVCU0Qub3JnPsLAfQQTAQoAJwUCUkHO1QIbAwUJ E0/POwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRB8n5Ym/NvxRqyzB/wL7QtsIpeGfGIA ZPMtgXMucM3NWzomyQMln2j2efUkDKthzh9jBxgF53TjOr7imwIt0PT2k1bqctPrq5IRqnu9 mGroqaCLE3LG2/E3jEaao4k9PO6efwlioyivUo5NrqIQOQ4k3EAXw7d2y0Dk1VpTgdMrnUAB hj7lGlLqS4ydcrf24DdbCRGdEQwqd9DBeBgbWynxAJMgbZBhYVEyIHuQKkJ8qY0ibIPXXuF0 KYDeH0qUHtWV2K3srNyPtymUkBQD84Pl1GWRYx05XdUHDmnX0JV3lg0BfYJZgZv0ehPQrMfY Fd9abTkf9FHQYz1JtsC8wUuRgqElRd6+YAGf8Tt9zsBNBFJBztUBCADLtSrP44El2VoJmH14 OFrlOgxzZnbn+Y/Gf1k12mJBiR+A+pBeRLD50p7AiTrjHRxO3cHcl9Dh0uf1VSbXgp8Or0ye iP/86fZPd4k5HXNmDTLL0HecPE08SCqGZ0W8vllQrokB1QxxRUB+fFMPJyMCjDAZ7P9fFTOS dTw1bJSTtOD8Sx8MpZUa9ti06bXFlVYDlaqSdgk181SSx+ZbSKkQR8CIMARlHwiLsa3Z9q9O EJr20HPyxe0AlTvwvFndH61hg7ds63eRvglwRnNON28VXO/lvKXq7Br/CiiyhFdKfINIx2Z5 htYq22tgGTW7mBURbIKoECFBTX9Lv6BXz6w9ABEBAAHCwGUEGAEKAA8FAlJBztUCGwwFCRNP zzsACgkQfJ+WJvzb8UZcJQf+IsTCxUEqY7W/pT84sMg5/QD3s6ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Message-ID: Date: Thu, 16 Aug 2018 14:02:52 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180816175403.ub22a5glkczrmfij@ler-imac.local> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KdBQK3H3VpbNluSk9Av507MxRjwCKXCSK" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:02:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KdBQK3H3VpbNluSk9Av507MxRjwCKXCSK Content-Type: multipart/mixed; boundary="UOFHQwQhYn2YSaX1rGSM1PuglYXBcyHBT"; protected-headers="v1" From: Jung-uk Kim To: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> In-Reply-To: <20180816175403.ub22a5glkczrmfij@ler-imac.local> --UOFHQwQhYn2YSaX1rGSM1PuglYXBcyHBT Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 18. 8. 16., Larry Rosenman wrote: > On Thu, Aug 16, 2018 at 01:48:40PM -0400, Jung-uk Kim wrote: >> On 18. 8. 16., Ravi Pokala wrote: >>> -----Original Message----- >>> From: on behalf of Jung-uk Kim >>> Date: 2018-08-14, Tuesday at 10:48 >>> To: , , >>> Subject: svn commit: r337791 - in head: crypto/openssl crypto/openssl= /apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/cry= pto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... >>> >>>> Author: jkim >>>> Date: Tue Aug 14 17:48:02 2018 >>>> New Revision: 337791 >>>> URL: https://svnweb.freebsd.org/changeset/base/337791 >>>> >>>> Log: >>>> Merge OpenSSL 1.0.2p. >>> >>> Is it just me, or did this change break all the worlds? >>> >>> I got errors like this: >>> >>> ---------------------------------------------------------------- >>> /usr/bin/ld: error: undefined symbol: main >>>>>> referenced by crt1.c:74 (/usr/home/rpokala/freebsd/clean/base/head= /lib/csu/amd64/crt1.c:74) >>>>>> /build/usr/home/rpokala/freebsd/clean/base/head/amd6= 4.amd64/tmp/usr/lib/crt1.o:(_start) >>> >>> /usr/bin/ld: error: undefined symbol: Fssh_error >>>>>> referenced by moduli.c:257 (/usr/home/rpokala/freebsd/clean/base/h= ead/crypto/openssh/moduli.c:257) >>>>>> /tmp/moduli-6780ab.o:(Fssh_gen_candidates) >>> ---------------------------------------------------------------- >>> >>> At first I thought it was because I was rebuilding without cleaning, = but I nuked the tree and rebuilt from scratch, and got the same error. >>> >>> I didn't bisect it to this change, but it's the only recent change to= crypto... >> >> I built worlds many times and I haven't seen such problem. In fact, >> Jenkins didn't break on amd64 after the commit. >> >> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ > Do you or jenkins run with meta-mode? That seems to be a necessary > condition for the failure. I don't do meta-mode. I don't know much about Jenkins build but I don't think it does. Is it a requirement now? Jung-uk Kim --UOFHQwQhYn2YSaX1rGSM1PuglYXBcyHBT-- --KdBQK3H3VpbNluSk9Av507MxRjwCKXCSK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlt1vE0ACgkQfJ+WJvzb 8UbDOwgAiuWV03eHgqk0pd0qqdx0bRDq9vv4L6l9rFrxW/M8f0eOFdsjDUuRaL95 jnOGciejko/Pa31JLbPmcU0nJQZhLuid6V2+ObyX0MqimaHaXqO8NPgs72zpznr8 sAfk46LjH1sojOA01V3bSJc2DcCI8f6AmV83BLca1CnVwkM3K0M+z8WRb9jcVGmp BDqbB81BoPHQmAXCnp38mR9DsLHUMvsx5u9QC98p+4VI6wGDq4zmt+tKUjtCsDur u1W0B6T1eRDr2BJy6TJszVRIexmB1a98AHVS/tm/Rl+8kN684XBS4HrzbY0cdg0t S8PTpwVcv2e4+BZcsCfMC8kzUfFhbw== =gS9z -----END PGP SIGNATURE----- --KdBQK3H3VpbNluSk9Av507MxRjwCKXCSK-- From owner-svn-src-all@freebsd.org Thu Aug 16 18:21:17 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 B9C851071B63; Thu, 16 Aug 2018 18:21:17 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:bb:dcff:fe50:d900]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.lerctr.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5860971529; Thu, 16 Aug 2018 18:21:17 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1+g2b7/xE1/qAR8iKyGxhrlKf1r1MTEurj3Vm+ZCZ+Q=; b=l0rs0t5dX8HQRIzIfX044w1y7q fvCGcAGix57yl3Mj3ai1BF4rVcBOHmZs4zbSPDcesF6yyJHevKGm99ZjIG5NHqEB4JsrgC8Mv3d9f 3q9pkW9AkwNwgeQfNzCLuKv77/5S5OLLJ/iK5ygEaimOUY4EIcMhELVOXazTPlnZDE+E=; Received: from [2600:1700:210:b18f:4c0:e5c4:68ef:d5be] (port=57151 helo=ler-imac.local) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1fqMtY-000KJb-BW; Thu, 16 Aug 2018 13:21:16 -0500 Date: Thu, 16 Aug 2018 13:21:15 -0500 From: Larry Rosenman To: Jung-uk Kim Cc: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bdrewery@FreeBSD.org Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... Message-ID: <20180816182115.mqxkpzgifomjodwl@ler-imac.local> Mail-Followup-To: Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bdrewery@FreeBSD.org References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="o7jqzcpec2h552fp" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:21:18 -0000 --o7jqzcpec2h552fp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 16, 2018 at 02:02:52PM -0400, Jung-uk Kim wrote: > On 18. 8. 16., Larry Rosenman wrote: > > On Thu, Aug 16, 2018 at 01:48:40PM -0400, Jung-uk Kim wrote: > >> On 18. 8. 16., Ravi Pokala wrote: > >>> -----Original Message----- > >>> From: on behalf of Jung-uk Kim > >>> Date: 2018-08-14, Tuesday at 10:48 > >>> To: , , > >>> Subject: svn commit: r337791 - in head: crypto/openssl crypto/openssl= /apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypt= o/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... > >>> > >>>> Author: jkim > >>>> Date: Tue Aug 14 17:48:02 2018 > >>>> New Revision: 337791 > >>>> URL: https://svnweb.freebsd.org/changeset/base/337791 > >>>> > >>>> Log: > >>>> Merge OpenSSL 1.0.2p. > >>> > >>> Is it just me, or did this change break all the worlds? > >>> > >>> I got errors like this: > >>> > >>> ---------------------------------------------------------------- > >>> /usr/bin/ld: error: undefined symbol: main > >>>>>> referenced by crt1.c:74 (/usr/home/rpokala/freebsd/clean/base/head= /lib/csu/amd64/crt1.c:74) > >>>>>> /build/usr/home/rpokala/freebsd/clean/base/head/amd6= 4.amd64/tmp/usr/lib/crt1.o:(_start) > >>> > >>> /usr/bin/ld: error: undefined symbol: Fssh_error > >>>>>> referenced by moduli.c:257 (/usr/home/rpokala/freebsd/clean/base/h= ead/crypto/openssh/moduli.c:257) > >>>>>> /tmp/moduli-6780ab.o:(Fssh_gen_candidates) > >>> ---------------------------------------------------------------- > >>> > >>> At first I thought it was because I was rebuilding without cleaning, = but I nuked the tree and rebuilt from scratch, and got the same error. > >>> > >>> I didn't bisect it to this change, but it's the only recent change to= crypto... > >> > >> I built worlds many times and I haven't seen such problem. In fact, > >> Jenkins didn't break on amd64 after the commit. > >> > >> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ > > Do you or jenkins run with meta-mode? That seems to be a necessary > > condition for the failure. > I don't do meta-mode. I don't know much about Jenkins build but I don't > think it does. Is it a requirement now? >=20 It's not a requirement, but seems to be implicated in this failure..... Cc'ing bdrewery@ for the meta mode stuff. > Jung-uk Kim >=20 --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 5708 Sabbia Drive, Round Rock, TX 78665-2106 --o7jqzcpec2h552fp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHABAABCgCqFiEEHjgknedhWzvJgwVzaXyZsatIp30FAlt1wJssFIAAAAAAFQAO cGthLWFkZHJlc3NAZ251cGcub3JnbGVyQGxlcmN0ci5vcmdfFIAAAAAALgAoaXNz dWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDFFMzgy NDlERTc2MTVCM0JDOTgzMDU3MzY5N0M5OUIxQUI0OEE3N0QACgkQaXyZsatIp33h sAf/Q6HZAk1BL421I8/J+Ou5ieh6Da1c79YXfNjeqiYXhS7ej3gwTMdO7ry0IQ1N nUkXjOlrq/891TeClW+jBzP6KrDK4/BVhGI/C+OSE1IP2W9bw6ILuu2CFphnFpoF u9M21Yk9jNm/OO2SacyvN0rc+H/VP2WQJwo2HulurwF7nB7O6KQ6hFqUsfypWeL0 JRD6jo+FPaPIEpMd/oHXCTtCawjJptDh1RfKiJzorGPlGlt/y9yQ7Uc41Lk0yqYk giezrSAIqd92BSsbF8s3W3WutsZKwdvuYaXhfXUsy2RRWh+7LMozNDbL1efLs+Nb Qvq7ICrMEKxthhNkTbWG5VjEUw== =NEIg -----END PGP SIGNATURE----- --o7jqzcpec2h552fp-- From owner-svn-src-all@freebsd.org Thu Aug 16 18:26: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 135ED1071EDC; Thu, 16 Aug 2018 18:26:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA39471919; Thu, 16 Aug 2018 18:26:43 +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 9B0F21D1AC; Thu, 16 Aug 2018 18:26:43 +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 w7GIQh14039807; Thu, 16 Aug 2018 18:26:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GIQhfQ039806; Thu, 16 Aug 2018 18:26:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808161826.w7GIQhfQ039806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Aug 2018 18:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337917 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 337917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:26:44 -0000 Author: kevans Date: Thu Aug 16 18:26:43 2018 New Revision: 337917 URL: https://svnweb.freebsd.org/changeset/base/337917 Log: bectl(8): Implement the 'create a snapshot' variant of create Modified: head/sbin/bectl/bectl.c Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Thu Aug 16 17:59:49 2018 (r337916) +++ head/sbin/bectl/bectl.c Thu Aug 16 18:26:43 2018 (r337917) @@ -182,15 +182,19 @@ bectl_cmd_activate(int argc, char *argv[]) static int bectl_cmd_create(int argc, char *argv[]) { - char *bootenv, *snapname, *source; + char *atpos, *bootenv, *snapname, *source; int err, opt; + bool recursive; snapname = NULL; - while ((opt = getopt(argc, argv, "e:")) != -1) { + recursive = false; + while ((opt = getopt(argc, argv, "re:")) != -1) { switch (opt) { case 'e': snapname = optarg; break; + case 'r': + recursive = true; default: fprintf(stderr, "bectl create: unknown option '-%c'\n", optopt); @@ -207,8 +211,14 @@ bectl_cmd_create(int argc, char *argv[]) } bootenv = *argv; - - if (snapname != NULL) { + if ((atpos = strchr(bootenv, '@')) != NULL) { + /* + * This is the "create a snapshot variant". No new boot + * environment is to be created here. + */ + *atpos++ = '\0'; + err = be_snapshot(be, bootenv, atpos, recursive, NULL); + } else if (snapname != NULL) { if (strchr(snapname, '@') != NULL) err = be_create_from_existing_snap(be, bootenv, snapname); @@ -232,7 +242,11 @@ bectl_cmd_create(int argc, char *argv[]) case BE_ERR_SUCCESS: break; default: - if (snapname == NULL) + if (atpos != NULL) + fprintf(stderr, + "failed to create a snapshot '%s' of '%s'\n", + atpos, bootenv); + else if (snapname == NULL) fprintf(stderr, "failed to create bootenv %s\n", bootenv); else From owner-svn-src-all@freebsd.org Thu Aug 16 18:27: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 57DE31071F88; Thu, 16 Aug 2018 18:27:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA9D71A93; Thu, 16 Aug 2018 18:27:44 +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 E2E401D1BF; Thu, 16 Aug 2018 18:27:43 +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 w7GIRh0s039896; Thu, 16 Aug 2018 18:27:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GIRhCb039895; Thu, 16 Aug 2018 18:27:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808161827.w7GIRhCb039895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Aug 2018 18:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337918 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 337918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:27:44 -0000 Author: kevans Date: Thu Aug 16 18:27:43 2018 New Revision: 337918 URL: https://svnweb.freebsd.org/changeset/base/337918 Log: bectl(8): Kit-kat bar Modified: head/sbin/bectl/bectl.c Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Thu Aug 16 18:26:43 2018 (r337917) +++ head/sbin/bectl/bectl.c Thu Aug 16 18:27:43 2018 (r337918) @@ -188,13 +188,14 @@ bectl_cmd_create(int argc, char *argv[]) snapname = NULL; recursive = false; - while ((opt = getopt(argc, argv, "re:")) != -1) { + while ((opt = getopt(argc, argv, "e:r")) != -1) { switch (opt) { case 'e': snapname = optarg; break; case 'r': recursive = true; + break; default: fprintf(stderr, "bectl create: unknown option '-%c'\n", optopt); From owner-svn-src-all@freebsd.org Thu Aug 16 18:30: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 0461C10721DD; Thu, 16 Aug 2018 18:30:51 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE9DC71D96; Thu, 16 Aug 2018 18:30:50 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FCE61D2DD; Thu, 16 Aug 2018 18:30:50 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GIUo6T040826; Thu, 16 Aug 2018 18:30:50 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GIUnB7040823; Thu, 16 Aug 2018 18:30:49 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808161830.w7GIUnB7040823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 16 Aug 2018 18:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337919 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 337919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:30:51 -0000 Author: jamie Date: Thu Aug 16 18:30:49 2018 New Revision: 337919 URL: https://svnweb.freebsd.org/changeset/base/337919 Log: security.jail.enforce_statfs is handled by jail_set(2), so handling it in userspace jail(8) is redundant. Differential Revision: D14791 Modified: head/usr.sbin/jail/config.c head/usr.sbin/jail/jail.c head/usr.sbin/jail/jailp.h Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Thu Aug 16 18:27:43 2018 (r337918) +++ head/usr.sbin/jail/config.c Thu Aug 16 18:30:49 2018 (r337919) @@ -106,7 +106,6 @@ static const struct ipspec intparams[] = { [KP_ALLOW_SOCKET_AF] = {"allow.socket_af", 0}, [KP_ALLOW_SYSVIPC] = {"allow.sysvipc", 0}, [KP_DEVFS_RULESET] = {"devfs_ruleset", 0}, - [KP_ENFORCE_STATFS] = {"enforce_statfs", 0}, [KP_HOST_HOSTNAME] = {"host.hostname", 0}, #ifdef INET [KP_IP4_ADDR] = {"ip4.addr", 0}, Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Thu Aug 16 18:27:43 2018 (r337918) +++ head/usr.sbin/jail/jail.c Thu Aug 16 18:30:49 2018 (r337919) @@ -138,7 +138,6 @@ main(int argc, char **argv) unsigned op, pi; int ch, docf, error, i, oldcl, sysval; int dflag, Rflag; - char enforce_statfs[4]; #if defined(INET) || defined(INET6) char *cs, *ncs; #endif @@ -275,14 +274,6 @@ main(int argc, char **argv) (sysval ? 1 : 0) ^ perm_sysctl[pi].rev ? NULL : "false"); - } - sysvallen = sizeof(sysval); - if (sysctlbyname("security.jail.enforce_statfs", - &sysval, &sysvallen, NULL, 0) == 0) { - snprintf(enforce_statfs, - sizeof(enforce_statfs), "%d", sysval); - add_param(NULL, NULL, KP_ENFORCE_STATFS, - enforce_statfs); } } } else if (op == JF_STOP) { Modified: head/usr.sbin/jail/jailp.h ============================================================================== --- head/usr.sbin/jail/jailp.h Thu Aug 16 18:27:43 2018 (r337918) +++ head/usr.sbin/jail/jailp.h Thu Aug 16 18:30:49 2018 (r337919) @@ -120,7 +120,6 @@ enum intparam { KP_ALLOW_SOCKET_AF, KP_ALLOW_SYSVIPC, KP_DEVFS_RULESET, - KP_ENFORCE_STATFS, KP_HOST_HOSTNAME, #ifdef INET KP_IP4_ADDR, From owner-svn-src-all@freebsd.org Thu Aug 16 18:35: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 29E53107246E; Thu, 16 Aug 2018 18:35:01 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (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 803647223B; Thu, 16 Aug 2018 18:35:00 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-x143.google.com with SMTP id l16-v6so4105399lfc.13; Thu, 16 Aug 2018 11:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Uedel5gr/DP1qKFM3FvlFqr1swpDrElh8Wg4G6o2zZo=; b=LtG1Wva5BtR7AnG405DFF96IPwFkpwYAhcqQKhywMHzuioLCCj3hZE4WHcfvbjrqSs 2AfXBZGCKhMkL45cw+i8h5PQW9/uY+lCRnMmRhmCw0p9sByOwyeZ+9U8T2VRitKvXVb/ yXIwRlyrVrqzXTLwe1zg/0ZQgT/UsWEXTFjACVGaleHfGMhN+WsHOLv+T8wayflSnPbx qWEgl5dLmUHRc8262B1BW3PkP0riAyiA4X0ehrGrkVuo/uvgkv7gI2k5Ib0Qagqupdia +OXDSrblAnqFJhOfzarbu5SGOpwQ4nHs/gagysc4DQDYNbZqBIyR+cW5yt39+Tij6gWi REow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Uedel5gr/DP1qKFM3FvlFqr1swpDrElh8Wg4G6o2zZo=; b=rsyLkcfDuIGOEiGyQS3A8aQz5/a4+yobRkjRHZQ7F8/2fDGfbs/yZNqwvz584uJQhu +h2QQDwDaaDoQn/KlbY4n9bKjlb0zjnJ1iVdydOJvCzev7ni+k+JwNyiER9Ruk9Xqvl4 JSvQ/qpF7qpcDg2HnZNTKmMjZWbMDiiWWlTVRS4DvnzQcLvFlviFByjnTLDK2uIAVrMj XcKffkOy2Ggg1jCK1/OQ1FqKJd/vOafgTJG7HZL0hAnUE3PIUk6os2EmuTxmXKd7NCC7 Fxfz2OudvZLsDQz/XUxmbbt0xT6IQ3+/ferfGCwFXJ2rKXDkeUiYZ0GEgnwysbCVh1Vy Vs/g== X-Gm-Message-State: AOUpUlEGfQavbsY6IYEh89k7AXdcS3sc8mY95xP1q6wLF0MGjfcErHOq Cin7sNjW+f6Bmn7dxG1OwPCC9vOAppbbQb/vuNl2P1zh X-Google-Smtp-Source: AA+uWPx+veKkyxr9lU5GjuqvQt2urOQZUV8/FkAOK8OGbnWwTUGX8zVtYlr4iVe03ZrIZPIcP4Zhe3fbhkAcTwga/Ws= X-Received: by 2002:a19:1366:: with SMTP id j99-v6mr21118738lfi.21.1534444498867; Thu, 16 Aug 2018 11:34:58 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 2002:ab3:7851:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 11:34:58 -0700 (PDT) In-Reply-To: <201808140754.w7E7sEFs018313@repo.freebsd.org> References: <201808140754.w7E7sEFs018313@repo.freebsd.org> From: Alan Somers Date: Thu, 16 Aug 2018 12:34:58 -0600 X-Google-Sender-Auth: QEpJIPzogrkHvGfzKQtwZxQgyAA Message-ID: Subject: Re: svn commit: r337736 - in head/sys: netinet netinet6 To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:35:01 -0000 On Tue, Aug 14, 2018 at 1:54 AM, Andrey V. Elsukov wrote: > Author: ae > Date: Tue Aug 14 07:54:14 2018 > New Revision: 337736 > URL: https://svnweb.freebsd.org/changeset/base/337736 > > Log: > Restore ability to send ICMP and ICMPv6 redirects. > > It was lost when tryforward appeared. Now ip[6]_tryforward will be > enabled > only when sending redirects for corresponding IP version is disabled via > sysctl. Otherwise will be used default forwarding function. > > PR: 221137 > Submitted by: mckay@ > MFC after: 2 weeks > > Modified: > head/sys/netinet/ip_input.c > head/sys/netinet6/ip6_input.c > This change broke the sys/netipsec/tunnel tests. I don't know if it's a limitation of the tests, or a genuine kernel bug, but I bisected the regression down to this change. Can you please fix it? https://ci.freebsd.org/job/FreeBSD-head-amd64-test/8630/testReport/sys.netipsec.tunnel/empty/v4/ From owner-svn-src-all@freebsd.org Thu Aug 16 18:35: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 EA2BA1072497; Thu, 16 Aug 2018 18:35:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B40A72330; Thu, 16 Aug 2018 18:35:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 4D7B875C8; Thu, 16 Aug 2018 18:35:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1779A1098; Thu, 16 Aug 2018 18:35:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id lzNIWm2zpsqY; Thu, 16 Aug 2018 18:35:03 +0000 (UTC) Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 18C671088 To: Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8FAlJp hmsCGwwFCQlmAYAACgkQNddxu25Gl89UPggA2mGQp28yCUKsJ6KHFVy/lpHfoQrKF+s7HfKT U2ObVeVNX4I8ZdW1UO48mRqxEOwY8r5YSH6X06OmiqCX2aSMXg3N06/l+ztlB0+UGGlkXBjv l9/nii+bC6b8XWuu0X7Qpb9oYBK9YtoaoyuVplAmjdj/cPou65meKIaS1yDTjHh450DrW8Qg he6l0bFX4BHKTSm99U90ML7EY19B6iI2BZSqWutVsyD71oAREY6NGgDpCOIO6FS41+WeYCDR j8vsa/BiaoX2d2SBDsCwsEwe9fg5PYMi2uVIhvL6OrxnwOdB+TkgvOy5zZSNO29UG/JilZKo Ndz2wpEaUzChGGqLvcLAZQQYAQoADwIbDAUCWujOKAUJCmB7PQAKCRA113G7bkaXz6bkB/9H dUR3E0wBwMh6z0AOFDKh+PbRI9Xd4IncdhE55tNK410650a3gADIDwqz3i72GIinkgaxzpEO xP1bs7a+BeF3p5Xd6Jjk6J/nEshisgNW7VjUbJHFGs8Sf9A6oM3q4VkI/ArVo5qkZxgKs72U HSAy5NV+AdqdTrWuAL20xfQ6gA7JF35Xf8zyUM2GMl0X8ik7dJ1jMp+TB27LipqbDgamFzH9 F9hC9gur94OQ/x3nQ+mFZ1uipYHA1EdrKuhb/Ts4bN/Ezl8nmYGxc9Bw7ZBxGOTId/rEIzoe LWpAvg6dcw0T9lNfSWc6PX+kf3dOXNIdkw9NqKID8wEPe8axcGYG Organization: FreeBSD Message-ID: <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> Date: Thu, 16 Aug 2018 11:34:59 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180816182115.mqxkpzgifomjodwl@ler-imac.local> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="un7Qo2igC3Wvd3NZZoa3FHX897Dl5Jqck" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:35:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --un7Qo2igC3Wvd3NZZoa3FHX897Dl5Jqck Content-Type: multipart/mixed; boundary="L9joS7NVAqOhTZPpt9ONP6wvGPuAFYXK2"; protected-headers="v1" From: Bryan Drewery To: Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> In-Reply-To: <20180816182115.mqxkpzgifomjodwl@ler-imac.local> --L9joS7NVAqOhTZPpt9ONP6wvGPuAFYXK2 Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/16/18 11:21 AM, Larry Rosenman wrote: > On Thu, Aug 16, 2018 at 02:02:52PM -0400, Jung-uk Kim wrote: >> On 18. 8. 16., Larry Rosenman wrote: >>> On Thu, Aug 16, 2018 at 01:48:40PM -0400, Jung-uk Kim wrote: >>>> On 18. 8. 16., Ravi Pokala wrote: >>>>> -----Original Message----- >>>>> From: on behalf of Jung-uk Kim <= jkim@FreeBSD.org> >>>>> Date: 2018-08-14, Tuesday at 10:48 >>>>> To: , , >>>>> Subject: svn commit: r337791 - in head: crypto/openssl crypto/opens= sl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/c= rypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... >>>>> >>>>>> Author: jkim >>>>>> Date: Tue Aug 14 17:48:02 2018 >>>>>> New Revision: 337791 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/337791 >>>>>> >>>>>> Log: >>>>>> Merge OpenSSL 1.0.2p. >>>>> >>>>> Is it just me, or did this change break all the worlds? >>>>> >>>>> I got errors like this: >>>>> >>>>> ---------------------------------------------------------------- >>>>> /usr/bin/ld: error: undefined symbol: main >>>>>>>> referenced by crt1.c:74 (/usr/home/rpokala/freebsd/clean/base/he= ad/lib/csu/amd64/crt1.c:74) >>>>>>>> /build/usr/home/rpokala/freebsd/clean/base/head/am= d64.amd64/tmp/usr/lib/crt1.o:(_start) >>>>> >>>>> /usr/bin/ld: error: undefined symbol: Fssh_error >>>>>>>> referenced by moduli.c:257 (/usr/home/rpokala/freebsd/clean/base= /head/crypto/openssh/moduli.c:257) >>>>>>>> /tmp/moduli-6780ab.o:(Fssh_gen_candidates) >>>>> ---------------------------------------------------------------- >>>>> >>>>> At first I thought it was because I was rebuilding without cleaning= , but I nuked the tree and rebuilt from scratch, and got the same error. >>>>> >>>>> I didn't bisect it to this change, but it's the only recent change = to crypto... >>>> >>>> I built worlds many times and I haven't seen such problem. In fact,= >>>> Jenkins didn't break on amd64 after the commit. >>>> >>>> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ >>> Do you or jenkins run with meta-mode? That seems to be a necessary >>> condition for the failure. >> I don't do meta-mode. I don't know much about Jenkins build but I don= 't >> think it does. Is it a requirement now? >> Jenkins doesn't use META_MODE and it's not a requirement. > It's not a requirement, but seems to be implicated in this failure.....= >=20 > Cc'ing bdrewery@ for the meta mode stuff. >=20 >=20 >> Jung-uk Kim >> >=20 >=20 >=20 >=20 --=20 Regards, Bryan Drewery --L9joS7NVAqOhTZPpt9ONP6wvGPuAFYXK2-- --un7Qo2igC3Wvd3NZZoa3FHX897Dl5Jqck Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlt1w9MACgkQNddxu25G l8+xRwf+PknKxk8xLr0U2UTtRn71x348nzvfhTV4KTEphVAtSkaLaO4bQmoXwWDx YlLQg0UGaRAc2V1r0bhAjzinXyN9y98hZbQC+cqB2UqD4Zg5z1E2Et919Oy4JNzP o9vm0zLnXdOMwAB0ZUSpncK4L8Gvz57YXe4dfTM/DQbDN2IEE0GXR4vz56DBMBK8 BzY4oL0wvwEXYW8W/7u9nw9RSwJOFRZUyGPVkDBX2qgJBsi2N4G795VJ9HPmJvMf Z5JMSe9rT3RuxqewTEXpltaNoaADWHFtTBB0TbKCNNBDKpdACcBrNlIqnOnWIEkM Ap39EB14KyRokzrOdFp+Z1fklK/SJA== =qdd2 -----END PGP SIGNATURE----- --un7Qo2igC3Wvd3NZZoa3FHX897Dl5Jqck-- From owner-svn-src-all@freebsd.org Thu Aug 16 18:35:40 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 EC64D10724F5; Thu, 16 Aug 2018 18:35:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1FFC72478; Thu, 16 Aug 2018 18:35:39 +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 832ED1D37D; Thu, 16 Aug 2018 18:35:39 +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 w7GIZdST044795; Thu, 16 Aug 2018 18:35:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GIZdKa044794; Thu, 16 Aug 2018 18:35:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808161835.w7GIZdKa044794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 16 Aug 2018 18:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337920 - head/usr.bin/sed X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/sed X-SVN-Commit-Revision: 337920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:35:40 -0000 Author: pfg Date: Thu Aug 16 18:35:39 2018 New Revision: 337920 URL: https://svnweb.freebsd.org/changeset/base/337920 Log: Revert r337419. The fix is only partial and causes an asymmetry which breaks a test in multi_test.sh. We should consider both parts of the issue found in OpenBSD[1], but for now just revert the change. [1] http://undeadly.org/cgi?action=article;sid=20180728110010 Reported by: asomers Modified: head/usr.bin/sed/compile.c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Thu Aug 16 18:30:49 2018 (r337919) +++ head/usr.bin/sed/compile.c Thu Aug 16 18:35:39 2018 (r337920) @@ -393,11 +393,11 @@ compile_delimited(char *p, char *d, int is_tr) if ((d = compile_ccl(&p, d)) == NULL) errx(1, "%lu: %s: unbalanced brackets ([])", linenum, fname); continue; - } else if (*p == '\\' && p[1] == c) { - p++; } else if (*p == '\\' && p[1] == '[') { *d++ = *p++; - } else if (*p == '\\' && p[1] == 'n') { + } else if (*p == '\\' && p[1] == c) + p++; + else if (*p == '\\' && p[1] == 'n') { *d++ = '\n'; p += 2; continue; From owner-svn-src-all@freebsd.org Thu Aug 16 18:37: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 44F0D1072638; Thu, 16 Aug 2018 18:37:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0333726A6; Thu, 16 Aug 2018 18:37:48 +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 D1F361D380; Thu, 16 Aug 2018 18:37:48 +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 w7GIbmqP044924; Thu, 16 Aug 2018 18:37:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GIbmLi044921; Thu, 16 Aug 2018 18:37:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808161837.w7GIbmLi044921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Aug 2018 18:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337921 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 337921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:37:49 -0000 Author: kevans Date: Thu Aug 16 18:37:47 2018 New Revision: 337921 URL: https://svnweb.freebsd.org/changeset/base/337921 Log: libbe(3): Prefer safer versions of strcat/strcpy Or, in the activate case, just use snprintf since that's effectively what we're doing anyways. Modified: head/lib/libbe/be.c head/lib/libbe/be_access.c head/lib/libbe/libbe.3 Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Thu Aug 16 18:35:39 2018 (r337920) +++ head/lib/libbe/be.c Thu Aug 16 18:37:47 2018 (r337921) @@ -91,7 +91,6 @@ libbe_init(void) lbh = NULL; poolname = pos = NULL; - pnamelen = 0; rootds = NULL; /* Verify that /boot and / are mounted on the same filesystem */ @@ -138,6 +137,8 @@ libbe_init(void) strlcpy(poolname, lbh->root, pnamelen + 1); if ((lbh->active_phandle = zpool_open(lbh->lzh, poolname)) == NULL) goto err; + free(poolname); + poolname = NULL; if (zpool_get_prop(lbh->active_phandle, ZPOOL_PROP_BOOTFS, lbh->bootfs, sizeof(lbh->bootfs), NULL, true) != 0) @@ -218,7 +219,6 @@ be_destroy(libbe_handle_t *lbh, const char *name, int p = path; force = options & BE_DESTROY_FORCE; - err = BE_ERR_SUCCESS; be_root_concat(lbh, name, path); @@ -274,8 +274,12 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c return (BE_ERR_NOENT); if (snap_name != NULL) { - strcat(buf, "@"); - strcat(buf, snap_name); + if (strlcat(buf, "@", sizeof(buf)) >= sizeof(buf)) + return (set_error(lbh, BE_ERR_INVALIDNAME)); + + if (strlcat(buf, snap_name, sizeof(buf)) >= sizeof(buf)) + return (set_error(lbh, BE_ERR_INVALIDNAME)); + if (result != NULL) snprintf(result, BE_MAXPATHLEN, "%s@%s", source, snap_name); @@ -284,8 +288,9 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c len = strlen(buf); strftime(buf + len, sizeof(buf) - len, "@%F-%T", localtime(&rawtime)); - if (result != NULL) - strcpy(result, strrchr(buf, '/') + 1); + if (result != NULL && strlcpy(result, strrchr(buf, '/') + 1, + sizeof(buf)) >= sizeof(buf)) + return (set_error(lbh, BE_ERR_INVALIDNAME)); } if ((err = zfs_snapshot(lbh->lzh, buf, recursive, NULL)) != 0) { @@ -942,9 +947,7 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, return (set_error(lbh, BE_ERR_UNKNOWN)); /* Expected format according to zfsbootcfg(8) man */ - strcpy(buf, "zfs:"); - strcat(buf, be_path); - strcat(buf, ":"); + snprintf(buf, sizeof(buf), "zfs:%s:", be_path); /* We have no config tree */ if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Thu Aug 16 18:35:39 2018 (r337920) +++ head/lib/libbe/be_access.c Thu Aug 16 18:37:47 2018 (r337921) @@ -124,7 +124,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou /* Create mountpoint if it is not specified */ if (mountpoint == NULL) { - strcpy(mnt_temp, "/tmp/be_mount.XXXX"); + strlcpy(mnt_temp, "/tmp/be_mount.XXXX", sizeof(mnt_temp)); if (mkdtemp(mnt_temp) == NULL) return (set_error(lbh, BE_ERR_IO)); } @@ -149,7 +149,8 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou } if (result_loc != NULL) - strcpy(result_loc, mountpoint == NULL ? mnt_temp : mountpoint); + strlcpy(result_loc, mountpoint == NULL ? mnt_temp : mountpoint, + BE_MAXPATHLEN); return (BE_ERR_SUCCESS); } Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Thu Aug 16 18:35:39 2018 (r337920) +++ head/lib/libbe/libbe.3 Thu Aug 16 18:37:47 2018 (r337921) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 12, 2018 +.Dd August 16, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -267,6 +267,9 @@ If .Fa result is not .Dv NULL , +it should be large enough to accommodate +.Dv BE_MAXPATHLEN +including the null terminator. the final mount point will be copied into it. Setting the .Dv BE_MNT_FORCE From owner-svn-src-all@freebsd.org Thu Aug 16 18:40: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 9C9321072747; Thu, 16 Aug 2018 18:40:22 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D15072881; Thu, 16 Aug 2018 18:40:22 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29D291D385; Thu, 16 Aug 2018 18:40:22 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GIeMG9045118; Thu, 16 Aug 2018 18:40:22 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GIeHGl045096; Thu, 16 Aug 2018 18:40:17 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808161840.w7GIeHGl045096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 16 Aug 2018 18:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337922 - in head: lib/libc/gen lib/libc/sys share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/freebsd32 sys/fs/nandfs sys/kern sys/sys sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: in head: lib/libc/gen lib/libc/sys share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/freebsd32 sys/fs/nandfs sys/kern sys/sys sys/ufs/ufs X-SVN-Commit-Revision: 337922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:40:23 -0000 Author: jamie Date: Thu Aug 16 18:40:16 2018 New Revision: 337922 URL: https://svnweb.freebsd.org/changeset/base/337922 Log: Put jail(2) under COMPAT_FREEBSD11. It has been the "old" way of creating jails since FreeBSD 7. Along with the system call, put the various security.jail.allow_foo and security.jail.foo_allowed sysctls partly under COMPAT_FREEBSD11 (or BURN_BRIDGES). These sysctls had two disparate uses: on the system side, they were global permissions for jails created via jail(2) which lacked fine-grained permission controls; inside a jail, they're read-only descriptions of what the current jail is allowed to do. The first use is obsolete along with jail(2), but keep them for the second-read-only use. Differential Revision: D14791 Modified: head/lib/libc/gen/getvfsbyname.3 head/lib/libc/sys/jail.2 head/share/man/man9/VFS_SET.9 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/compat/freebsd32/syscalls.master head/sys/fs/nandfs/nandfs_vnops.c head/sys/kern/init_sysent.c head/sys/kern/kern_jail.c head/sys/kern/syscalls.c head/sys/kern/syscalls.master head/sys/kern/systrace_args.c head/sys/sys/jail.h head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/syscallsubr.h head/sys/sys/sysproto.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/lib/libc/gen/getvfsbyname.3 ============================================================================== --- head/lib/libc/gen/getvfsbyname.3 Thu Aug 16 18:37:47 2018 (r337921) +++ head/lib/libc/gen/getvfsbyname.3 Thu Aug 16 18:40:16 2018 (r337922) @@ -28,7 +28,7 @@ .\" @(#)kvm_getvfsbyname.3 8.3 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd August 30, 2016 +.Dd August 16, 2018 .Dt GETVFSBYNAME 3 .Os .Sh NAME @@ -83,9 +83,10 @@ aliases some other mounted FS stores file names as Unicode .It Dv VFCF_JAIL can be mounted from within a jail if -.Va security.jail.mount_allowed -sysctl is set to -.Dv 1 +.Va allow.mount +and +.Va allow.mount. +jail parameters are set .It Dv VFCF_DELEGADMIN supports delegated administration if .Va vfs.usermount Modified: head/lib/libc/sys/jail.2 ============================================================================== --- head/lib/libc/sys/jail.2 Thu Aug 16 18:37:47 2018 (r337921) +++ head/lib/libc/sys/jail.2 Thu Aug 16 18:40:16 2018 (r337922) @@ -25,11 +25,10 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd August 16, 2018 .Dt JAIL 2 .Os .Sh NAME -.Nm jail , .Nm jail_get , .Nm jail_set , .Nm jail_remove , @@ -41,8 +40,6 @@ .In sys/param.h .In sys/jail.h .Ft int -.Fn jail "struct jail *jail" -.Ft int .Fn jail_attach "int jid" .Ft int .Fn jail_remove "int jid" @@ -53,74 +50,7 @@ .Fn jail_set "struct iovec *iov" "u_int niov" "int flags" .Sh DESCRIPTION The -.Fn jail -system call sets up a jail and locks the current process in it. -.Pp -The argument is a pointer to a structure describing the prison: -.Bd -literal -offset indent -struct jail { - uint32_t version; - char *path; - char *hostname; - char *jailname; - unsigned int ip4s; - unsigned int ip6s; - struct in_addr *ip4; - struct in6_addr *ip6; -}; -.Ed -.Pp -.Dq Li version -defines the version of the API in use. -.Dv JAIL_API_VERSION -is defined for the current version. -.Pp -The -.Dq Li path -pointer should be set to the directory which is to be the root of the -prison. -.Pp -The -.Dq Li hostname -pointer can be set to the hostname of the prison. -This can be changed -from the inside of the prison. -.Pp -The -.Dq Li jailname -pointer is an optional name that can be assigned to the jail -for example for management purposes. -.Pp -The -.Dq Li ip4s -and -.Dq Li ip6s -give the numbers of IPv4 and IPv6 addresses that will be passed -via their respective pointers. -.Pp -The -.Dq Li ip4 -and -.Dq Li ip6 -pointers can be set to an arrays of IPv4 and IPv6 addresses to be assigned to -the prison, or NULL if none. -IPv4 addresses must be in network byte order. -.Pp -This is equivalent to, and deprecated in favor of, the .Fn jail_set -system call (see below), with the parameters -.Va path , -.Va host.hostname , -.Va name , -.Va ip4.addr , -and -.Va ip6.addr , -and with the -.Dv JAIL_ATTACH -flag. -.Pp -The -.Fn jail_set system call creates a new jail, or modifies an existing one, and optionally locks the current process in it. Jail parameters are passed as an array of name-value pairs in the array @@ -146,13 +76,19 @@ The current set of available parameters, and their for retrieved via the .Va security.jail.param sysctl MIB entry. -Notable parameters include those mentioned in the -.Fn jail -description above, as well as +Notable parameters include .Va jid and -.Va name , -which identify the jail being created or modified. +.Va name +which identify the jail being created or modified, +.Va path +(the root directory of the jail), +.Va host.hostname +(the hostname of the jail), and +.Va ip4.addr +and +.Va ip6.addr +(IP addresses to assign to the jail). See .Xr jail 8 for more information on the core jail parameters. @@ -237,8 +173,7 @@ It will kill all processes belonging to the jail, and of that jail. .Sh RETURN VALUES If successful, -.Fn jail , -.Fn jail_set , +.Fn jail_set and .Fn jail_get return a non-negative integer, termed the jail identifier (JID). @@ -249,25 +184,6 @@ to indicate the error. .Rv -std jail_attach jail_remove .Sh ERRORS The -.Fn jail -system call -will fail if: -.Bl -tag -width Er -.It Bq Er EPERM -This process is not allowed to create a jail, either because it is not -the super-user, or because it would exceed the jail's -.Va children.max -limit. -.It Bq Er EFAULT -.Fa jail -points to an address outside the allocated address space of the process. -.It Bq Er EINVAL -The version number of the argument is not correct. -.It Bq Er EAGAIN -No free JID could be found. -.El -.Pp -The .Fn jail_set system call will fail if: @@ -371,8 +287,7 @@ does not exist. .El .Pp Further -.Fn jail , -.Fn jail_set , +.Fn jail_set and .Fn jail_attach call @@ -386,7 +301,7 @@ manual page for details. .Xr chroot 2 , .Xr jail 8 .Sh HISTORY -The +The now-deprecated .Fn jail system call appeared in .Fx 4.0 . Modified: head/share/man/man9/VFS_SET.9 ============================================================================== --- head/share/man/man9/VFS_SET.9 Thu Aug 16 18:37:47 2018 (r337921) +++ head/share/man/man9/VFS_SET.9 Thu Aug 16 18:40:16 2018 (r337922) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2013 +.Dd August 16, 2018 .Dt VFS_SET 9 .Os .Sh NAME @@ -72,9 +72,10 @@ Loopback file system layer. File names are stored as Unicode. .It Dv VFCF_JAIL Can be mounted from within a jail if -.Va security.jail.mount_allowed -sysctl is set to -.Dv 1 . +.Va allow.mount +and +.Va allow.mount. +jail parameters are set. .It Dv VFCF_DELEGADMIN Supports delegated administration if .Va vfs.usermount Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Aug 16 18:40:16 2018 (r337922) @@ -5195,9 +5195,8 @@ zfs_freebsd_setattr(ap) * Privileged non-jail processes may not modify system flags * if securelevel > 0 and any existing system flags are set. * Privileged jail processes behave like privileged non-jail - * processes if the security.jail.chflags_allowed sysctl is - * is non-zero; otherwise, they behave like unprivileged - * processes. + * processes if the PR_ALLOW_CHFLAGS permission bit is set; + * otherwise, they behave like unprivileged processes. */ if (secpolicy_fs_owner(vp->v_mount, cred) == 0 || priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0) == 0) { Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 18:40:16 2018 (r337922) @@ -2289,8 +2289,10 @@ freebsd32_sysctl(struct thread *td, struct freebsd32_s return (0); } +#ifdef COMPAT_FREEBSD11 int -freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) +freebsd11_freebsd32_jail(struct thread *td, + struct freebsd11_freebsd32_jail_args *uap) { uint32_t version; int error; @@ -2347,8 +2349,9 @@ freebsd32_jail(struct thread *td, struct freebsd32_jai /* Sci-Fi jails are not supported, sorry. */ return (EINVAL); } - return (kern_jail(td, &j)); + return (freebsd11_kern_jail(td, &j)); } +#endif /* COMPAT_FREEBSD11 */ int freebsd32_jail_set(struct thread *td, struct freebsd32_jail_set_args *uap) Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 18:40:16 2018 (r337922) @@ -283,9 +283,6 @@ struct freebsd32_sched_rr_get_interval_args { char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; char interval_l_[PADL_(struct timespec32 *)]; struct timespec32 * interval; char interval_r_[PADR_(struct timespec32 *)]; }; -struct freebsd32_jail_args { - char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char jail_r_[PADR_(struct jail32 *)]; -}; struct freebsd32_sigtimedwait_args { char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; @@ -761,7 +758,6 @@ int freebsd32_aio_return(struct thread *, struct freeb int freebsd32_aio_suspend(struct thread *, struct freebsd32_aio_suspend_args *); int freebsd32_aio_error(struct thread *, struct freebsd32_aio_error_args *); int freebsd32_sched_rr_get_interval(struct thread *, struct freebsd32_sched_rr_get_interval_args *); -int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); int freebsd32_sigtimedwait(struct thread *, struct freebsd32_sigtimedwait_args *); int freebsd32_sigwaitinfo(struct thread *, struct freebsd32_sigwaitinfo_args *); int freebsd32_aio_waitcomplete(struct thread *, struct freebsd32_aio_waitcomplete_args *); @@ -1184,6 +1180,9 @@ struct freebsd11_freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * sb; char sb_r_[PADR_(struct freebsd11_stat32 *)]; }; +struct freebsd11_freebsd32_jail_args { + char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char jail_r_[PADR_(struct jail32 *)]; +}; struct freebsd11_freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32_freebsd11 *)]; const struct kevent32_freebsd11 * changelist; char changelist_r_[PADR_(const struct kevent32_freebsd11 *)]; @@ -1223,6 +1222,7 @@ int freebsd11_freebsd32_lstat(struct thread *, struct int freebsd11_freebsd32_getdirentries(struct thread *, struct freebsd11_freebsd32_getdirentries_args *); int freebsd11_freebsd32_getdents(struct thread *, struct freebsd11_freebsd32_getdents_args *); int freebsd11_freebsd32_fhstat(struct thread *, struct freebsd11_freebsd32_fhstat_args *); +int freebsd11_freebsd32_jail(struct thread *, struct freebsd11_freebsd32_jail_args *); int freebsd11_freebsd32_kevent(struct thread *, struct freebsd11_freebsd32_kevent_args *); int freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fstatat_args *); int freebsd11_freebsd32_mknodat(struct thread *, struct freebsd11_freebsd32_mknodat_args *); @@ -1317,7 +1317,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_LIO_LISTIO #define FREEBSD32_SYS_AUE_freebsd32_sched_rr_get_interval AUE_NULL #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE -#define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL +#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_jail AUE_JAIL #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 18:40:16 2018 (r337922) @@ -275,7 +275,7 @@ #define FREEBSD32_SYS_utrace 335 /* 336 is freebsd4 freebsd32_sendfile */ #define FREEBSD32_SYS_kldsym 337 -#define FREEBSD32_SYS_freebsd32_jail 338 +#define FREEBSD32_SYS_freebsd11_freebsd32_jail 338 #define FREEBSD32_SYS_sigprocmask 340 #define FREEBSD32_SYS_sigsuspend 341 /* 342 is freebsd4 freebsd32_sigaction */ Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 18:40:16 2018 (r337922) @@ -347,7 +347,7 @@ const char *freebsd32_syscallnames[] = { "utrace", /* 335 = utrace */ "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile */ "kldsym", /* 337 = kldsym */ - "freebsd32_jail", /* 338 = freebsd32_jail */ + "compat11.freebsd32_jail", /* 338 = freebsd11 freebsd32_jail */ "#339", /* 339 = pioctl */ "sigprocmask", /* 340 = sigprocmask */ "sigsuspend", /* 341 = sigsuspend */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 18:40:16 2018 (r337922) @@ -394,7 +394,7 @@ struct sysent freebsd32_sysent[] = { { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 freebsd32_sendfile */ { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ - { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd32_jail */ + { compat11(AS(freebsd11_freebsd32_jail_args),freebsd32_jail), AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 freebsd32_jail */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = pioctl */ { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = sigprocmask */ { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 18:40:16 2018 (r337922) @@ -1559,13 +1559,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* freebsd32_jail */ - case 338: { - struct freebsd32_jail_args *p = params; - uarg[0] = (intptr_t) p->jail; /* struct jail32 * */ - *n_args = 1; - break; - } /* sigprocmask */ case 340: { struct sigprocmask_args *p = params; @@ -5711,16 +5704,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* freebsd32_jail */ - case 338: - switch(ndx) { - case 0: - p = "userland struct jail32 *"; - break; - default: - break; - }; - break; /* sigprocmask */ case 340: switch(ndx) { @@ -9670,11 +9653,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* kldsym */ case 337: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* freebsd32_jail */ - case 338: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 16 18:40:16 2018 (r337922) @@ -601,7 +601,7 @@ off_t *sbytes, int flags); } 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ void *data); } -338 AUE_JAIL STD { int freebsd32_jail(struct jail32 *jail); } +338 AUE_JAIL COMPAT11 { int freebsd32_jail(struct jail32 *jail); } 339 AUE_NULL UNIMPL pioctl 340 AUE_SIGPROCMASK NOPROTO { int sigprocmask(int how, \ const sigset_t *set, sigset_t *oset); } Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/fs/nandfs/nandfs_vnops.c Thu Aug 16 18:40:16 2018 (r337922) @@ -834,9 +834,8 @@ nandfs_setattr(struct vop_setattr_args *ap) * Privileged non-jail processes may not modify system flags * if securelevel > 0 and any existing system flags are set. * Privileged jail processes behave like privileged non-jail - * processes if the security.jail.chflags_allowed sysctl is - * is non-zero; otherwise, they behave like unprivileged - * processes. + * processes if the PR_ALLOW_CHFLAGS permission bit is set; + * otherwise, they behave like unprivileged processes. */ flags = inode->i_flags; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/kern/init_sysent.c Thu Aug 16 18:40:16 2018 (r337922) @@ -387,7 +387,7 @@ struct sysent sysent[] = { { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ - { AS(jail_args), (sy_call_t *)sys_jail, AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = jail */ + { compat11(AS(freebsd11_jail_args),jail), AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 jail */ { AS(nnpfs_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = sigprocmask */ { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/kern/kern_jail.c Thu Aug 16 18:40:16 2018 (r337922) @@ -74,6 +74,14 @@ __FBSDID("$FreeBSD$"); #include +/* + * The old jail(2) interface will exist under COMPAT_FREEBSD11, but the global + * permission sysctls are slated to go away sometime (even with COMPAT). + */ +#if defined(COMPAT_FREEBSD11) && !defined(BURN_BRIDGES) +#define PR_GLOBAL_ALLOW +#endif + #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); @@ -199,9 +207,11 @@ const size_t pr_flag_allow_size = sizeof(pr_flag_allow #define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | PR_ALLOW_RESERVED_PORTS) #define JAIL_DEFAULT_ENFORCE_STATFS 2 #define JAIL_DEFAULT_DEVFS_RSNUM 0 +#ifdef PR_GLOBAL_ALLOW static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; +#endif #if defined(INET) || defined(INET6) static unsigned jail_max_af_ips = 255; #endif @@ -219,13 +229,14 @@ prison0_init(void) strlcpy(prison0.pr_osrelease, osrelease, sizeof(prison0.pr_osrelease)); } +#ifdef COMPAT_FREEBSD11 /* * struct jail_args { * struct jail *jail; * }; */ int -sys_jail(struct thread *td, struct jail_args *uap) +freebsd11_jail(struct thread *td, struct freebsd11_jail_args *uap) { uint32_t version; int error; @@ -270,13 +281,16 @@ sys_jail(struct thread *td, struct jail_args *uap) /* Sci-Fi jails are not supported, sorry. */ return (EINVAL); } - return (kern_jail(td, &j)); + return (freebsd11_kern_jail(td, &j)); } int -kern_jail(struct thread *td, struct jail *j) +freebsd11_kern_jail(struct thread *td, struct jail *j) { - struct iovec optiov[2 * (4 + nitems(pr_flag_allow) + struct iovec optiov[2 * (3 +#ifdef PR_GLOBAL_ALLOW + + 1 + nitems(pr_flag_allow) +#endif #ifdef INET + 1 #endif @@ -286,7 +300,10 @@ kern_jail(struct thread *td, struct jail *j) )]; struct uio opt; char *u_path, *u_hostname, *u_name; +#ifdef PR_GLOBAL_ALLOW struct bool_flags *bf; + int enforce_statfs; +#endif #ifdef INET uint32_t ip4s; struct in_addr *u_ip4; @@ -295,7 +312,7 @@ kern_jail(struct thread *td, struct jail *j) struct in6_addr *u_ip6; #endif size_t tmplen; - int error, enforce_statfs; + int error; bzero(&optiov, sizeof(optiov)); opt.uio_iov = optiov; @@ -306,6 +323,7 @@ kern_jail(struct thread *td, struct jail *j) opt.uio_rw = UIO_READ; opt.uio_td = td; +#ifdef PR_GLOBAL_ALLOW /* Set permissions for top-level jails from sysctls. */ if (!jailed(td->td_ucred)) { for (bf = pr_flag_allow; @@ -327,6 +345,7 @@ kern_jail(struct thread *td, struct jail *j) optiov[opt.uio_iovcnt].iov_len = sizeof(enforce_statfs); opt.uio_iovcnt++; } +#endif tmplen = MAXPATHLEN + MAXHOSTNAMELEN + MAXHOSTNAMELEN; #ifdef INET @@ -430,6 +449,7 @@ kern_jail(struct thread *td, struct jail *j) free(u_path, M_TEMP); return (error); } +#endif /* COMPAT_FREEBSD11 */ /* @@ -1247,7 +1267,11 @@ kern_jail_set(struct thread *td, struct uio *optuio, i pr->pr_securelevel = ppr->pr_securelevel; pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; +#ifdef PR_GLOBAL_ALLOW pr->pr_enforce_statfs = jail_default_enforce_statfs; +#else + pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; +#endif pr->pr_devfs_rsnum = ppr->pr_devfs_rsnum; pr->pr_osreldate = osreldt ? osreldt : ppr->pr_osreldate; @@ -3415,6 +3439,7 @@ prison_path(struct prison *pr1, struct prison *pr2) static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW, 0, "Jails"); +#ifdef COMPAT_FREEBSD11 static int sysctl_jail_list(SYSCTL_HANDLER_ARGS) { @@ -3518,6 +3543,7 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) SYSCTL_OID(_security_jail, OID_AUTO, list, CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_list, "S", "List of active jails"); +#endif /* COMPAT_FREEBSD11 */ static int sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) @@ -3557,13 +3583,14 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vnet, #if defined(INET) || defined(INET6) SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, &jail_max_af_ips, 0, - "Number of IP addresses a jail may have at most per address family (deprecated)"); + "Number of IP addresses a jail may have at most per address family"); #endif /* - * Default parameters for jail(2) compatibility. For historical reasons, - * the sysctl names have varying similarity to the parameter names. Prisons - * just see their own parameters, and can't change them. + * Jail permissions - jailed processes can read these to find out what they are + * allowed to do. A deprecated use is to set default permissions for prisons + * created via jail(2). For historical reasons, the sysctl names have varying + * similarity to the parameter names. */ static int sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) @@ -3572,52 +3599,68 @@ sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) int allow, error, i; pr = req->td->td_ucred->cr_prison; +#ifdef PR_GLOBAL_ALLOW allow = (pr == &prison0) ? jail_default_allow : pr->pr_allow; +#else + allow = pr->pr_allow; +#endif /* Get the current flag value, and convert it to a boolean. */ i = (allow & arg2) ? 1 : 0; if (arg1 != NULL) i = !i; error = sysctl_handle_int(oidp, &i, 0, req); - if (error || !req->newptr) + if (error) return (error); - i = i ? arg2 : 0; - if (arg1 != NULL) - i ^= arg2; - /* - * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 - * for writing. - */ - mtx_lock(&prison0.pr_mtx); - jail_default_allow = (jail_default_allow & ~arg2) | i; - mtx_unlock(&prison0.pr_mtx); +#ifdef PR_GLOBAL_ALLOW + if (req->newptr) { + i = i ? arg2 : 0; + if (arg1 != NULL) + i ^= arg2; + /* + * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 + * for writing. + */ + mtx_lock(&prison0.pr_mtx); + jail_default_allow = (jail_default_allow & ~arg2) | i; + mtx_unlock(&prison0.pr_mtx); + } +#endif return (0); } +#ifdef PR_GLOBAL_ALLOW +#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RW | CTLFLAG_MPSAFE) +#define ADDR_GLOBAL_ALLOW(i) &i +#else +#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RD | CTLFLAG_MPSAFE) +#define ADDR_GLOBAL_ALLOW(i) NULL +#endif + SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", - "Processes in jail can set their hostnames (deprecated)"); + "Processes in jail can set their hostnames"); SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", - "Processes in jail are limited to creating UNIX/IP/route sockets only (deprecated)"); + "Processes in jail are limited to creating UNIX/IP/route sockets only"); SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", - "Processes in jail can use System V IPC primitives (deprecated)"); + "Processes in jail can use System V IPC primitives"); SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", - "Prison root can create raw sockets (deprecated)"); + "Prison root can create raw sockets"); SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", - "Processes in jail can alter system file flags (deprecated)"); + "Processes in jail can alter system file flags"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", - "Processes in jail can mount/unmount jail-friendly file systems (deprecated)"); + "Processes in jail can mount/unmount jail-friendly file systems"); static int sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) @@ -3626,25 +3669,33 @@ sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) int level, error; pr = req->td->td_ucred->cr_prison; +#ifdef PR_GLOBAL_ALLOW level = (pr == &prison0) ? *(int *)arg1 : *(int *)((char *)pr + arg2); +#else + level = *(int *)((char *)pr + arg2); +#endif error = sysctl_handle_int(oidp, &level, 0, req); - if (error || !req->newptr) + if (error) return (error); - *(int *)arg1 = level; +#ifdef PR_GLOBAL_ALLOW + if (req->newptr) + *(int *)arg1 = level; +#endif return (0); } SYSCTL_PROC(_security_jail, OID_AUTO, enforce_statfs, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, - &jail_default_enforce_statfs, offsetof(struct prison, pr_enforce_statfs), + CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, + ADDR_GLOBAL_ALLOW(jail_default_enforce_statfs), + offsetof(struct prison, pr_enforce_statfs), sysctl_jail_default_level, "I", - "Processes in jail cannot see all mounted file systems (deprecated)"); - + "Processes in jail cannot see all mounted file systems"); SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, - &jail_default_devfs_rsnum, offsetof(struct prison, pr_devfs_rsnum), + CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, + ADDR_GLOBAL_ALLOW(jail_default_devfs_rsnum), + offsetof(struct prison, pr_devfs_rsnum), sysctl_jail_default_level, "I", - "Ruleset for the devfs filesystem in jail (deprecated)"); + "Ruleset for the devfs filesystem in jail"); /* * Nodes to describe jail parameters. Maximum length of string parameters @@ -3785,9 +3836,6 @@ prison_add_allow(const char *prefix, const char *name, struct bool_flags *bf; struct sysctl_oid *parent; char *allow_name, *allow_noname, *allowed; -#ifndef NO_SYSCTL_DESCR - char *descr_deprecated; -#endif unsigned allow_flag; if (prefix @@ -3844,10 +3892,7 @@ prison_add_allow(const char *prefix, const char *name, bf->flag = allow_flag; mtx_unlock(&prison0.pr_mtx); - /* - * Create sysctls for the paramter, and the back-compat global - * permission. - */ + /* Create sysctls for the paramter, and the current permission. */ parent = prefix ? SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), @@ -3859,17 +3904,10 @@ prison_add_allow(const char *prefix, const char *name, if ((prefix ? asprintf(&allowed, M_TEMP, "%s_%s_allowed", prefix, name) : asprintf(&allowed, M_TEMP, "%s_allowed", name)) >= 0) { -#ifndef NO_SYSCTL_DESCR - (void)asprintf(&descr_deprecated, M_TEMP, "%s (deprecated)", - descr); -#endif (void)SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, allowed, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, allow_flag, - sysctl_jail_default_allow, "I", descr_deprecated); -#ifndef NO_SYSCTL_DESCR - free(descr_deprecated, M_TEMP); -#endif + CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, allow_flag, + sysctl_jail_default_allow, "I", descr); free(allowed, M_TEMP); } return allow_flag; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/kern/syscalls.c Thu Aug 16 18:40:16 2018 (r337922) @@ -344,7 +344,7 @@ const char *syscallnames[] = { "utrace", /* 335 = utrace */ "compat4.sendfile", /* 336 = freebsd4 sendfile */ "kldsym", /* 337 = kldsym */ - "jail", /* 338 = jail */ + "compat11.jail", /* 338 = freebsd11 jail */ "nnpfs_syscall", /* 339 = nnpfs_syscall */ "sigprocmask", /* 340 = sigprocmask */ "sigsuspend", /* 341 = sigsuspend */ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/kern/syscalls.master Thu Aug 16 18:40:16 2018 (r337922) @@ -738,7 +738,7 @@ _Out_opt_ off_t *sbytes, int flags); } 337 AUE_NULL STD { int kldsym(int fileid, int cmd, \ _In_ void *data); } -338 AUE_JAIL STD { int jail( \ +338 AUE_JAIL COMPAT11 { int jail( \ _In_ struct jail *jail); } 339 AUE_NULL NOSTD|NOTSTATIC { int nnpfs_syscall(int operation, \ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/kern/systrace_args.c Thu Aug 16 18:40:16 2018 (r337922) @@ -1593,13 +1593,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* jail */ - case 338: { - struct jail_args *p = params; - uarg[0] = (intptr_t) p->jail; /* struct jail * */ - *n_args = 1; - break; - } /* nnpfs_syscall */ case 339: { struct nnpfs_syscall_args *p = params; @@ -5772,16 +5765,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* jail */ - case 338: - switch(ndx) { - case 0: - p = "userland struct jail *"; - break; - default: - break; - }; - break; /* nnpfs_syscall */ case 339: switch(ndx) { @@ -9644,11 +9627,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* kldsym */ case 337: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* jail */ - case 338: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/sys/jail.h Thu Aug 16 18:40:16 2018 (r337922) @@ -32,6 +32,7 @@ #ifndef _SYS_JAIL_H_ #define _SYS_JAIL_H_ +#ifdef COMPAT_FREEBSD11 #ifdef _KERNEL struct jail_v0 { u_int32_t version; @@ -57,16 +58,6 @@ struct jail { * For all xprison structs, always keep the pr_version an int and * the first variable so userspace can easily distinguish them. */ -#ifndef _KERNEL -struct xprison_v1 { - int pr_version; - int pr_id; - char pr_path[MAXPATHLEN]; - char pr_host[MAXHOSTNAMELEN]; - u_int32_t pr_ip; -}; -#endif - struct xprison { int pr_version; int pr_id; @@ -91,6 +82,7 @@ struct xprison { #define PRISON_STATE_INVALID 0 #define PRISON_STATE_ALIVE 1 #define PRISON_STATE_DYING 2 +#endif /* COMPAT_FREEBSD11 */ /* * Flags for jail_set and jail_get. @@ -110,7 +102,6 @@ struct xprison { struct iovec; -int jail(struct jail *); int jail_set(struct iovec *, unsigned int, int); int jail_get(struct iovec *, unsigned int, int); int jail_attach(int); Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/sys/syscall.h Thu Aug 16 18:40:16 2018 (r337922) @@ -280,7 +280,7 @@ #define SYS_utrace 335 /* 336 is freebsd4 sendfile */ #define SYS_kldsym 337 -#define SYS_jail 338 +#define SYS_freebsd11_jail 338 #define SYS_nnpfs_syscall 339 #define SYS_sigprocmask 340 #define SYS_sigsuspend 341 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/sys/syscall.mk Thu Aug 16 18:40:16 2018 (r337922) @@ -209,7 +209,7 @@ MIASM = \ sched_rr_get_interval.o \ utrace.o \ kldsym.o \ - jail.o \ + freebsd11_jail.o \ nnpfs_syscall.o \ sigprocmask.o \ sigsuspend.o \ Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/sys/syscallsubr.h Thu Aug 16 18:40:16 2018 (r337922) @@ -143,7 +143,6 @@ int kern_getsockname(struct thread *td, int fd, struct int kern_getsockopt(struct thread *td, int s, int level, int name, void *optval, enum uio_seg valseg, socklen_t *valsize); int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data); -int kern_jail(struct thread *td, struct jail *j); int kern_jail_get(struct thread *td, struct uio *options, int flags); int kern_jail_set(struct thread *td, struct uio *options, int flags); int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, @@ -308,5 +307,6 @@ struct freebsd11_dirent; int freebsd11_kern_getdirentries(struct thread *td, int fd, char *ubuf, u_int count, long *basep, void (*func)(struct freebsd11_dirent *)); +int freebsd11_kern_jail(struct thread *td, struct jail *j); #endif /* !_SYS_SYSCALLSUBR_H_ */ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/sys/sysproto.h Thu Aug 16 18:40:16 2018 (r337922) @@ -849,9 +849,6 @@ struct kldsym_args { char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; }; -struct jail_args { - char jail_l_[PADL_(struct jail *)]; struct jail * jail; char jail_r_[PADR_(struct jail *)]; -}; struct nnpfs_syscall_args { char operation_l_[PADL_(int)]; int operation; char operation_r_[PADR_(int)]; char a_pathP_l_[PADL_(char *)]; char * a_pathP; char a_pathP_r_[PADR_(char *)]; @@ -1961,7 +1958,6 @@ int sys_sched_get_priority_min(struct thread *, struct int sys_sched_rr_get_interval(struct thread *, struct sched_rr_get_interval_args *); int sys_utrace(struct thread *, struct utrace_args *); int sys_kldsym(struct thread *, struct kldsym_args *); -int sys_jail(struct thread *, struct jail_args *); int sys_nnpfs_syscall(struct thread *, struct nnpfs_syscall_args *); int sys_sigprocmask(struct thread *, struct sigprocmask_args *); int sys_sigsuspend(struct thread *, struct sigsuspend_args *); @@ -2531,6 +2527,9 @@ struct freebsd11_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * sb; char sb_r_[PADR_(struct freebsd11_stat *)]; }; +struct freebsd11_jail_args { + char jail_l_[PADL_(struct jail *)]; struct jail * jail; char jail_r_[PADR_(struct jail *)]; +}; struct freebsd11_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(struct kevent_freebsd11 *)]; struct kevent_freebsd11 * changelist; char changelist_r_[PADR_(struct kevent_freebsd11 *)]; @@ -2579,6 +2578,7 @@ int freebsd11_nstat(struct thread *, struct freebsd11_ int freebsd11_nfstat(struct thread *, struct freebsd11_nfstat_args *); int freebsd11_nlstat(struct thread *, struct freebsd11_nlstat_args *); int freebsd11_fhstat(struct thread *, struct freebsd11_fhstat_args *); +int freebsd11_jail(struct thread *, struct freebsd11_jail_args *); int freebsd11_kevent(struct thread *, struct freebsd11_kevent_args *); int freebsd11_getfsstat(struct thread *, struct freebsd11_getfsstat_args *); int freebsd11_statfs(struct thread *, struct freebsd11_statfs_args *); @@ -2849,7 +2849,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_utrace AUE_NULL #define SYS_AUE_freebsd4_sendfile AUE_SENDFILE #define SYS_AUE_kldsym AUE_NULL -#define SYS_AUE_jail AUE_JAIL +#define SYS_AUE_freebsd11_jail AUE_JAIL #define SYS_AUE_nnpfs_syscall AUE_NULL #define SYS_AUE_sigprocmask AUE_SIGPROCMASK #define SYS_AUE_sigsuspend AUE_SIGSUSPEND Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Thu Aug 16 18:37:47 2018 (r337921) +++ head/sys/ufs/ufs/ufs_vnops.c Thu Aug 16 18:40:16 2018 (r337922) @@ -550,9 +550,8 @@ ufs_setattr(ap) * Privileged non-jail processes may not modify system flags * if securelevel > 0 and any existing system flags are set. * Privileged jail processes behave like privileged non-jail - * processes if the security.jail.chflags_allowed sysctl is - * is non-zero; otherwise, they behave like unprivileged - * processes. + * processes if the PR_ALLOW_CHFLAGS permission bit is set; + * otherwise, they behave like unprivileged processes. */ if (!priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0)) { if (ip->i_flags & From owner-svn-src-all@freebsd.org Thu Aug 16 18: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 017D91072A29; Thu, 16 Aug 2018 18:44:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB07472D7E; Thu, 16 Aug 2018 18:44:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88BD71D527; Thu, 16 Aug 2018 18:44:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GIionc050057; Thu, 16 Aug 2018 18:44:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GIioFs050056; Thu, 16 Aug 2018 18:44:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201808161844.w7GIioFs050056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 16 Aug 2018 18:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337923 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:44:51 -0000 Author: mav Date: Thu Aug 16 18:44:50 2018 New Revision: 337923 URL: https://svnweb.freebsd.org/changeset/base/337923 Log: Make vfs.zfs.zio.dva_throttle_enabled sysctl writable. Not sure what I thought originally, but as I see now runtime changes are working fine, and the code seems like even designed for this. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Aug 16 18:40:16 2018 (r337922) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Aug 16 18:44:50 2018 (r337923) @@ -83,8 +83,8 @@ const char *zio_type_name[ZIO_TYPES] = { }; boolean_t zio_dva_throttle_enabled = B_TRUE; -SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, dva_throttle_enabled, CTLFLAG_RDTUN, - &zio_dva_throttle_enabled, 0, ""); +SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, dva_throttle_enabled, CTLFLAG_RWTUN, + &zio_dva_throttle_enabled, 0, "Enable allocation throttling"); /* * ========================================================================== From owner-svn-src-all@freebsd.org Thu Aug 16 18:47: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 88C3A1072B10; Thu, 16 Aug 2018 18:47:47 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:bb:dcff:fe50:d900]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.lerctr.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27FBC72F79; Thu, 16 Aug 2018 18:47:47 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+SoXyzT+UvG7dHZyuDjeEAGquR7yJXyrsj3ggS0c0X8=; b=hmwpBWCCK2oUxC4jIIqkmKij7/ TXfUTBuo0ghR1WICB69OqWf7+9u3V5AoNYKcP7wB1vLHgoR6LdcV28mpUyH5o2qtBq4vc1GjOxB3w zAg3dkcE2/DJCrCw/GQbOqi4YAsQpv5R8JBY31ntIHNhB292/VFrnH4S/BvBGc7JT2k4=; Received: from [2600:1700:210:b18f:4c0:e5c4:68ef:d5be] (port=57891 helo=ler-imac.local) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1fqNJC-000Knc-9X; Thu, 16 Aug 2018 13:47:46 -0500 Date: Thu, 16 Aug 2018 13:47:45 -0500 From: Larry Rosenman To: Bryan Drewery Cc: Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... Message-ID: <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> Mail-Followup-To: Bryan Drewery , Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="r63cqivhi6vghs6j" Content-Disposition: inline In-Reply-To: <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:47:47 -0000 --r63cqivhi6vghs6j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 16, 2018 at 11:34:59AM -0700, Bryan Drewery wrote: > On 8/16/18 11:21 AM, Larry Rosenman wrote: > > On Thu, Aug 16, 2018 at 02:02:52PM -0400, Jung-uk Kim wrote: > >> On 18. 8. 16., Larry Rosenman wrote: > >>> On Thu, Aug 16, 2018 at 01:48:40PM -0400, Jung-uk Kim wrote: > >>>> On 18. 8. 16., Ravi Pokala wrote: > >>>>> -----Original Message----- > >>>>> From: on behalf of Jung-uk Kim <= jkim@FreeBSD.org> > >>>>> Date: 2018-08-14, Tuesday at 10:48 > >>>>> To: , , > >>>>> Subject: svn commit: r337791 - in head: crypto/openssl crypto/opens= sl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/cry= pto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... > >>>>> > >>>>>> Author: jkim > >>>>>> Date: Tue Aug 14 17:48:02 2018 > >>>>>> New Revision: 337791 > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/337791 > >>>>>> > >>>>>> Log: > >>>>>> Merge OpenSSL 1.0.2p. > >>>>> > >>>>> Is it just me, or did this change break all the worlds? > >>>>> > >>>>> I got errors like this: > >>>>> > >>>>> ---------------------------------------------------------------- > >>>>> /usr/bin/ld: error: undefined symbol: main > >>>>>>>> referenced by crt1.c:74 (/usr/home/rpokala/freebsd/clean/base/he= ad/lib/csu/amd64/crt1.c:74) > >>>>>>>> /build/usr/home/rpokala/freebsd/clean/base/head/am= d64.amd64/tmp/usr/lib/crt1.o:(_start) > >>>>> > >>>>> /usr/bin/ld: error: undefined symbol: Fssh_error > >>>>>>>> referenced by moduli.c:257 (/usr/home/rpokala/freebsd/clean/base= /head/crypto/openssh/moduli.c:257) > >>>>>>>> /tmp/moduli-6780ab.o:(Fssh_gen_candidates) > >>>>> ---------------------------------------------------------------- > >>>>> > >>>>> At first I thought it was because I was rebuilding without cleaning= , but I nuked the tree and rebuilt from scratch, and got the same error. > >>>>> > >>>>> I didn't bisect it to this change, but it's the only recent change = to crypto... > >>>> > >>>> I built worlds many times and I haven't seen such problem. In fact, > >>>> Jenkins didn't break on amd64 after the commit. > >>>> > >>>> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ > >>> Do you or jenkins run with meta-mode? That seems to be a necessary > >>> condition for the failure. > >> I don't do meta-mode. I don't know much about Jenkins build but I don= 't > >> think it does. Is it a requirement now? > >> >=20 > Jenkins doesn't use META_MODE and it's not a requirement. Can you (bdrewery@) possibly diagnose why meta-mode is messing this up with the moduli file? >=20 > > It's not a requirement, but seems to be implicated in this failure..... > >=20 > > Cc'ing bdrewery@ for the meta mode stuff. > >=20 > >=20 > >> Jung-uk Kim > >> > >=20 > >=20 > >=20 > >=20 >=20 >=20 > --=20 > Regards, > Bryan Drewery >=20 --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 5708 Sabbia Drive, Round Rock, TX 78665-2106 --r63cqivhi6vghs6j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHABAABCgCqFiEEHjgknedhWzvJgwVzaXyZsatIp30FAlt1xtEsFIAAAAAAFQAO cGthLWFkZHJlc3NAZ251cGcub3JnbGVyQGxlcmN0ci5vcmdfFIAAAAAALgAoaXNz dWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDFFMzgy NDlERTc2MTVCM0JDOTgzMDU3MzY5N0M5OUIxQUI0OEE3N0QACgkQaXyZsatIp324 xwf8CRtvW8b64nylduiReMbDL7FdrLTMVwjpOZZ6QrEpBPCxcgDhfC3gjdIEPL0K cbW/xYEUkaSCJo9CsIv3MZV2P8leC/8VifSVlRO5FwryNvkNKB8yo97rG81c6Kks NGRQJOn16xJ/uYXo5dq+K+I7omaXuC4jaqpO17JjXNI190ar6DKSE/pyGXbT+GQ1 EVj23G0SVG+5OrQiEIh+sbok4mWs9tLr9XFoGKaioXYLkq+eWlaRBaE0H6BRw/qF zDOpIL/DMa8DMRH2+J0QpJmLe/3X2gN8Et1dDO/WyltfF8Dsm40bFGKj0l8gDdXr 42MRAIdSoT4b0mE2+aDEBSxkFw== =pJY3 -----END PGP SIGNATURE----- --r63cqivhi6vghs6j-- From owner-svn-src-all@freebsd.org Thu Aug 16 18:56:02 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 36C331072F17; Thu, 16 Aug 2018 18:56:02 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-qk0-x232.google.com (mail-qk0-x232.google.com [IPv6:2607:f8b0:400d:c09::232]) (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 C5C8F7361C; Thu, 16 Aug 2018 18:56:01 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-qk0-x232.google.com with SMTP id 93-v6so3226975qks.3; Thu, 16 Aug 2018 11:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4dZ4FOw4jZpUwC8UBs7yPxKIKYSC/rul1Ye8TazfeAA=; b=KPEem0rKJ4M29okf6Ygljum1v1Cu9X+VZXZSdfsXDG7uYFpxdbPbyNudelAK9WEVKW ovifZkfFzH89EDiqsMMvZbrURq0M7Lxx1yk9HFIU+C6fLGGSSFCRXudeiDFQlU1OTGqX ow1JsaB8pKRHsqxajUq2lZ9WfEHsAeku5CaRVMnzXxcnjUAP1OVcBy1F/1jfr0tQopR6 sEnYbcwzIeoXsoZMdoCL1DZ2NDctKRiztp3QKMU3iMpApWzLc6x73U658JhlVT9s1EZ1 eIe1vEdQDX1x1YScYf6GMhIJ+N18Kx2Q2YKJ76pUbT+6HDqYbZXoEM7BP7wemnpnKhRw gRCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4dZ4FOw4jZpUwC8UBs7yPxKIKYSC/rul1Ye8TazfeAA=; b=MC/wlY4vs8dCBSpDZ0S3OxkG8jF6OUQtApDCrXo1MU/6nXNx8fvtZtbf5Lp8MvQ+mA 5L2K23LFZSCXcwcTG7rH7Z+YEZyuVeZs+x8zizqtRFQkjaAmm7L1HRQ8viyDaj/8FHbw 8PsMZI4rllK9UnamAqk9NW9X3wpx9VOgT6yavMERa05LLOekwQAa/Mr2hRkzQAdfj8bU k4mIwj1QViXDq3JrMUkn70LGt+F/iC59Yty+0uExiNmGcJV4Wz5QH5p9rYkdvSydIXpX /NXWM+cTJAS8RjU//Jo+GzFluFddyKXbXCEZZm0/4qJo2uUew1TfF1iB3sETqVyUNsF1 gswg== X-Gm-Message-State: AOUpUlHWifofKYz63ohhpbl0ir7vVC4mRoG/sYLZgfNJduR0crpz6Qxy uaZKN610/kVOrA+HjDdS8JEVWEEs4Hu5fJMgTHssTw== X-Google-Smtp-Source: AA+uWPwyXvzf9P9A7pgSf11mzVEm0y8/0bIBXhWEiKmI+hkQ5VI/TfaLhTp5eLjj3sIvlZMKqlIFGABsgWH2bNxmc8E= X-Received: by 2002:a37:a9c1:: with SMTP id s184-v6mr27907520qke.199.1534445760791; Thu, 16 Aug 2018 11:56:00 -0700 (PDT) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 2002:a0c:8c42:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 11:56:00 -0700 (PDT) In-Reply-To: <201808161840.w7GIeHGl045096@repo.freebsd.org> References: <201808161840.w7GIeHGl045096@repo.freebsd.org> From: Antoine Brodin Date: Thu, 16 Aug 2018 20:56:00 +0200 X-Google-Sender-Auth: eaiMYhcmnNNX1G2y2LTMY-r99mw Message-ID: Subject: Re: svn commit: r337922 - in head: lib/libc/gen lib/libc/sys share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/freebsd32 sys/fs/nandfs sys/kern sys/sys sys/ufs/ufs To: Jamie Gritton Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:56:02 -0000 On Thu, Aug 16, 2018 at 8:40 PM, Jamie Gritton wrote: > Author: jamie > Date: Thu Aug 16 18:40:16 2018 > New Revision: 337922 > URL: https://svnweb.freebsd.org/changeset/base/337922 > > Log: > Put jail(2) under COMPAT_FREEBSD11. It has been the "old" way of creating > jails since FreeBSD 7. > > Along with the system call, put the various security.jail.allow_foo and > security.jail.foo_allowed sysctls partly under COMPAT_FREEBSD11 (or > BURN_BRIDGES). These sysctls had two disparate uses: on the system side, > they were global permissions for jails created via jail(2) which lacked > fine-grained permission controls; inside a jail, they're read-only > descriptions of what the current jail is allowed to do. The first use > is obsolete along with jail(2), but keep them for the second-read-only use. > > Differential Revision: D14791 Hi, Were the failures pointed out during the exp-run fixed? If not please revert and work on fixing those before. Cheers, Antoine (with hat: portmgr) From owner-svn-src-all@freebsd.org Thu Aug 16 18:58: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 B50F51073055; Thu, 16 Aug 2018 18:58:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A238737F7; Thu, 16 Aug 2018 18:58:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40A111D71C; Thu, 16 Aug 2018 18:58:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GIwZX4055528; Thu, 16 Aug 2018 18:58:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GIwYgG055526; Thu, 16 Aug 2018 18:58:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808161858.w7GIwYgG055526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 Aug 2018 18:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337924 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 337924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 18:58:35 -0000 Author: kevans Date: Thu Aug 16 18:58:34 2018 New Revision: 337924 URL: https://svnweb.freebsd.org/changeset/base/337924 Log: libbe(3): Impose dataset length restrictions on boot env name validation Previously, we only validated names for character restrictions. This is helpful, but we should've also checked length restrictions- dataset names must be restricted to MAXNAMELEN. While here, move validation before doing a bunch of concatenations and fix error handling in be_rename. It was previously setting the error state based on return value from a libzfs function, which is wrong: libzfs errors don't necessarily match cleanly to libbe errors. This would cause the assertion in be_error to hit when the error was printed. Modified: head/lib/libbe/be.c head/lib/libbe/libbe.3 Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Thu Aug 16 18:44:50 2018 (r337923) +++ head/lib/libbe/be.c Thu Aug 16 18:58:34 2018 (r337924) @@ -486,7 +486,7 @@ be_create_from_existing(libbe_handle_t *lbh, const cha int err; char buf[BE_MAXPATHLEN]; - if ((err = be_snapshot(lbh, old, NULL, true, (char *)&buf))) + if ((err = be_snapshot(lbh, old, NULL, true, (char *)&buf)) != 0) return (set_error(lbh, err)); err = be_create_from_existing_snap(lbh, name, (char *)buf); @@ -577,11 +577,12 @@ be_root_concat(libbe_handle_t *lbh, const char *name, /* * Verifies the validity of a boot environment name (A-Za-z0-9-_.). Returns - * BE_ERR_SUCCESS (0) if name is valid, otherwise returns BE_ERR_INVALIDNAME. + * BE_ERR_SUCCESS (0) if name is valid, otherwise returns BE_ERR_INVALIDNAME + * or BE_ERR_PATHLEN. * Does not set internal library error state. */ int -be_validate_name(libbe_handle_t *lbh __unused, const char *name) +be_validate_name(libbe_handle_t *lbh, const char *name) { for (int i = 0; *name; i++) { char c = *(name++); @@ -590,6 +591,12 @@ be_validate_name(libbe_handle_t *lbh __unused, const c return (BE_ERR_INVALIDNAME); } + /* + * Impose the additional restriction that the entire dataset name must + * not exceed the maximum length of a dataset, i.e. MAXNAMELEN. + */ + if (strlen(lbh->root) + 1 + strlen(name) > MAXNAMELEN) + return (BE_ERR_PATHLEN); return (BE_ERR_SUCCESS); } @@ -605,14 +612,17 @@ be_rename(libbe_handle_t *lbh, const char *old, const zfs_handle_t *zfs_hdl; int err; + /* + * be_validate_name is documented not to set error state, so we should + * do so here. + */ + if ((err = be_validate_name(lbh, new)) != 0) + return (set_error(lbh, err)); if ((err = be_root_concat(lbh, old, full_old)) != 0) return (set_error(lbh, err)); if ((err = be_root_concat(lbh, new, full_new)) != 0) return (set_error(lbh, err)); - if ((err = be_validate_name(lbh, new)) != 0) - return (err); - /* Check if old is active BE */ if (strcmp(full_old, be_active_path(lbh)) == 0) return (set_error(lbh, BE_ERR_MOUNTED)); @@ -639,8 +649,9 @@ be_rename(libbe_handle_t *lbh, const char *old, const err = zfs_rename(zfs_hdl, NULL, full_new, flags); zfs_close(zfs_hdl); - - return (set_error(lbh, err)); + if (err != 0) + return (set_error(lbh, BE_ERR_UNKNOWN)); + return (0); } Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Thu Aug 16 18:44:50 2018 (r337923) +++ head/lib/libbe/libbe.3 Thu Aug 16 18:58:34 2018 (r337924) @@ -331,7 +331,9 @@ environment name into .Pp The .Fn be_validate_name -function will validate the given boot environment name. +function will validate the given boot environment name for both length +restrictions as well as valid character restrictions. +This function does not set the internal library error state. .Pp The .Fn be_validate_snap From owner-svn-src-all@freebsd.org Thu Aug 16 19:09:48 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 14F2D10734B1; Thu, 16 Aug 2018 19:09:48 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBA8D73F99; Thu, 16 Aug 2018 19:09:47 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C8A41D8C3; Thu, 16 Aug 2018 19:09:47 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GJ9lCq060734; Thu, 16 Aug 2018 19:09:47 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GJ9hXt060717; Thu, 16 Aug 2018 19:09:43 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808161909.w7GJ9hXt060717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 16 Aug 2018 19:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337925 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys X-SVN-Commit-Revision: 337925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:09:48 -0000 Author: jamie Date: Thu Aug 16 19:09:43 2018 New Revision: 337925 URL: https://svnweb.freebsd.org/changeset/base/337925 Log: Revert r337922, except for some documention-only bits. This needs to wait until user is changed to stop using jail(2). Differential Revision: D14791 Modified: head/lib/libc/sys/jail.2 head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/init_sysent.c head/sys/kern/kern_jail.c head/sys/kern/syscalls.c head/sys/kern/syscalls.master head/sys/kern/systrace_args.c head/sys/sys/jail.h head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/syscallsubr.h head/sys/sys/sysproto.h Modified: head/lib/libc/sys/jail.2 ============================================================================== --- head/lib/libc/sys/jail.2 Thu Aug 16 18:58:34 2018 (r337924) +++ head/lib/libc/sys/jail.2 Thu Aug 16 19:09:43 2018 (r337925) @@ -25,10 +25,11 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2018 +.Dd February 8, 2012 .Dt JAIL 2 .Os .Sh NAME +.Nm jail , .Nm jail_get , .Nm jail_set , .Nm jail_remove , @@ -40,6 +41,8 @@ .In sys/param.h .In sys/jail.h .Ft int +.Fn jail "struct jail *jail" +.Ft int .Fn jail_attach "int jid" .Ft int .Fn jail_remove "int jid" @@ -50,7 +53,74 @@ .Fn jail_set "struct iovec *iov" "u_int niov" "int flags" .Sh DESCRIPTION The +.Fn jail +system call sets up a jail and locks the current process in it. +.Pp +The argument is a pointer to a structure describing the prison: +.Bd -literal -offset indent +struct jail { + uint32_t version; + char *path; + char *hostname; + char *jailname; + unsigned int ip4s; + unsigned int ip6s; + struct in_addr *ip4; + struct in6_addr *ip6; +}; +.Ed +.Pp +.Dq Li version +defines the version of the API in use. +.Dv JAIL_API_VERSION +is defined for the current version. +.Pp +The +.Dq Li path +pointer should be set to the directory which is to be the root of the +prison. +.Pp +The +.Dq Li hostname +pointer can be set to the hostname of the prison. +This can be changed +from the inside of the prison. +.Pp +The +.Dq Li jailname +pointer is an optional name that can be assigned to the jail +for example for management purposes. +.Pp +The +.Dq Li ip4s +and +.Dq Li ip6s +give the numbers of IPv4 and IPv6 addresses that will be passed +via their respective pointers. +.Pp +The +.Dq Li ip4 +and +.Dq Li ip6 +pointers can be set to an arrays of IPv4 and IPv6 addresses to be assigned to +the prison, or NULL if none. +IPv4 addresses must be in network byte order. +.Pp +This is equivalent to, and deprecated in favor of, the .Fn jail_set +system call (see below), with the parameters +.Va path , +.Va host.hostname , +.Va name , +.Va ip4.addr , +and +.Va ip6.addr , +and with the +.Dv JAIL_ATTACH +flag. +.Pp +The +.Fn jail_set system call creates a new jail, or modifies an existing one, and optionally locks the current process in it. Jail parameters are passed as an array of name-value pairs in the array @@ -76,19 +146,13 @@ The current set of available parameters, and their for retrieved via the .Va security.jail.param sysctl MIB entry. -Notable parameters include +Notable parameters include those mentioned in the +.Fn jail +description above, as well as .Va jid and -.Va name -which identify the jail being created or modified, -.Va path -(the root directory of the jail), -.Va host.hostname -(the hostname of the jail), and -.Va ip4.addr -and -.Va ip6.addr -(IP addresses to assign to the jail). +.Va name , +which identify the jail being created or modified. See .Xr jail 8 for more information on the core jail parameters. @@ -173,7 +237,8 @@ It will kill all processes belonging to the jail, and of that jail. .Sh RETURN VALUES If successful, -.Fn jail_set +.Fn jail , +.Fn jail_set , and .Fn jail_get return a non-negative integer, termed the jail identifier (JID). @@ -184,6 +249,25 @@ to indicate the error. .Rv -std jail_attach jail_remove .Sh ERRORS The +.Fn jail +system call +will fail if: +.Bl -tag -width Er +.It Bq Er EPERM +This process is not allowed to create a jail, either because it is not +the super-user, or because it would exceed the jail's +.Va children.max +limit. +.It Bq Er EFAULT +.Fa jail +points to an address outside the allocated address space of the process. +.It Bq Er EINVAL +The version number of the argument is not correct. +.It Bq Er EAGAIN +No free JID could be found. +.El +.Pp +The .Fn jail_set system call will fail if: @@ -287,7 +371,8 @@ does not exist. .El .Pp Further -.Fn jail_set +.Fn jail , +.Fn jail_set , and .Fn jail_attach call @@ -301,7 +386,7 @@ manual page for details. .Xr chroot 2 , .Xr jail 8 .Sh HISTORY -The now-deprecated +The .Fn jail system call appeared in .Fx 4.0 . Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 19:09:43 2018 (r337925) @@ -2289,10 +2289,8 @@ freebsd32_sysctl(struct thread *td, struct freebsd32_s return (0); } -#ifdef COMPAT_FREEBSD11 int -freebsd11_freebsd32_jail(struct thread *td, - struct freebsd11_freebsd32_jail_args *uap) +freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) { uint32_t version; int error; @@ -2349,9 +2347,8 @@ freebsd11_freebsd32_jail(struct thread *td, /* Sci-Fi jails are not supported, sorry. */ return (EINVAL); } - return (freebsd11_kern_jail(td, &j)); + return (kern_jail(td, &j)); } -#endif /* COMPAT_FREEBSD11 */ int freebsd32_jail_set(struct thread *td, struct freebsd32_jail_set_args *uap) Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 19:09:43 2018 (r337925) @@ -283,6 +283,9 @@ struct freebsd32_sched_rr_get_interval_args { char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; char interval_l_[PADL_(struct timespec32 *)]; struct timespec32 * interval; char interval_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_jail_args { + char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char jail_r_[PADR_(struct jail32 *)]; +}; struct freebsd32_sigtimedwait_args { char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; @@ -758,6 +761,7 @@ int freebsd32_aio_return(struct thread *, struct freeb int freebsd32_aio_suspend(struct thread *, struct freebsd32_aio_suspend_args *); int freebsd32_aio_error(struct thread *, struct freebsd32_aio_error_args *); int freebsd32_sched_rr_get_interval(struct thread *, struct freebsd32_sched_rr_get_interval_args *); +int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); int freebsd32_sigtimedwait(struct thread *, struct freebsd32_sigtimedwait_args *); int freebsd32_sigwaitinfo(struct thread *, struct freebsd32_sigwaitinfo_args *); int freebsd32_aio_waitcomplete(struct thread *, struct freebsd32_aio_waitcomplete_args *); @@ -1180,9 +1184,6 @@ struct freebsd11_freebsd32_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * sb; char sb_r_[PADR_(struct freebsd11_stat32 *)]; }; -struct freebsd11_freebsd32_jail_args { - char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char jail_r_[PADR_(struct jail32 *)]; -}; struct freebsd11_freebsd32_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent32_freebsd11 *)]; const struct kevent32_freebsd11 * changelist; char changelist_r_[PADR_(const struct kevent32_freebsd11 *)]; @@ -1222,7 +1223,6 @@ int freebsd11_freebsd32_lstat(struct thread *, struct int freebsd11_freebsd32_getdirentries(struct thread *, struct freebsd11_freebsd32_getdirentries_args *); int freebsd11_freebsd32_getdents(struct thread *, struct freebsd11_freebsd32_getdents_args *); int freebsd11_freebsd32_fhstat(struct thread *, struct freebsd11_freebsd32_fhstat_args *); -int freebsd11_freebsd32_jail(struct thread *, struct freebsd11_freebsd32_jail_args *); int freebsd11_freebsd32_kevent(struct thread *, struct freebsd11_freebsd32_kevent_args *); int freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fstatat_args *); int freebsd11_freebsd32_mknodat(struct thread *, struct freebsd11_freebsd32_mknodat_args *); @@ -1317,7 +1317,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_LIO_LISTIO #define FREEBSD32_SYS_AUE_freebsd32_sched_rr_get_interval AUE_NULL #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE -#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_jail AUE_JAIL +#define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 19:09:43 2018 (r337925) @@ -275,7 +275,7 @@ #define FREEBSD32_SYS_utrace 335 /* 336 is freebsd4 freebsd32_sendfile */ #define FREEBSD32_SYS_kldsym 337 -#define FREEBSD32_SYS_freebsd11_freebsd32_jail 338 +#define FREEBSD32_SYS_freebsd32_jail 338 #define FREEBSD32_SYS_sigprocmask 340 #define FREEBSD32_SYS_sigsuspend 341 /* 342 is freebsd4 freebsd32_sigaction */ Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 19:09:43 2018 (r337925) @@ -347,7 +347,7 @@ const char *freebsd32_syscallnames[] = { "utrace", /* 335 = utrace */ "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile */ "kldsym", /* 337 = kldsym */ - "compat11.freebsd32_jail", /* 338 = freebsd11 freebsd32_jail */ + "freebsd32_jail", /* 338 = freebsd32_jail */ "#339", /* 339 = pioctl */ "sigprocmask", /* 340 = sigprocmask */ "sigsuspend", /* 341 = sigsuspend */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 19:09:43 2018 (r337925) @@ -394,7 +394,7 @@ struct sysent freebsd32_sysent[] = { { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 freebsd32_sendfile */ { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ - { compat11(AS(freebsd11_freebsd32_jail_args),freebsd32_jail), AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 freebsd32_jail */ + { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd32_jail */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = pioctl */ { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = sigprocmask */ { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 19:09:43 2018 (r337925) @@ -1559,6 +1559,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } + /* freebsd32_jail */ + case 338: { + struct freebsd32_jail_args *p = params; + uarg[0] = (intptr_t) p->jail; /* struct jail32 * */ + *n_args = 1; + break; + } /* sigprocmask */ case 340: { struct sigprocmask_args *p = params; @@ -5704,6 +5711,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* freebsd32_jail */ + case 338: + switch(ndx) { + case 0: + p = "userland struct jail32 *"; + break; + default: + break; + }; + break; /* sigprocmask */ case 340: switch(ndx) { @@ -9653,6 +9670,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* kldsym */ case 337: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_jail */ + case 338: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 16 19:09:43 2018 (r337925) @@ -601,7 +601,7 @@ off_t *sbytes, int flags); } 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ void *data); } -338 AUE_JAIL COMPAT11 { int freebsd32_jail(struct jail32 *jail); } +338 AUE_JAIL STD { int freebsd32_jail(struct jail32 *jail); } 339 AUE_NULL UNIMPL pioctl 340 AUE_SIGPROCMASK NOPROTO { int sigprocmask(int how, \ const sigset_t *set, sigset_t *oset); } Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/kern/init_sysent.c Thu Aug 16 19:09:43 2018 (r337925) @@ -387,7 +387,7 @@ struct sysent sysent[] = { { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ - { compat11(AS(freebsd11_jail_args),jail), AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 jail */ + { AS(jail_args), (sy_call_t *)sys_jail, AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = jail */ { AS(nnpfs_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = sigprocmask */ { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/kern/kern_jail.c Thu Aug 16 19:09:43 2018 (r337925) @@ -74,14 +74,6 @@ __FBSDID("$FreeBSD$"); #include -/* - * The old jail(2) interface will exist under COMPAT_FREEBSD11, but the global - * permission sysctls are slated to go away sometime (even with COMPAT). - */ -#if defined(COMPAT_FREEBSD11) && !defined(BURN_BRIDGES) -#define PR_GLOBAL_ALLOW -#endif - #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); @@ -207,11 +199,9 @@ const size_t pr_flag_allow_size = sizeof(pr_flag_allow #define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | PR_ALLOW_RESERVED_PORTS) #define JAIL_DEFAULT_ENFORCE_STATFS 2 #define JAIL_DEFAULT_DEVFS_RSNUM 0 -#ifdef PR_GLOBAL_ALLOW static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; -#endif #if defined(INET) || defined(INET6) static unsigned jail_max_af_ips = 255; #endif @@ -229,14 +219,13 @@ prison0_init(void) strlcpy(prison0.pr_osrelease, osrelease, sizeof(prison0.pr_osrelease)); } -#ifdef COMPAT_FREEBSD11 /* * struct jail_args { * struct jail *jail; * }; */ int -freebsd11_jail(struct thread *td, struct freebsd11_jail_args *uap) +sys_jail(struct thread *td, struct jail_args *uap) { uint32_t version; int error; @@ -281,16 +270,13 @@ freebsd11_jail(struct thread *td, struct freebsd11_jai /* Sci-Fi jails are not supported, sorry. */ return (EINVAL); } - return (freebsd11_kern_jail(td, &j)); + return (kern_jail(td, &j)); } int -freebsd11_kern_jail(struct thread *td, struct jail *j) +kern_jail(struct thread *td, struct jail *j) { - struct iovec optiov[2 * (3 -#ifdef PR_GLOBAL_ALLOW - + 1 + nitems(pr_flag_allow) -#endif + struct iovec optiov[2 * (4 + nitems(pr_flag_allow) #ifdef INET + 1 #endif @@ -300,10 +286,7 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) )]; struct uio opt; char *u_path, *u_hostname, *u_name; -#ifdef PR_GLOBAL_ALLOW struct bool_flags *bf; - int enforce_statfs; -#endif #ifdef INET uint32_t ip4s; struct in_addr *u_ip4; @@ -312,7 +295,7 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) struct in6_addr *u_ip6; #endif size_t tmplen; - int error; + int error, enforce_statfs; bzero(&optiov, sizeof(optiov)); opt.uio_iov = optiov; @@ -323,7 +306,6 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) opt.uio_rw = UIO_READ; opt.uio_td = td; -#ifdef PR_GLOBAL_ALLOW /* Set permissions for top-level jails from sysctls. */ if (!jailed(td->td_ucred)) { for (bf = pr_flag_allow; @@ -345,7 +327,6 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) optiov[opt.uio_iovcnt].iov_len = sizeof(enforce_statfs); opt.uio_iovcnt++; } -#endif tmplen = MAXPATHLEN + MAXHOSTNAMELEN + MAXHOSTNAMELEN; #ifdef INET @@ -449,7 +430,6 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) free(u_path, M_TEMP); return (error); } -#endif /* COMPAT_FREEBSD11 */ /* @@ -1267,11 +1247,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, i pr->pr_securelevel = ppr->pr_securelevel; pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; -#ifdef PR_GLOBAL_ALLOW pr->pr_enforce_statfs = jail_default_enforce_statfs; -#else - pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; -#endif pr->pr_devfs_rsnum = ppr->pr_devfs_rsnum; pr->pr_osreldate = osreldt ? osreldt : ppr->pr_osreldate; @@ -3439,7 +3415,6 @@ prison_path(struct prison *pr1, struct prison *pr2) static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW, 0, "Jails"); -#ifdef COMPAT_FREEBSD11 static int sysctl_jail_list(SYSCTL_HANDLER_ARGS) { @@ -3543,7 +3518,6 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) SYSCTL_OID(_security_jail, OID_AUTO, list, CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_list, "S", "List of active jails"); -#endif /* COMPAT_FREEBSD11 */ static int sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) @@ -3583,14 +3557,13 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vnet, #if defined(INET) || defined(INET6) SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, &jail_max_af_ips, 0, - "Number of IP addresses a jail may have at most per address family"); + "Number of IP addresses a jail may have at most per address family (deprecated)"); #endif /* - * Jail permissions - jailed processes can read these to find out what they are - * allowed to do. A deprecated use is to set default permissions for prisons - * created via jail(2). For historical reasons, the sysctl names have varying - * similarity to the parameter names. + * Default parameters for jail(2) compatibility. For historical reasons, + * the sysctl names have varying similarity to the parameter names. Prisons + * just see their own parameters, and can't change them. */ static int sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) @@ -3599,68 +3572,52 @@ sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) int allow, error, i; pr = req->td->td_ucred->cr_prison; -#ifdef PR_GLOBAL_ALLOW allow = (pr == &prison0) ? jail_default_allow : pr->pr_allow; -#else - allow = pr->pr_allow; -#endif /* Get the current flag value, and convert it to a boolean. */ i = (allow & arg2) ? 1 : 0; if (arg1 != NULL) i = !i; error = sysctl_handle_int(oidp, &i, 0, req); - if (error) + if (error || !req->newptr) return (error); -#ifdef PR_GLOBAL_ALLOW - if (req->newptr) { - i = i ? arg2 : 0; - if (arg1 != NULL) - i ^= arg2; - /* - * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 - * for writing. - */ - mtx_lock(&prison0.pr_mtx); - jail_default_allow = (jail_default_allow & ~arg2) | i; - mtx_unlock(&prison0.pr_mtx); - } -#endif + i = i ? arg2 : 0; + if (arg1 != NULL) + i ^= arg2; + /* + * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 + * for writing. + */ + mtx_lock(&prison0.pr_mtx); + jail_default_allow = (jail_default_allow & ~arg2) | i; + mtx_unlock(&prison0.pr_mtx); return (0); } -#ifdef PR_GLOBAL_ALLOW -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RW | CTLFLAG_MPSAFE) -#define ADDR_GLOBAL_ALLOW(i) &i -#else -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RD | CTLFLAG_MPSAFE) -#define ADDR_GLOBAL_ALLOW(i) NULL -#endif - SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", - "Processes in jail can set their hostnames"); + "Processes in jail can set their hostnames (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", - "Processes in jail are limited to creating UNIX/IP/route sockets only"); + "Processes in jail are limited to creating UNIX/IP/route sockets only (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", - "Processes in jail can use System V IPC primitives"); + "Processes in jail can use System V IPC primitives (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", - "Prison root can create raw sockets"); + "Prison root can create raw sockets (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", - "Processes in jail can alter system file flags"); + "Processes in jail can alter system file flags (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", - "Processes in jail can mount/unmount jail-friendly file systems"); + "Processes in jail can mount/unmount jail-friendly file systems (deprecated)"); static int sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) @@ -3669,33 +3626,25 @@ sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) int level, error; pr = req->td->td_ucred->cr_prison; -#ifdef PR_GLOBAL_ALLOW level = (pr == &prison0) ? *(int *)arg1 : *(int *)((char *)pr + arg2); -#else - level = *(int *)((char *)pr + arg2); -#endif error = sysctl_handle_int(oidp, &level, 0, req); - if (error) + if (error || !req->newptr) return (error); -#ifdef PR_GLOBAL_ALLOW - if (req->newptr) - *(int *)arg1 = level; -#endif + *(int *)arg1 = level; return (0); } SYSCTL_PROC(_security_jail, OID_AUTO, enforce_statfs, - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, - ADDR_GLOBAL_ALLOW(jail_default_enforce_statfs), - offsetof(struct prison, pr_enforce_statfs), + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + &jail_default_enforce_statfs, offsetof(struct prison, pr_enforce_statfs), sysctl_jail_default_level, "I", - "Processes in jail cannot see all mounted file systems"); + "Processes in jail cannot see all mounted file systems (deprecated)"); + SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, - ADDR_GLOBAL_ALLOW(jail_default_devfs_rsnum), - offsetof(struct prison, pr_devfs_rsnum), + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + &jail_default_devfs_rsnum, offsetof(struct prison, pr_devfs_rsnum), sysctl_jail_default_level, "I", - "Ruleset for the devfs filesystem in jail"); + "Ruleset for the devfs filesystem in jail (deprecated)"); /* * Nodes to describe jail parameters. Maximum length of string parameters @@ -3836,6 +3785,9 @@ prison_add_allow(const char *prefix, const char *name, struct bool_flags *bf; struct sysctl_oid *parent; char *allow_name, *allow_noname, *allowed; +#ifndef NO_SYSCTL_DESCR + char *descr_deprecated; +#endif unsigned allow_flag; if (prefix @@ -3892,7 +3844,10 @@ prison_add_allow(const char *prefix, const char *name, bf->flag = allow_flag; mtx_unlock(&prison0.pr_mtx); - /* Create sysctls for the paramter, and the current permission. */ + /* + * Create sysctls for the paramter, and the back-compat global + * permission. + */ parent = prefix ? SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), @@ -3904,10 +3859,17 @@ prison_add_allow(const char *prefix, const char *name, if ((prefix ? asprintf(&allowed, M_TEMP, "%s_%s_allowed", prefix, name) : asprintf(&allowed, M_TEMP, "%s_allowed", name)) >= 0) { +#ifndef NO_SYSCTL_DESCR + (void)asprintf(&descr_deprecated, M_TEMP, "%s (deprecated)", + descr); +#endif (void)SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, allowed, - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, allow_flag, - sysctl_jail_default_allow, "I", descr); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, allow_flag, + sysctl_jail_default_allow, "I", descr_deprecated); +#ifndef NO_SYSCTL_DESCR + free(descr_deprecated, M_TEMP); +#endif free(allowed, M_TEMP); } return allow_flag; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/kern/syscalls.c Thu Aug 16 19:09:43 2018 (r337925) @@ -344,7 +344,7 @@ const char *syscallnames[] = { "utrace", /* 335 = utrace */ "compat4.sendfile", /* 336 = freebsd4 sendfile */ "kldsym", /* 337 = kldsym */ - "compat11.jail", /* 338 = freebsd11 jail */ + "jail", /* 338 = jail */ "nnpfs_syscall", /* 339 = nnpfs_syscall */ "sigprocmask", /* 340 = sigprocmask */ "sigsuspend", /* 341 = sigsuspend */ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/kern/syscalls.master Thu Aug 16 19:09:43 2018 (r337925) @@ -738,7 +738,7 @@ _Out_opt_ off_t *sbytes, int flags); } 337 AUE_NULL STD { int kldsym(int fileid, int cmd, \ _In_ void *data); } -338 AUE_JAIL COMPAT11 { int jail( \ +338 AUE_JAIL STD { int jail( \ _In_ struct jail *jail); } 339 AUE_NULL NOSTD|NOTSTATIC { int nnpfs_syscall(int operation, \ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/kern/systrace_args.c Thu Aug 16 19:09:43 2018 (r337925) @@ -1593,6 +1593,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } + /* jail */ + case 338: { + struct jail_args *p = params; + uarg[0] = (intptr_t) p->jail; /* struct jail * */ + *n_args = 1; + break; + } /* nnpfs_syscall */ case 339: { struct nnpfs_syscall_args *p = params; @@ -5765,6 +5772,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* jail */ + case 338: + switch(ndx) { + case 0: + p = "userland struct jail *"; + break; + default: + break; + }; + break; /* nnpfs_syscall */ case 339: switch(ndx) { @@ -9627,6 +9644,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* kldsym */ case 337: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* jail */ + case 338: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/sys/jail.h Thu Aug 16 19:09:43 2018 (r337925) @@ -32,7 +32,6 @@ #ifndef _SYS_JAIL_H_ #define _SYS_JAIL_H_ -#ifdef COMPAT_FREEBSD11 #ifdef _KERNEL struct jail_v0 { u_int32_t version; @@ -58,6 +57,16 @@ struct jail { * For all xprison structs, always keep the pr_version an int and * the first variable so userspace can easily distinguish them. */ +#ifndef _KERNEL +struct xprison_v1 { + int pr_version; + int pr_id; + char pr_path[MAXPATHLEN]; + char pr_host[MAXHOSTNAMELEN]; + u_int32_t pr_ip; +}; +#endif + struct xprison { int pr_version; int pr_id; @@ -82,7 +91,6 @@ struct xprison { #define PRISON_STATE_INVALID 0 #define PRISON_STATE_ALIVE 1 #define PRISON_STATE_DYING 2 -#endif /* COMPAT_FREEBSD11 */ /* * Flags for jail_set and jail_get. @@ -102,6 +110,7 @@ struct xprison { struct iovec; +int jail(struct jail *); int jail_set(struct iovec *, unsigned int, int); int jail_get(struct iovec *, unsigned int, int); int jail_attach(int); Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/sys/syscall.h Thu Aug 16 19:09:43 2018 (r337925) @@ -280,7 +280,7 @@ #define SYS_utrace 335 /* 336 is freebsd4 sendfile */ #define SYS_kldsym 337 -#define SYS_freebsd11_jail 338 +#define SYS_jail 338 #define SYS_nnpfs_syscall 339 #define SYS_sigprocmask 340 #define SYS_sigsuspend 341 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/sys/syscall.mk Thu Aug 16 19:09:43 2018 (r337925) @@ -209,7 +209,7 @@ MIASM = \ sched_rr_get_interval.o \ utrace.o \ kldsym.o \ - freebsd11_jail.o \ + jail.o \ nnpfs_syscall.o \ sigprocmask.o \ sigsuspend.o \ Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/sys/syscallsubr.h Thu Aug 16 19:09:43 2018 (r337925) @@ -143,6 +143,7 @@ int kern_getsockname(struct thread *td, int fd, struct int kern_getsockopt(struct thread *td, int s, int level, int name, void *optval, enum uio_seg valseg, socklen_t *valsize); int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data); +int kern_jail(struct thread *td, struct jail *j); int kern_jail_get(struct thread *td, struct uio *options, int flags); int kern_jail_set(struct thread *td, struct uio *options, int flags); int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, @@ -307,6 +308,5 @@ struct freebsd11_dirent; int freebsd11_kern_getdirentries(struct thread *td, int fd, char *ubuf, u_int count, long *basep, void (*func)(struct freebsd11_dirent *)); -int freebsd11_kern_jail(struct thread *td, struct jail *j); #endif /* !_SYS_SYSCALLSUBR_H_ */ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Aug 16 18:58:34 2018 (r337924) +++ head/sys/sys/sysproto.h Thu Aug 16 19:09:43 2018 (r337925) @@ -849,6 +849,9 @@ struct kldsym_args { char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; }; +struct jail_args { + char jail_l_[PADL_(struct jail *)]; struct jail * jail; char jail_r_[PADR_(struct jail *)]; +}; struct nnpfs_syscall_args { char operation_l_[PADL_(int)]; int operation; char operation_r_[PADR_(int)]; char a_pathP_l_[PADL_(char *)]; char * a_pathP; char a_pathP_r_[PADR_(char *)]; @@ -1958,6 +1961,7 @@ int sys_sched_get_priority_min(struct thread *, struct int sys_sched_rr_get_interval(struct thread *, struct sched_rr_get_interval_args *); int sys_utrace(struct thread *, struct utrace_args *); int sys_kldsym(struct thread *, struct kldsym_args *); +int sys_jail(struct thread *, struct jail_args *); int sys_nnpfs_syscall(struct thread *, struct nnpfs_syscall_args *); int sys_sigprocmask(struct thread *, struct sigprocmask_args *); int sys_sigsuspend(struct thread *, struct sigsuspend_args *); @@ -2527,9 +2531,6 @@ struct freebsd11_fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * sb; char sb_r_[PADR_(struct freebsd11_stat *)]; }; -struct freebsd11_jail_args { - char jail_l_[PADL_(struct jail *)]; struct jail * jail; char jail_r_[PADR_(struct jail *)]; -}; struct freebsd11_kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(struct kevent_freebsd11 *)]; struct kevent_freebsd11 * changelist; char changelist_r_[PADR_(struct kevent_freebsd11 *)]; @@ -2578,7 +2579,6 @@ int freebsd11_nstat(struct thread *, struct freebsd11_ int freebsd11_nfstat(struct thread *, struct freebsd11_nfstat_args *); int freebsd11_nlstat(struct thread *, struct freebsd11_nlstat_args *); int freebsd11_fhstat(struct thread *, struct freebsd11_fhstat_args *); -int freebsd11_jail(struct thread *, struct freebsd11_jail_args *); int freebsd11_kevent(struct thread *, struct freebsd11_kevent_args *); int freebsd11_getfsstat(struct thread *, struct freebsd11_getfsstat_args *); int freebsd11_statfs(struct thread *, struct freebsd11_statfs_args *); @@ -2849,7 +2849,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_utrace AUE_NULL #define SYS_AUE_freebsd4_sendfile AUE_SENDFILE #define SYS_AUE_kldsym AUE_NULL -#define SYS_AUE_freebsd11_jail AUE_JAIL +#define SYS_AUE_jail AUE_JAIL #define SYS_AUE_nnpfs_syscall AUE_NULL #define SYS_AUE_sigprocmask AUE_SIGPROCMASK #define SYS_AUE_sigsuspend AUE_SIGSUSPEND From owner-svn-src-all@freebsd.org Thu Aug 16 19:10:17 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 3FE80107351A; Thu, 16 Aug 2018 19:10:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6A96740F4; Thu, 16 Aug 2018 19:10:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 9813788E1; Thu, 16 Aug 2018 19:10:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E06FF11C4; Thu, 16 Aug 2018 19:10:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id o-5tm2fmobKw; Thu, 16 Aug 2018 19:10:11 +0000 (UTC) Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com BE03A11B9 To: Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8FAlJp hmsCGwwFCQlmAYAACgkQNddxu25Gl89UPggA2mGQp28yCUKsJ6KHFVy/lpHfoQrKF+s7HfKT U2ObVeVNX4I8ZdW1UO48mRqxEOwY8r5YSH6X06OmiqCX2aSMXg3N06/l+ztlB0+UGGlkXBjv l9/nii+bC6b8XWuu0X7Qpb9oYBK9YtoaoyuVplAmjdj/cPou65meKIaS1yDTjHh450DrW8Qg he6l0bFX4BHKTSm99U90ML7EY19B6iI2BZSqWutVsyD71oAREY6NGgDpCOIO6FS41+WeYCDR j8vsa/BiaoX2d2SBDsCwsEwe9fg5PYMi2uVIhvL6OrxnwOdB+TkgvOy5zZSNO29UG/JilZKo Ndz2wpEaUzChGGqLvcLAZQQYAQoADwIbDAUCWujOKAUJCmB7PQAKCRA113G7bkaXz6bkB/9H dUR3E0wBwMh6z0AOFDKh+PbRI9Xd4IncdhE55tNK410650a3gADIDwqz3i72GIinkgaxzpEO xP1bs7a+BeF3p5Xd6Jjk6J/nEshisgNW7VjUbJHFGs8Sf9A6oM3q4VkI/ArVo5qkZxgKs72U HSAy5NV+AdqdTrWuAL20xfQ6gA7JF35Xf8zyUM2GMl0X8ik7dJ1jMp+TB27LipqbDgamFzH9 F9hC9gur94OQ/x3nQ+mFZ1uipYHA1EdrKuhb/Ts4bN/Ezl8nmYGxc9Bw7ZBxGOTId/rEIzoe LWpAvg6dcw0T9lNfSWc6PX+kf3dOXNIdkw9NqKID8wEPe8axcGYG Organization: FreeBSD Message-ID: <57eef2b1-d126-a8da-c45a-d8cab0373a08@FreeBSD.org> Date: Thu, 16 Aug 2018 12:10:09 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="09uLwxXBfFgATWp4unUV8tJhiGwGIkFYk" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:10:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --09uLwxXBfFgATWp4unUV8tJhiGwGIkFYk Content-Type: multipart/mixed; boundary="kD1giywAopNArsMYWJtuMqrGyikLn20uk"; protected-headers="v1" From: Bryan Drewery To: Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <57eef2b1-d126-a8da-c45a-d8cab0373a08@FreeBSD.org> Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> In-Reply-To: <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> --kD1giywAopNArsMYWJtuMqrGyikLn20uk Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/16/18 11:47 AM, Larry Rosenman wrote: > On Thu, Aug 16, 2018 at 11:34:59AM -0700, Bryan Drewery wrote: >> On 8/16/18 11:21 AM, Larry Rosenman wrote: >>> On Thu, Aug 16, 2018 at 02:02:52PM -0400, Jung-uk Kim wrote: >>>> On 18. 8. 16., Larry Rosenman wrote: >>>>> On Thu, Aug 16, 2018 at 01:48:40PM -0400, Jung-uk Kim wrote: >>>>>> On 18. 8. 16., Ravi Pokala wrote: >>>>>>> -----Original Message----- >>>>>>> From: on behalf of Jung-uk Kim= >>>>>>> Date: 2018-08-14, Tuesday at 10:48 >>>>>>> To: , , >>>>>>> Subject: svn commit: r337791 - in head: crypto/openssl crypto/ope= nssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl= /crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... >>>>>>> >>>>>>>> Author: jkim >>>>>>>> Date: Tue Aug 14 17:48:02 2018 >>>>>>>> New Revision: 337791 >>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/337791 >>>>>>>> >>>>>>>> Log: >>>>>>>> Merge OpenSSL 1.0.2p. >>>>>>> >>>>>>> Is it just me, or did this change break all the worlds? >>>>>>> >>>>>>> I got errors like this: >>>>>>> >>>>>>> ---------------------------------------------------------------- >>>>>>> /usr/bin/ld: error: undefined symbol: main >>>>>>>>>> referenced by crt1.c:74 (/usr/home/rpokala/freebsd/clean/base/= head/lib/csu/amd64/crt1.c:74) >>>>>>>>>> /build/usr/home/rpokala/freebsd/clean/base/head/= amd64.amd64/tmp/usr/lib/crt1.o:(_start) >>>>>>> >>>>>>> /usr/bin/ld: error: undefined symbol: Fssh_error >>>>>>>>>> referenced by moduli.c:257 (/usr/home/rpokala/freebsd/clean/ba= se/head/crypto/openssh/moduli.c:257) >>>>>>>>>> /tmp/moduli-6780ab.o:(Fssh_gen_candidates) >>>>>>> ---------------------------------------------------------------- >>>>>>> >>>>>>> At first I thought it was because I was rebuilding without cleani= ng, but I nuked the tree and rebuilt from scratch, and got the same error= =2E >>>>>>> >>>>>>> I didn't bisect it to this change, but it's the only recent chang= e to crypto... >>>>>> >>>>>> I built worlds many times and I haven't seen such problem. In fac= t, >>>>>> Jenkins didn't break on amd64 after the commit. >>>>>> >>>>>> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ >>>>> Do you or jenkins run with meta-mode? That seems to be a necessary= >>>>> condition for the failure. >>>> I don't do meta-mode. I don't know much about Jenkins build but I d= on't >>>> think it does. Is it a requirement now? >>>> >> >> Jenkins doesn't use META_MODE and it's not a requirement. >=20 > Can you (bdrewery@) possibly diagnose why meta-mode is messing this up > with the moduli file? >=20 >> Sure. I'm hitting it as well. --=20 Regards, Bryan Drewery --kD1giywAopNArsMYWJtuMqrGyikLn20uk-- --09uLwxXBfFgATWp4unUV8tJhiGwGIkFYk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlt1zBEACgkQNddxu25G l8/YRwgAzLhDnUsq1mzLU4IyESuUorGuxai/vSyxu1PbVnhwZAFZtYZN/iNqxLhR Npg3qh8hsx6s/5/eiXwadhqOa0aQ5vClFMhGGtbswmJ+QJlE+1v49eW4b2dzjq2l IU3F4bcNpDdklHPp4/bW8enmKbt6GwuKVrs+Tck18NBv1JUoma4Y3zrXhQ12/rYV XdOrir41w804GysEn0bxa6pqZq32ywHQ6M8A9U2mx9F3s8Nc1uBfEFbeo6+eq1GX +ASzXAEtQ+Og1F1pGspk85n2EWT5VvDNavUZtBJy3PF5rC6ImukU74GdO9MX+M5z 6I7yGtcqr1NBHYhoNaO79ojPbVgHQQ== =xSJ3 -----END PGP SIGNATURE----- --09uLwxXBfFgATWp4unUV8tJhiGwGIkFYk-- From owner-svn-src-all@freebsd.org Thu Aug 16 19:14: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 47AAD1073881 for ; Thu, 16 Aug 2018 19:14:15 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2E0D74619 for ; Thu, 16 Aug 2018 19:14:14 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 8c08582d-a188-11e8-aff6-0b9b8210da61 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 8c08582d-a188-11e8-aff6-0b9b8210da61; Thu, 16 Aug 2018 19:14:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7GJE6xt078509; Thu, 16 Aug 2018 13:14:06 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534446846.1466.43.camel@freebsd.org> Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... From: Ian Lepore To: Bryan Drewery , Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 16 Aug 2018 13:14:06 -0600 In-Reply-To: <57eef2b1-d126-a8da-c45a-d8cab0373a08@FreeBSD.org> References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> <57eef2b1-d126-a8da-c45a-d8cab0373a08@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:14:15 -0000 On Thu, 2018-08-16 at 12:10 -0700, Bryan Drewery wrote: > On 8/16/18 11:47 AM, Larry Rosenman wrote: > > > > On Thu, Aug 16, 2018 at 11:34:59AM -0700, Bryan Drewery wrote: > > > > > > On 8/16/18 11:21 AM, Larry Rosenman wrote: > > > > > > > > On Thu, Aug 16, 2018 at 02:02:52PM -0400, Jung-uk Kim wrote: > > > > > > > > > > On 18. 8. 16., Larry Rosenman wrote: > > > > > > > > > > > > On Thu, Aug 16, 2018 at 01:48:40PM -0400, Jung-uk Kim > > > > > > wrote: > > > > > > > > > > > > > > On 18. 8. 16., Ravi Pokala wrote: > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > > > From: on behalf of > > > > > > > > Jung-uk Kim > > > > > > > > Date: 2018-08-14, Tuesday at 10:48 > > > > > > > > To: , > > > > > > > org>, > > > > > > > > Subject: svn commit: r337791 - in head: crypto/openssl > > > > > > > > crypto/openssl/apps crypto/openssl/crypto > > > > > > > > crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio > > > > > > > > crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm > > > > > > > > cr... > > > > > > > > > > > > > > > > > > > > > > > > > > Author: jkim > > > > > > > > > Date: Tue Aug 14 17:48:02 2018 > > > > > > > > > New Revision: 337791 > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/337791 > > > > > > > > > > > > > > > > > > Log: > > > > > > > > >   Merge OpenSSL 1.0.2p. > > > > > > > > Is it just me, or did this change break all the worlds? > > > > > > > > > > > > > > > > I got errors like this: > > > > > > > > > > > > > > > > ----------------------------------------------------- > > > > > > > > ----------- > > > > > > > > /usr/bin/ld: error: undefined symbol: main > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > referenced by crt1.c:74 > > > > > > > > > > > (/usr/home/rpokala/freebsd/clean/base/head/lib/cs > > > > > > > > > > > u/amd64/crt1.c:74) > > > > > > > > > > >               /build/usr/home/rpokala/freebsd/cle > > > > > > > > > > > an/base/head/amd64.amd64/tmp/usr/lib/crt1.o:(_sta > > > > > > > > > > > rt) > > > > > > > > /usr/bin/ld: error: undefined symbol: Fssh_error > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > referenced by moduli.c:257 > > > > > > > > > > > (/usr/home/rpokala/freebsd/clean/base/head/crypto > > > > > > > > > > > /openssh/moduli.c:257) > > > > > > > > > > >               /tmp/moduli- > > > > > > > > > > > 6780ab.o:(Fssh_gen_candidates) > > > > > > > > ----------------------------------------------------- > > > > > > > > ----------- > > > > > > > > > > > > > > > > At first I thought it was because I was rebuilding > > > > > > > > without cleaning, but I nuked the tree and rebuilt from > > > > > > > > scratch, and got the same error. > > > > > > > > > > > > > > > > I didn't bisect it to this change, but it's the only > > > > > > > > recent change to crypto... > > > > > > > I built worlds many times and I haven't seen such > > > > > > > problem.  In fact, > > > > > > > Jenkins didn't break on amd64 after the commit. > > > > > > > > > > > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ > > > > > > Do you or jenkins run with meta-mode?  That seems to be a > > > > > > necessary > > > > > > condition for the failure. > > > > > I don't do meta-mode.  I don't know much about Jenkins build > > > > > but I don't > > > > > think it does.  Is it a requirement now? > > > > > > > > Jenkins doesn't use META_MODE and it's not a requirement. > > Can you (bdrewery@) possibly diagnose why meta-mode is messing this > > up > > with the moduli file? > > > > > > > > > Sure. I'm hitting it as well. > > There's a thread about it in -current@ too. -- Ian From owner-svn-src-all@freebsd.org Thu Aug 16 19:18:25 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 14A691073AB7 for ; Thu, 16 Aug 2018 19:18:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (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 941C7748D8 for ; Thu, 16 Aug 2018 19:18:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x232.google.com with SMTP id n18-v6so4793127ioa.9 for ; Thu, 16 Aug 2018 12:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=/Io/AE8ac9YGAGnEvOdoTrqZ68PP0uSUqehATenl3cA=; b=aEcfKe92ZCbECgK0Ah6CFZ+CT9UbJ26I7KFKgPnPCq3AbpZ03rBf0f2Fimhcgt7BiC SIk8A2db62YkW2FwOPi65y/r1jcCrgghgavCUe1F9yex7c0Yqos+4xHC7Jj7bX1bdIWh g3uO7GJ3Xi8gWy8A1avG1BwWDizUIZ/FgUpnkcypQqDY+0AAvr3y7W0wWg6Hw18vCvVK FSrQflf/RaoWBUH1lctwNiyhMLnb9lN8UQCALB2iTDrbAoQIGSLWRbFCNH53nGXBZ/0U l1t1P0jvP7EwKXO3lpwHlsePg6lOz+huzLh6+qJ8f+Y0bc2r/P8+CTJgdHDl/hBI9/3l v1SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=/Io/AE8ac9YGAGnEvOdoTrqZ68PP0uSUqehATenl3cA=; b=mD/V4H2eGS8CU26fp4O23SXVDlkx2NtJgUUlDOnmDboxY3Mkg3Df5S0LsRxR1jxlfb 1RKBgWNCBe6j+Pzt9y9NzrMiZMjo4kbl/YGBh8ks7h5OCX9RZhsBFmwlKJuAyckCyCCA MMAn36YqFiMYjqOsHrSlms265p3RO6yr0eN4QpmuM6q9NHoAPNnhPclkHUpiFT8yTtAo KUAinsSp2mXqcMfHc281Lof6osXZ1CEDy3JytcSqnE0tLMPJ3/jIV+Pp8HE2Hmekgk+Z 5t/z56HevkCYwh4GIcpTE1/OrQpXGmCfkGBtedf8aIoti8fxBTfD9PnYAGabfOD7kB8m EL3w== X-Gm-Message-State: AOUpUlHMM6aNob+m4LfajnDK1VBSvu6xST2iVQkF3OvvGSjFuN8974fR QS+sstaGHPTfJSFBsoJG1BJdJ0srF4oKyjHBcQPilw== X-Google-Smtp-Source: AA+uWPwx1F7gvdT+UTykIal0MNj9vPx3KYQ4laSIyhkygRwCI7dJKX7vUeI2l2gSorIaChH9k6exVeplRYBHocl//pM= X-Received: by 2002:a6b:d004:: with SMTP id x4-v6mr26394356ioa.299.1534447103913; Thu, 16 Aug 2018 12:18:23 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 12:18:23 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180816170650.GX97145@funkthat.com> References: <201808160631.w7G6VsS8064579@repo.freebsd.org> <20180816170650.GX97145@funkthat.com> From: Warner Losh Date: Thu, 16 Aug 2018 13:18:23 -0600 X-Google-Sender-Auth: FMwZPbUhUFcAP-Cpyu3j4bCH8vM Message-ID: Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve To: John-Mark Gurney , Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:18:25 -0000 On Thu, Aug 16, 2018 at 11:06 AM, John-Mark Gurney wrote: > Marcelo Araujo wrote this message on Thu, Aug 16, 2018 at 06:31 +0000: > > Author: araujo > > Date: Thu Aug 16 06:31:54 2018 > > New Revision: 337887 > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > Log: > > Add a comment explaining how the PSN works and why there is no need for > > a null terminator. Also mark CID 1394825 as intentional. > > > > Reported by: Coverity > > CID: 1394825 > > MFC after: 1 week > > Sponsored by: iXsystems Inc. > > > > Modified: > > head/usr.sbin/bhyve/pci_nvme.c > > > > Modified: head/usr.sbin/bhyve/pci_nvme.c > > ============================================================ > ================== > > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > (r337886) > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > (r337887) > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, > char *o > > [...] > > > memset(sc->ctrldata.sn, 0, sizeof(sc->ctrldata.sn > )); > > strncpy(sc->ctrldata.sn, config, > > sizeof(sc->ctrldata.sn)); > > This memset is unneeded, as strncpy will write NUL bytes to fill out > the buffer: > If src is less than len characters long, the remainder of > dst is filled with `\0' characters. > It also looks like the comment was wrong. The newest NVMe standards say these fields should be 7-bit and space-padded. Warner From owner-svn-src-all@freebsd.org Thu Aug 16 19:27: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 83E2A10740CE; Thu, 16 Aug 2018 19:27:18 +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 974D374EFF; Thu, 16 Aug 2018 19:27:17 +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 w7GJRFWQ055396; Thu, 16 Aug 2018 12:27:15 -0700 (PDT) (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 w7GJRF1Q055395; Thu, 16 Aug 2018 12:27:15 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808161927.w7GJRF1Q055395@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337925 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys In-Reply-To: <201808161909.w7GJ9hXt060717@repo.freebsd.org> To: Jamie Gritton Date: Thu, 16 Aug 2018 12:27:15 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:27:19 -0000 > Author: jamie > Date: Thu Aug 16 19:09:43 2018 > New Revision: 337925 > URL: https://svnweb.freebsd.org/changeset/base/337925 > > Log: > Revert r337922, except for some documention-only bits. This needs to wait > until user is changed to stop using jail(2). Can we please stop doing "partial" reverts, it makes log tracking and sorting out stuff later more difficult. If something is seperable and needs to stay it is best to revert the whole commit, and then commit with a proper log exactly what it is that you did not want to revert. > > Differential Revision: D14791 > > Modified: > head/lib/libc/sys/jail.2 > head/sys/compat/freebsd32/freebsd32_misc.c > head/sys/compat/freebsd32/freebsd32_proto.h > head/sys/compat/freebsd32/freebsd32_syscall.h > head/sys/compat/freebsd32/freebsd32_syscalls.c > head/sys/compat/freebsd32/freebsd32_sysent.c > head/sys/compat/freebsd32/freebsd32_systrace_args.c > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/init_sysent.c > head/sys/kern/kern_jail.c > head/sys/kern/syscalls.c > head/sys/kern/syscalls.master > head/sys/kern/systrace_args.c > head/sys/sys/jail.h > head/sys/sys/syscall.h > head/sys/sys/syscall.mk > head/sys/sys/syscallsubr.h > head/sys/sys/sysproto.h > > Modified: head/lib/libc/sys/jail.2 > ============================================================================== > --- head/lib/libc/sys/jail.2 Thu Aug 16 18:58:34 2018 (r337924) > +++ head/lib/libc/sys/jail.2 Thu Aug 16 19:09:43 2018 (r337925) > @@ -25,10 +25,11 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 16, 2018 > +.Dd February 8, 2012 > .Dt JAIL 2 > .Os > .Sh NAME > +.Nm jail , > .Nm jail_get , > .Nm jail_set , > .Nm jail_remove , > @@ -40,6 +41,8 @@ > .In sys/param.h > .In sys/jail.h > .Ft int > +.Fn jail "struct jail *jail" > +.Ft int > .Fn jail_attach "int jid" > .Ft int > .Fn jail_remove "int jid" > @@ -50,7 +53,74 @@ > .Fn jail_set "struct iovec *iov" "u_int niov" "int flags" > .Sh DESCRIPTION > The > +.Fn jail > +system call sets up a jail and locks the current process in it. > +.Pp > +The argument is a pointer to a structure describing the prison: > +.Bd -literal -offset indent > +struct jail { > + uint32_t version; > + char *path; > + char *hostname; > + char *jailname; > + unsigned int ip4s; > + unsigned int ip6s; > + struct in_addr *ip4; > + struct in6_addr *ip6; > +}; > +.Ed > +.Pp > +.Dq Li version > +defines the version of the API in use. > +.Dv JAIL_API_VERSION > +is defined for the current version. > +.Pp > +The > +.Dq Li path > +pointer should be set to the directory which is to be the root of the > +prison. > +.Pp > +The > +.Dq Li hostname > +pointer can be set to the hostname of the prison. > +This can be changed > +from the inside of the prison. > +.Pp > +The > +.Dq Li jailname > +pointer is an optional name that can be assigned to the jail > +for example for management purposes. > +.Pp > +The > +.Dq Li ip4s > +and > +.Dq Li ip6s > +give the numbers of IPv4 and IPv6 addresses that will be passed > +via their respective pointers. > +.Pp > +The > +.Dq Li ip4 > +and > +.Dq Li ip6 > +pointers can be set to an arrays of IPv4 and IPv6 addresses to be assigned to > +the prison, or NULL if none. > +IPv4 addresses must be in network byte order. > +.Pp > +This is equivalent to, and deprecated in favor of, the > .Fn jail_set > +system call (see below), with the parameters > +.Va path , > +.Va host.hostname , > +.Va name , > +.Va ip4.addr , > +and > +.Va ip6.addr , > +and with the > +.Dv JAIL_ATTACH > +flag. > +.Pp > +The > +.Fn jail_set > system call creates a new jail, or modifies an existing one, and optionally > locks the current process in it. > Jail parameters are passed as an array of name-value pairs in the array > @@ -76,19 +146,13 @@ The current set of available parameters, and their for > retrieved via the > .Va security.jail.param > sysctl MIB entry. > -Notable parameters include > +Notable parameters include those mentioned in the > +.Fn jail > +description above, as well as > .Va jid > and > -.Va name > -which identify the jail being created or modified, > -.Va path > -(the root directory of the jail), > -.Va host.hostname > -(the hostname of the jail), and > -.Va ip4.addr > -and > -.Va ip6.addr > -(IP addresses to assign to the jail). > +.Va name , > +which identify the jail being created or modified. > See > .Xr jail 8 > for more information on the core jail parameters. > @@ -173,7 +237,8 @@ It will kill all processes belonging to the jail, and > of that jail. > .Sh RETURN VALUES > If successful, > -.Fn jail_set > +.Fn jail , > +.Fn jail_set , > and > .Fn jail_get > return a non-negative integer, termed the jail identifier (JID). > @@ -184,6 +249,25 @@ to indicate the error. > .Rv -std jail_attach jail_remove > .Sh ERRORS > The > +.Fn jail > +system call > +will fail if: > +.Bl -tag -width Er > +.It Bq Er EPERM > +This process is not allowed to create a jail, either because it is not > +the super-user, or because it would exceed the jail's > +.Va children.max > +limit. > +.It Bq Er EFAULT > +.Fa jail > +points to an address outside the allocated address space of the process. > +.It Bq Er EINVAL > +The version number of the argument is not correct. > +.It Bq Er EAGAIN > +No free JID could be found. > +.El > +.Pp > +The > .Fn jail_set > system call > will fail if: > @@ -287,7 +371,8 @@ does not exist. > .El > .Pp > Further > -.Fn jail_set > +.Fn jail , > +.Fn jail_set , > and > .Fn jail_attach > call > @@ -301,7 +386,7 @@ manual page for details. > .Xr chroot 2 , > .Xr jail 8 > .Sh HISTORY > -The now-deprecated > +The > .Fn jail > system call appeared in > .Fx 4.0 . > > Modified: head/sys/compat/freebsd32/freebsd32_misc.c > ============================================================================== > --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 19:09:43 2018 (r337925) > @@ -2289,10 +2289,8 @@ freebsd32_sysctl(struct thread *td, struct freebsd32_s > return (0); > } > > -#ifdef COMPAT_FREEBSD11 > int > -freebsd11_freebsd32_jail(struct thread *td, > - struct freebsd11_freebsd32_jail_args *uap) > +freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) > { > uint32_t version; > int error; > @@ -2349,9 +2347,8 @@ freebsd11_freebsd32_jail(struct thread *td, > /* Sci-Fi jails are not supported, sorry. */ > return (EINVAL); > } > - return (freebsd11_kern_jail(td, &j)); > + return (kern_jail(td, &j)); > } > -#endif /* COMPAT_FREEBSD11 */ > > int > freebsd32_jail_set(struct thread *td, struct freebsd32_jail_set_args *uap) > > Modified: head/sys/compat/freebsd32/freebsd32_proto.h > ============================================================================== > --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 19:09:43 2018 (r337925) > @@ -283,6 +283,9 @@ struct freebsd32_sched_rr_get_interval_args { > char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; > char interval_l_[PADL_(struct timespec32 *)]; struct timespec32 * interval; char interval_r_[PADR_(struct timespec32 *)]; > }; > +struct freebsd32_jail_args { > + char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char jail_r_[PADR_(struct jail32 *)]; > +}; > struct freebsd32_sigtimedwait_args { > char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; > char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; > @@ -758,6 +761,7 @@ int freebsd32_aio_return(struct thread *, struct freeb > int freebsd32_aio_suspend(struct thread *, struct freebsd32_aio_suspend_args *); > int freebsd32_aio_error(struct thread *, struct freebsd32_aio_error_args *); > int freebsd32_sched_rr_get_interval(struct thread *, struct freebsd32_sched_rr_get_interval_args *); > +int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); > int freebsd32_sigtimedwait(struct thread *, struct freebsd32_sigtimedwait_args *); > int freebsd32_sigwaitinfo(struct thread *, struct freebsd32_sigwaitinfo_args *); > int freebsd32_aio_waitcomplete(struct thread *, struct freebsd32_aio_waitcomplete_args *); > @@ -1180,9 +1184,6 @@ struct freebsd11_freebsd32_fhstat_args { > char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; > char sb_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * sb; char sb_r_[PADR_(struct freebsd11_stat32 *)]; > }; > -struct freebsd11_freebsd32_jail_args { > - char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char jail_r_[PADR_(struct jail32 *)]; > -}; > struct freebsd11_freebsd32_kevent_args { > char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; > char changelist_l_[PADL_(const struct kevent32_freebsd11 *)]; const struct kevent32_freebsd11 * changelist; char changelist_r_[PADR_(const struct kevent32_freebsd11 *)]; > @@ -1222,7 +1223,6 @@ int freebsd11_freebsd32_lstat(struct thread *, struct > int freebsd11_freebsd32_getdirentries(struct thread *, struct freebsd11_freebsd32_getdirentries_args *); > int freebsd11_freebsd32_getdents(struct thread *, struct freebsd11_freebsd32_getdents_args *); > int freebsd11_freebsd32_fhstat(struct thread *, struct freebsd11_freebsd32_fhstat_args *); > -int freebsd11_freebsd32_jail(struct thread *, struct freebsd11_freebsd32_jail_args *); > int freebsd11_freebsd32_kevent(struct thread *, struct freebsd11_freebsd32_kevent_args *); > int freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fstatat_args *); > int freebsd11_freebsd32_mknodat(struct thread *, struct freebsd11_freebsd32_mknodat_args *); > @@ -1317,7 +1317,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, struc > #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_LIO_LISTIO > #define FREEBSD32_SYS_AUE_freebsd32_sched_rr_get_interval AUE_NULL > #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE > -#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_jail AUE_JAIL > +#define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL > #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION > #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN > #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT > > Modified: head/sys/compat/freebsd32/freebsd32_syscall.h > ============================================================================== > --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 19:09:43 2018 (r337925) > @@ -275,7 +275,7 @@ > #define FREEBSD32_SYS_utrace 335 > /* 336 is freebsd4 freebsd32_sendfile */ > #define FREEBSD32_SYS_kldsym 337 > -#define FREEBSD32_SYS_freebsd11_freebsd32_jail 338 > +#define FREEBSD32_SYS_freebsd32_jail 338 > #define FREEBSD32_SYS_sigprocmask 340 > #define FREEBSD32_SYS_sigsuspend 341 > /* 342 is freebsd4 freebsd32_sigaction */ > > Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c > ============================================================================== > --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 19:09:43 2018 (r337925) > @@ -347,7 +347,7 @@ const char *freebsd32_syscallnames[] = { > "utrace", /* 335 = utrace */ > "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile */ > "kldsym", /* 337 = kldsym */ > - "compat11.freebsd32_jail", /* 338 = freebsd11 freebsd32_jail */ > + "freebsd32_jail", /* 338 = freebsd32_jail */ > "#339", /* 339 = pioctl */ > "sigprocmask", /* 340 = sigprocmask */ > "sigsuspend", /* 341 = sigsuspend */ > > Modified: head/sys/compat/freebsd32/freebsd32_sysent.c > ============================================================================== > --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 19:09:43 2018 (r337925) > @@ -394,7 +394,7 @@ struct sysent freebsd32_sysent[] = { > { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ > { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 freebsd32_sendfile */ > { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ > - { compat11(AS(freebsd11_freebsd32_jail_args),freebsd32_jail), AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 freebsd32_jail */ > + { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd32_jail */ > { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = pioctl */ > { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = sigprocmask */ > { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ > > Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c > ============================================================================== > --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 19:09:43 2018 (r337925) > @@ -1559,6 +1559,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg > *n_args = 3; > break; > } > + /* freebsd32_jail */ > + case 338: { > + struct freebsd32_jail_args *p = params; > + uarg[0] = (intptr_t) p->jail; /* struct jail32 * */ > + *n_args = 1; > + break; > + } > /* sigprocmask */ > case 340: { > struct sigprocmask_args *p = params; > @@ -5704,6 +5711,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d > break; > }; > break; > + /* freebsd32_jail */ > + case 338: > + switch(ndx) { > + case 0: > + p = "userland struct jail32 *"; > + break; > + default: > + break; > + }; > + break; > /* sigprocmask */ > case 340: > switch(ndx) { > @@ -9653,6 +9670,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * > break; > /* kldsym */ > case 337: > + if (ndx == 0 || ndx == 1) > + p = "int"; > + break; > + /* freebsd32_jail */ > + case 338: > if (ndx == 0 || ndx == 1) > p = "int"; > break; > > Modified: head/sys/compat/freebsd32/syscalls.master > ============================================================================== > --- head/sys/compat/freebsd32/syscalls.master Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 16 19:09:43 2018 (r337925) > @@ -601,7 +601,7 @@ > off_t *sbytes, int flags); } > 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ > void *data); } > -338 AUE_JAIL COMPAT11 { int freebsd32_jail(struct jail32 *jail); } > +338 AUE_JAIL STD { int freebsd32_jail(struct jail32 *jail); } > 339 AUE_NULL UNIMPL pioctl > 340 AUE_SIGPROCMASK NOPROTO { int sigprocmask(int how, \ > const sigset_t *set, sigset_t *oset); } > > Modified: head/sys/kern/init_sysent.c > ============================================================================== > --- head/sys/kern/init_sysent.c Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/kern/init_sysent.c Thu Aug 16 19:09:43 2018 (r337925) > @@ -387,7 +387,7 @@ struct sysent sysent[] = { > { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ > { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ > { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ > - { compat11(AS(freebsd11_jail_args),jail), AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 jail */ > + { AS(jail_args), (sy_call_t *)sys_jail, AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = jail */ > { AS(nnpfs_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ > { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = sigprocmask */ > { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ > > Modified: head/sys/kern/kern_jail.c > ============================================================================== > --- head/sys/kern/kern_jail.c Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/kern/kern_jail.c Thu Aug 16 19:09:43 2018 (r337925) > @@ -74,14 +74,6 @@ __FBSDID("$FreeBSD$"); > > #include > > -/* > - * The old jail(2) interface will exist under COMPAT_FREEBSD11, but the global > - * permission sysctls are slated to go away sometime (even with COMPAT). > - */ > -#if defined(COMPAT_FREEBSD11) && !defined(BURN_BRIDGES) > -#define PR_GLOBAL_ALLOW > -#endif > - > #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" > > MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); > @@ -207,11 +199,9 @@ const size_t pr_flag_allow_size = sizeof(pr_flag_allow > #define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | PR_ALLOW_RESERVED_PORTS) > #define JAIL_DEFAULT_ENFORCE_STATFS 2 > #define JAIL_DEFAULT_DEVFS_RSNUM 0 > -#ifdef PR_GLOBAL_ALLOW > static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; > static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; > static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; > -#endif > #if defined(INET) || defined(INET6) > static unsigned jail_max_af_ips = 255; > #endif > @@ -229,14 +219,13 @@ prison0_init(void) > strlcpy(prison0.pr_osrelease, osrelease, sizeof(prison0.pr_osrelease)); > } > > -#ifdef COMPAT_FREEBSD11 > /* > * struct jail_args { > * struct jail *jail; > * }; > */ > int > -freebsd11_jail(struct thread *td, struct freebsd11_jail_args *uap) > +sys_jail(struct thread *td, struct jail_args *uap) > { > uint32_t version; > int error; > @@ -281,16 +270,13 @@ freebsd11_jail(struct thread *td, struct freebsd11_jai > /* Sci-Fi jails are not supported, sorry. */ > return (EINVAL); > } > - return (freebsd11_kern_jail(td, &j)); > + return (kern_jail(td, &j)); > } > > int > -freebsd11_kern_jail(struct thread *td, struct jail *j) > +kern_jail(struct thread *td, struct jail *j) > { > - struct iovec optiov[2 * (3 > -#ifdef PR_GLOBAL_ALLOW > - + 1 + nitems(pr_flag_allow) > -#endif > + struct iovec optiov[2 * (4 + nitems(pr_flag_allow) > #ifdef INET > + 1 > #endif > @@ -300,10 +286,7 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) > )]; > struct uio opt; > char *u_path, *u_hostname, *u_name; > -#ifdef PR_GLOBAL_ALLOW > struct bool_flags *bf; > - int enforce_statfs; > -#endif > #ifdef INET > uint32_t ip4s; > struct in_addr *u_ip4; > @@ -312,7 +295,7 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) > struct in6_addr *u_ip6; > #endif > size_t tmplen; > - int error; > + int error, enforce_statfs; > > bzero(&optiov, sizeof(optiov)); > opt.uio_iov = optiov; > @@ -323,7 +306,6 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) > opt.uio_rw = UIO_READ; > opt.uio_td = td; > > -#ifdef PR_GLOBAL_ALLOW > /* Set permissions for top-level jails from sysctls. */ > if (!jailed(td->td_ucred)) { > for (bf = pr_flag_allow; > @@ -345,7 +327,6 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) > optiov[opt.uio_iovcnt].iov_len = sizeof(enforce_statfs); > opt.uio_iovcnt++; > } > -#endif > > tmplen = MAXPATHLEN + MAXHOSTNAMELEN + MAXHOSTNAMELEN; > #ifdef INET > @@ -449,7 +430,6 @@ freebsd11_kern_jail(struct thread *td, struct jail *j) > free(u_path, M_TEMP); > return (error); > } > -#endif /* COMPAT_FREEBSD11 */ > > > /* > @@ -1267,11 +1247,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, i > > pr->pr_securelevel = ppr->pr_securelevel; > pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; > -#ifdef PR_GLOBAL_ALLOW > pr->pr_enforce_statfs = jail_default_enforce_statfs; > -#else > - pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; > -#endif > pr->pr_devfs_rsnum = ppr->pr_devfs_rsnum; > > pr->pr_osreldate = osreldt ? osreldt : ppr->pr_osreldate; > @@ -3439,7 +3415,6 @@ prison_path(struct prison *pr1, struct prison *pr2) > static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW, 0, > "Jails"); > > -#ifdef COMPAT_FREEBSD11 > static int > sysctl_jail_list(SYSCTL_HANDLER_ARGS) > { > @@ -3543,7 +3518,6 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) > SYSCTL_OID(_security_jail, OID_AUTO, list, > CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, > sysctl_jail_list, "S", "List of active jails"); > -#endif /* COMPAT_FREEBSD11 */ > > static int > sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) > @@ -3583,14 +3557,13 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vnet, > #if defined(INET) || defined(INET6) > SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, > &jail_max_af_ips, 0, > - "Number of IP addresses a jail may have at most per address family"); > + "Number of IP addresses a jail may have at most per address family (deprecated)"); > #endif > > /* > - * Jail permissions - jailed processes can read these to find out what they are > - * allowed to do. A deprecated use is to set default permissions for prisons > - * created via jail(2). For historical reasons, the sysctl names have varying > - * similarity to the parameter names. > + * Default parameters for jail(2) compatibility. For historical reasons, > + * the sysctl names have varying similarity to the parameter names. Prisons > + * just see their own parameters, and can't change them. > */ > static int > sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) > @@ -3599,68 +3572,52 @@ sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) > int allow, error, i; > > pr = req->td->td_ucred->cr_prison; > -#ifdef PR_GLOBAL_ALLOW > allow = (pr == &prison0) ? jail_default_allow : pr->pr_allow; > -#else > - allow = pr->pr_allow; > -#endif > > /* Get the current flag value, and convert it to a boolean. */ > i = (allow & arg2) ? 1 : 0; > if (arg1 != NULL) > i = !i; > error = sysctl_handle_int(oidp, &i, 0, req); > - if (error) > + if (error || !req->newptr) > return (error); > -#ifdef PR_GLOBAL_ALLOW > - if (req->newptr) { > - i = i ? arg2 : 0; > - if (arg1 != NULL) > - i ^= arg2; > - /* > - * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 > - * for writing. > - */ > - mtx_lock(&prison0.pr_mtx); > - jail_default_allow = (jail_default_allow & ~arg2) | i; > - mtx_unlock(&prison0.pr_mtx); > - } > -#endif > + i = i ? arg2 : 0; > + if (arg1 != NULL) > + i ^= arg2; > + /* > + * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 > + * for writing. > + */ > + mtx_lock(&prison0.pr_mtx); > + jail_default_allow = (jail_default_allow & ~arg2) | i; > + mtx_unlock(&prison0.pr_mtx); > return (0); > } > > -#ifdef PR_GLOBAL_ALLOW > -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RW | CTLFLAG_MPSAFE) > -#define ADDR_GLOBAL_ALLOW(i) &i > -#else > -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RD | CTLFLAG_MPSAFE) > -#define ADDR_GLOBAL_ALLOW(i) NULL > -#endif > - > SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, > - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", > - "Processes in jail can set their hostnames"); > + "Processes in jail can set their hostnames (deprecated)"); > SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, > - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", > - "Processes in jail are limited to creating UNIX/IP/route sockets only"); > + "Processes in jail are limited to creating UNIX/IP/route sockets only (deprecated)"); > SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, > - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", > - "Processes in jail can use System V IPC primitives"); > + "Processes in jail can use System V IPC primitives (deprecated)"); > SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, > - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", > - "Prison root can create raw sockets"); > + "Prison root can create raw sockets (deprecated)"); > SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, > - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", > - "Processes in jail can alter system file flags"); > + "Processes in jail can alter system file flags (deprecated)"); > SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, > - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", > - "Processes in jail can mount/unmount jail-friendly file systems"); > + "Processes in jail can mount/unmount jail-friendly file systems (deprecated)"); > > static int > sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) > @@ -3669,33 +3626,25 @@ sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) > int level, error; > > pr = req->td->td_ucred->cr_prison; > -#ifdef PR_GLOBAL_ALLOW > level = (pr == &prison0) ? *(int *)arg1 : *(int *)((char *)pr + arg2); > -#else > - level = *(int *)((char *)pr + arg2); > -#endif > error = sysctl_handle_int(oidp, &level, 0, req); > - if (error) > + if (error || !req->newptr) > return (error); > -#ifdef PR_GLOBAL_ALLOW > - if (req->newptr) > - *(int *)arg1 = level; > -#endif > + *(int *)arg1 = level; > return (0); > } > > SYSCTL_PROC(_security_jail, OID_AUTO, enforce_statfs, > - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > - ADDR_GLOBAL_ALLOW(jail_default_enforce_statfs), > - offsetof(struct prison, pr_enforce_statfs), > + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > + &jail_default_enforce_statfs, offsetof(struct prison, pr_enforce_statfs), > sysctl_jail_default_level, "I", > - "Processes in jail cannot see all mounted file systems"); > + "Processes in jail cannot see all mounted file systems (deprecated)"); > + > SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, > - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > - ADDR_GLOBAL_ALLOW(jail_default_devfs_rsnum), > - offsetof(struct prison, pr_devfs_rsnum), > + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, > + &jail_default_devfs_rsnum, offsetof(struct prison, pr_devfs_rsnum), > sysctl_jail_default_level, "I", > - "Ruleset for the devfs filesystem in jail"); > + "Ruleset for the devfs filesystem in jail (deprecated)"); > > /* > * Nodes to describe jail parameters. Maximum length of string parameters > @@ -3836,6 +3785,9 @@ prison_add_allow(const char *prefix, const char *name, > struct bool_flags *bf; > struct sysctl_oid *parent; > char *allow_name, *allow_noname, *allowed; > +#ifndef NO_SYSCTL_DESCR > + char *descr_deprecated; > +#endif > unsigned allow_flag; > > if (prefix > @@ -3892,7 +3844,10 @@ prison_add_allow(const char *prefix, const char *name, > bf->flag = allow_flag; > mtx_unlock(&prison0.pr_mtx); > > - /* Create sysctls for the paramter, and the current permission. */ > + /* > + * Create sysctls for the paramter, and the back-compat global > + * permission. > + */ > parent = prefix > ? SYSCTL_ADD_NODE(NULL, > SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), > @@ -3904,10 +3859,17 @@ prison_add_allow(const char *prefix, const char *name, > if ((prefix > ? asprintf(&allowed, M_TEMP, "%s_%s_allowed", prefix, name) > : asprintf(&allowed, M_TEMP, "%s_allowed", name)) >= 0) { > +#ifndef NO_SYSCTL_DESCR > + (void)asprintf(&descr_deprecated, M_TEMP, "%s (deprecated)", > + descr); > +#endif > (void)SYSCTL_ADD_PROC(NULL, > SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, allowed, > - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, allow_flag, > - sysctl_jail_default_allow, "I", descr); > + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, allow_flag, > + sysctl_jail_default_allow, "I", descr_deprecated); > +#ifndef NO_SYSCTL_DESCR > + free(descr_deprecated, M_TEMP); > +#endif > free(allowed, M_TEMP); > } > return allow_flag; > > Modified: head/sys/kern/syscalls.c > ============================================================================== > --- head/sys/kern/syscalls.c Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/kern/syscalls.c Thu Aug 16 19:09:43 2018 (r337925) > @@ -344,7 +344,7 @@ const char *syscallnames[] = { > "utrace", /* 335 = utrace */ > "compat4.sendfile", /* 336 = freebsd4 sendfile */ > "kldsym", /* 337 = kldsym */ > - "compat11.jail", /* 338 = freebsd11 jail */ > + "jail", /* 338 = jail */ > "nnpfs_syscall", /* 339 = nnpfs_syscall */ > "sigprocmask", /* 340 = sigprocmask */ > "sigsuspend", /* 341 = sigsuspend */ > > Modified: head/sys/kern/syscalls.master > ============================================================================== > --- head/sys/kern/syscalls.master Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/kern/syscalls.master Thu Aug 16 19:09:43 2018 (r337925) > @@ -738,7 +738,7 @@ > _Out_opt_ off_t *sbytes, int flags); } > 337 AUE_NULL STD { int kldsym(int fileid, int cmd, \ > _In_ void *data); } > -338 AUE_JAIL COMPAT11 { int jail( \ > +338 AUE_JAIL STD { int jail( \ > _In_ struct jail *jail); } > > 339 AUE_NULL NOSTD|NOTSTATIC { int nnpfs_syscall(int operation, \ > > Modified: head/sys/kern/systrace_args.c > ============================================================================== > --- head/sys/kern/systrace_args.c Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/kern/systrace_args.c Thu Aug 16 19:09:43 2018 (r337925) > @@ -1593,6 +1593,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg > *n_args = 3; > break; > } > + /* jail */ > + case 338: { > + struct jail_args *p = params; > + uarg[0] = (intptr_t) p->jail; /* struct jail * */ > + *n_args = 1; > + break; > + } > /* nnpfs_syscall */ > case 339: { > struct nnpfs_syscall_args *p = params; > @@ -5765,6 +5772,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d > break; > }; > break; > + /* jail */ > + case 338: > + switch(ndx) { > + case 0: > + p = "userland struct jail *"; > + break; > + default: > + break; > + }; > + break; > /* nnpfs_syscall */ > case 339: > switch(ndx) { > @@ -9627,6 +9644,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * > break; > /* kldsym */ > case 337: > + if (ndx == 0 || ndx == 1) > + p = "int"; > + break; > + /* jail */ > + case 338: > if (ndx == 0 || ndx == 1) > p = "int"; > break; > > Modified: head/sys/sys/jail.h > ============================================================================== > --- head/sys/sys/jail.h Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/sys/jail.h Thu Aug 16 19:09:43 2018 (r337925) > @@ -32,7 +32,6 @@ > #ifndef _SYS_JAIL_H_ > #define _SYS_JAIL_H_ > > -#ifdef COMPAT_FREEBSD11 > #ifdef _KERNEL > struct jail_v0 { > u_int32_t version; > @@ -58,6 +57,16 @@ struct jail { > * For all xprison structs, always keep the pr_version an int and > * the first variable so userspace can easily distinguish them. > */ > +#ifndef _KERNEL > +struct xprison_v1 { > + int pr_version; > + int pr_id; > + char pr_path[MAXPATHLEN]; > + char pr_host[MAXHOSTNAMELEN]; > + u_int32_t pr_ip; > +}; > +#endif > + > struct xprison { > int pr_version; > int pr_id; > @@ -82,7 +91,6 @@ struct xprison { > #define PRISON_STATE_INVALID 0 > #define PRISON_STATE_ALIVE 1 > #define PRISON_STATE_DYING 2 > -#endif /* COMPAT_FREEBSD11 */ > > /* > * Flags for jail_set and jail_get. > @@ -102,6 +110,7 @@ struct xprison { > > struct iovec; > > +int jail(struct jail *); > int jail_set(struct iovec *, unsigned int, int); > int jail_get(struct iovec *, unsigned int, int); > int jail_attach(int); > > Modified: head/sys/sys/syscall.h > ============================================================================== > --- head/sys/sys/syscall.h Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/sys/syscall.h Thu Aug 16 19:09:43 2018 (r337925) > @@ -280,7 +280,7 @@ > #define SYS_utrace 335 > /* 336 is freebsd4 sendfile */ > #define SYS_kldsym 337 > -#define SYS_freebsd11_jail 338 > +#define SYS_jail 338 > #define SYS_nnpfs_syscall 339 > #define SYS_sigprocmask 340 > #define SYS_sigsuspend 341 > > Modified: head/sys/sys/syscall.mk > ============================================================================== > --- head/sys/sys/syscall.mk Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/sys/syscall.mk Thu Aug 16 19:09:43 2018 (r337925) > @@ -209,7 +209,7 @@ MIASM = \ > sched_rr_get_interval.o \ > utrace.o \ > kldsym.o \ > - freebsd11_jail.o \ > + jail.o \ > nnpfs_syscall.o \ > sigprocmask.o \ > sigsuspend.o \ > > Modified: head/sys/sys/syscallsubr.h > ============================================================================== > --- head/sys/sys/syscallsubr.h Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/sys/syscallsubr.h Thu Aug 16 19:09:43 2018 (r337925) > @@ -143,6 +143,7 @@ int kern_getsockname(struct thread *td, int fd, struct > int kern_getsockopt(struct thread *td, int s, int level, int name, > void *optval, enum uio_seg valseg, socklen_t *valsize); > int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data); > +int kern_jail(struct thread *td, struct jail *j); > int kern_jail_get(struct thread *td, struct uio *options, int flags); > int kern_jail_set(struct thread *td, struct uio *options, int flags); > int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, > @@ -307,6 +308,5 @@ struct freebsd11_dirent; > > int freebsd11_kern_getdirentries(struct thread *td, int fd, char *ubuf, u_int > count, long *basep, void (*func)(struct freebsd11_dirent *)); > -int freebsd11_kern_jail(struct thread *td, struct jail *j); > > #endif /* !_SYS_SYSCALLSUBR_H_ */ > > Modified: head/sys/sys/sysproto.h > ============================================================================== > --- head/sys/sys/sysproto.h Thu Aug 16 18:58:34 2018 (r337924) > +++ head/sys/sys/sysproto.h Thu Aug 16 19:09:43 2018 (r337925) > @@ -849,6 +849,9 @@ struct kldsym_args { > char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; > char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; > }; > +struct jail_args { > + char jail_l_[PADL_(struct jail *)]; struct jail * jail; char jail_r_[PADR_(struct jail *)]; > +}; > struct nnpfs_syscall_args { > char operation_l_[PADL_(int)]; int operation; char operation_r_[PADR_(int)]; > char a_pathP_l_[PADL_(char *)]; char * a_pathP; char a_pathP_r_[PADR_(char *)]; > @@ -1958,6 +1961,7 @@ int sys_sched_get_priority_min(struct thread *, struct > int sys_sched_rr_get_interval(struct thread *, struct sched_rr_get_interval_args *); > int sys_utrace(struct thread *, struct utrace_args *); > int sys_kldsym(struct thread *, struct kldsym_args *); > +int sys_jail(struct thread *, struct jail_args *); > int sys_nnpfs_syscall(struct thread *, struct nnpfs_syscall_args *); > int sys_sigprocmask(struct thread *, struct sigprocmask_args *); > int sys_sigsuspend(struct thread *, struct sigsuspend_args *); > @@ -2527,9 +2531,6 @@ struct freebsd11_fhstat_args { > char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; > char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * sb; char sb_r_[PADR_(struct freebsd11_stat *)]; > }; > -struct freebsd11_jail_args { > - char jail_l_[PADL_(struct jail *)]; struct jail * jail; char jail_r_[PADR_(struct jail *)]; > -}; > struct freebsd11_kevent_args { > char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; > char changelist_l_[PADL_(struct kevent_freebsd11 *)]; struct kevent_freebsd11 * changelist; char changelist_r_[PADR_(struct kevent_freebsd11 *)]; > @@ -2578,7 +2579,6 @@ int freebsd11_nstat(struct thread *, struct freebsd11_ > int freebsd11_nfstat(struct thread *, struct freebsd11_nfstat_args *); > int freebsd11_nlstat(struct thread *, struct freebsd11_nlstat_args *); > int freebsd11_fhstat(struct thread *, struct freebsd11_fhstat_args *); > -int freebsd11_jail(struct thread *, struct freebsd11_jail_args *); > int freebsd11_kevent(struct thread *, struct freebsd11_kevent_args *); > int freebsd11_getfsstat(struct thread *, struct freebsd11_getfsstat_args *); > int freebsd11_statfs(struct thread *, struct freebsd11_statfs_args *); > @@ -2849,7 +2849,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 > #define SYS_AUE_utrace AUE_NULL > #define SYS_AUE_freebsd4_sendfile AUE_SENDFILE > #define SYS_AUE_kldsym AUE_NULL > -#define SYS_AUE_freebsd11_jail AUE_JAIL > +#define SYS_AUE_jail AUE_JAIL > #define SYS_AUE_nnpfs_syscall AUE_NULL > #define SYS_AUE_sigprocmask AUE_SIGPROCMASK > #define SYS_AUE_sigsuspend AUE_SIGSUSPEND > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 16 19:28:45 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 5240710741AD; Thu, 16 Aug 2018 19:28: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0784A75095; Thu, 16 Aug 2018 19:28: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 DCDBC1DC23; Thu, 16 Aug 2018 19:28:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GJSiRD071154; Thu, 16 Aug 2018 19:28:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GJSiIw071153; Thu, 16 Aug 2018 19:28:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808161928.w7GJSiIw071153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 Aug 2018 19:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337926 - head/cddl/contrib/opensolaris/cmd/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace X-SVN-Commit-Revision: 337926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:28:45 -0000 Author: markj Date: Thu Aug 16 19:28:44 2018 New Revision: 337926 URL: https://svnweb.freebsd.org/changeset/base/337926 Log: Add partial documentation for dtrace(1)'s -x configuration options. Some options are still missing descriptions, but they can be filled in over time. Submitted by: raichoo Reviewed by: 0mp (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16671 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Thu Aug 16 19:09:43 2018 (r337925) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Thu Aug 16 19:28:44 2018 (r337926) @@ -1,4 +1,3 @@ -'\" te .\" CDDL HEADER START .\" .\" The contents of this file are subject to the terms of the @@ -21,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2015 +.Dd August 16, 2018 .Dt DTRACE 1 .Os .Sh NAME @@ -523,6 +522,116 @@ Enable or modify a DTrace runtime option or D compiler Boolean options are enabled by specifying their name. Options with values are set by separating the option name and value with an equals sign (=). +.Pp +A +.Ar size +argument may be suffixed with one of +.Cm K , +.Cm M , +.Cm G +or +.Cm T +(either upper or lower case) to indicate a multiple of +Kilobytes, Megabytes, Gigabytes or Terabytes +respectively. +.Pp +A +.Ar time +argument may be suffixed with one of +.Cm ns , +.Cm nsec , +.Cm us , +.Cm usec , +.Cm ms , +.Cm msec , +.Cm s , +.Cm sec , +.Cm m , +.Cm min , +.Cm h , +.Cm hour , +.Cm d , +.Cm day , +.Cm hz . +If no suffix is specified +.Cm hz +will be used as the unit. +.Bl -tag -width indent +.It Sy aggrate Ns = Ns Ar time +Rate of aggregation reading. +.It Sy aggsize Ns = Ns Ar size +Size of the aggregation buffer. +.It Sy bufpolicy Ns = Ns Cm fill Ns | Ns Cm switch Ns | Ns Cm ring +Specifies the buffer policy for the principal buffer. +.It Sy bufresize Ns = Ns Cm auto Ns | Ns Cm manual +Buffer resizing policy. +.It Sy bufsize Ns = Ns Ar size +Size of the per-CPU principal buffer. +Same as the +.Fl b +flag. +.It Sy cleanrate Ns = Ns Ar time +Cleaning rate. +Must be specified in number-per-second with the +.Dq Li hz +suffix. +.It Sy cpu Ns = Ns Ar scalar +Specifies the CPU on which to enable tracing. +.It Sy defaultargs +Allow references to unspecified macro arguments. +.It Sy destructive +Allow destructive actions. +Same as the +.Fl w +flag. +.It Sy dynvarsize Ns = Ns Ar size +Size of the dynamic variable space. +.It Sy flowindent +Turn on flow indentation. +Same as the +.Fl F +flag. +.It Sy grabanon +Claim anonymous state. +Same as the +.Fl a +flag. +.It Sy jstackframes Ns = Ns Ar scalar +Number of default stack frames for +.Fn jstack . +.It Sy jstackstrsize Ns = Ns Ar scalar +Default string space size for +.Fn jstack . +.It Sy nspec Ns = Ns Ar scalar +Number of speculations. +.It Sy quiet +Set quiet mode. +Same as the +.Fl q +flag. +.It Sy specsize Ns = Ns Ar size +Size of the speculation buffer. +.It Sy strsize Ns = Ns Ar size +Maximum size of strings. +.It Sy stackframes Ns = Ns Ar scalar +Maximum number of kernelspace stack frames to unwind when executing the +.Fn stack +action. +.It Sy stackindent Ns = Ns Ar scalar +Number of whitespace characters to use when indenting +.Fn stack +and +.Fn ustack +output. +.It Sy statusrate Ns = Ns Ar time +Rate of status checking. +.It Sy switchrate Ns = Ns Ar time +Rate of buffer switching. +.It Sy ustackframes Ns = Ns Ar scalar +Maximum number of userspace stack frames to unwind when executing the +.Fn ustack +action. +.El .It Fl X Cm a | c | s | t Specify the degree of conformance to the ISO C standard that should be selected when invoking From owner-svn-src-all@freebsd.org Thu Aug 16 19:29: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 1C3F21074235; Thu, 16 Aug 2018 19:29:36 +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 8649C751FE; Thu, 16 Aug 2018 19:29:35 +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 w7GJTWr0055412; Thu, 16 Aug 2018 12:29:32 -0700 (PDT) (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 w7GJTWfS055411; Thu, 16 Aug 2018 12:29:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808161929.w7GJTWfS055411@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve In-Reply-To: To: Warner Losh Date: Thu, 16 Aug 2018 12:29:32 -0700 (PDT) CC: John-Mark Gurney , Marcelo Araujo , src-committers , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:29:36 -0000 > On Thu, Aug 16, 2018 at 11:06 AM, John-Mark Gurney wrote: > > > Marcelo Araujo wrote this message on Thu, Aug 16, 2018 at 06:31 +0000: > > > Author: araujo > > > Date: Thu Aug 16 06:31:54 2018 > > > New Revision: 337887 > > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > > > Log: > > > Add a comment explaining how the PSN works and why there is no need for > > > a null terminator. Also mark CID 1394825 as intentional. > > > > > > Reported by: Coverity > > > CID: 1394825 > > > MFC after: 1 week > > > Sponsored by: iXsystems Inc. > > > > > > Modified: > > > head/usr.sbin/bhyve/pci_nvme.c > > > > > > Modified: head/usr.sbin/bhyve/pci_nvme.c > > > ============================================================ > > ================== > > > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > > (r337886) > > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > > (r337887) > > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, > > char *o > > > > [...] > > > > > memset(sc->ctrldata.sn, 0, sizeof(sc->ctrldata.sn > > )); > > > strncpy(sc->ctrldata.sn, config, > > > sizeof(sc->ctrldata.sn)); > > > > This memset is unneeded, as strncpy will write NUL bytes to fill out > > the buffer: > > If src is less than len characters long, the remainder of > > dst is filled with `\0' characters. > > > > It also looks like the comment was wrong. The newest NVMe standards say > these fields should be 7-bit and space-padded. lol, which is what the vendor that caused me grief with ata serial numbers did decades ago. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 16 19:31: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 E13181074429; Thu, 16 Aug 2018 19:31:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA4375408; Thu, 16 Aug 2018 19:31:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 489D4936F; Thu, 16 Aug 2018 19:31:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 2052B1261; Thu, 16 Aug 2018 19:31:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Jm2KqDk8CpmI; Thu, 16 Aug 2018 19:31:06 +0000 (UTC) Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com DA9901256 To: Ian Lepore , Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Brad Davis References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> <57eef2b1-d126-a8da-c45a-d8cab0373a08@FreeBSD.org> <1534446846.1466.43.camel@freebsd.org> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8FAlJp hmsCGwwFCQlmAYAACgkQNddxu25Gl89UPggA2mGQp28yCUKsJ6KHFVy/lpHfoQrKF+s7HfKT U2ObVeVNX4I8ZdW1UO48mRqxEOwY8r5YSH6X06OmiqCX2aSMXg3N06/l+ztlB0+UGGlkXBjv l9/nii+bC6b8XWuu0X7Qpb9oYBK9YtoaoyuVplAmjdj/cPou65meKIaS1yDTjHh450DrW8Qg he6l0bFX4BHKTSm99U90ML7EY19B6iI2BZSqWutVsyD71oAREY6NGgDpCOIO6FS41+WeYCDR j8vsa/BiaoX2d2SBDsCwsEwe9fg5PYMi2uVIhvL6OrxnwOdB+TkgvOy5zZSNO29UG/JilZKo Ndz2wpEaUzChGGqLvcLAZQQYAQoADwIbDAUCWujOKAUJCmB7PQAKCRA113G7bkaXz6bkB/9H dUR3E0wBwMh6z0AOFDKh+PbRI9Xd4IncdhE55tNK410650a3gADIDwqz3i72GIinkgaxzpEO xP1bs7a+BeF3p5Xd6Jjk6J/nEshisgNW7VjUbJHFGs8Sf9A6oM3q4VkI/ArVo5qkZxgKs72U HSAy5NV+AdqdTrWuAL20xfQ6gA7JF35Xf8zyUM2GMl0X8ik7dJ1jMp+TB27LipqbDgamFzH9 F9hC9gur94OQ/x3nQ+mFZ1uipYHA1EdrKuhb/Ts4bN/Ezl8nmYGxc9Bw7ZBxGOTId/rEIzoe LWpAvg6dcw0T9lNfSWc6PX+kf3dOXNIdkw9NqKID8wEPe8axcGYG Organization: FreeBSD Message-ID: <8e232b42-e74a-d1c2-561d-f729c8c7c431@FreeBSD.org> Date: Thu, 16 Aug 2018 12:31:04 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1534446846.1466.43.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LVyvdiDJBmwPDry7qG0gjW0pY0o1uxxwG" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:31:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LVyvdiDJBmwPDry7qG0gjW0pY0o1uxxwG Content-Type: multipart/mixed; boundary="sy8RIjqFgn0Q41o4XU3HLVtiszvlB1TkN"; protected-headers="v1" From: Bryan Drewery To: Ian Lepore , Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Brad Davis Message-ID: <8e232b42-e74a-d1c2-561d-f729c8c7c431@FreeBSD.org> Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> <57eef2b1-d126-a8da-c45a-d8cab0373a08@FreeBSD.org> <1534446846.1466.43.camel@freebsd.org> In-Reply-To: <1534446846.1466.43.camel@freebsd.org> --sy8RIjqFgn0Q41o4XU3HLVtiszvlB1TkN Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/16/18 12:14 PM, Ian Lepore wrote: > On Thu, 2018-08-16 at 12:10 -0700, Bryan Drewery wrote: >> On 8/16/18 11:47 AM, Larry Rosenman wrote: >>> >>> On Thu, Aug 16, 2018 at 11:34:59AM -0700, Bryan Drewery wrote: >>>> >>>> On 8/16/18 11:21 AM, Larry Rosenman wrote: >>>>> >>>>> On Thu, Aug 16, 2018 at 02:02:52PM -0400, Jung-uk Kim wrote: >>>>>> >>>>>> On 18. 8. 16., Larry Rosenman wrote: >>>>>>> >>>>>>> On Thu, Aug 16, 2018 at 01:48:40PM -0400, Jung-uk Kim >>>>>>> wrote: >>>>>>>> >>>>>>>> On 18. 8. 16., Ravi Pokala wrote: >>>>>>>>> >>>>>>>>> -----Original Message----- >>>>>>>>> From: on behalf of >>>>>>>>> Jung-uk Kim >>>>>>>>> Date: 2018-08-14, Tuesday at 10:48 >>>>>>>>> To: , >>>>>>>> org>, >>>>>>>>> Subject: svn commit: r337791 - in head: crypto/openssl >>>>>>>>> crypto/openssl/apps crypto/openssl/crypto >>>>>>>>> crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio >>>>>>>>> crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm >>>>>>>>> cr... >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Author: jkim >>>>>>>>>> Date: Tue Aug 14 17:48:02 2018 >>>>>>>>>> New Revision: 337791 >>>>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/337791 >>>>>>>>>> >>>>>>>>>> Log: >>>>>>>>>> =C2=A0 Merge OpenSSL 1.0.2p. >>>>>>>>> Is it just me, or did this change break all the worlds? >>>>>>>>> >>>>>>>>> I got errors like this: >>>>>>>>> >>>>>>>>> ----------------------------------------------------- >>>>>>>>> ----------- >>>>>>>>> /usr/bin/ld: error: undefined symbol: main >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> referenced by crt1.c:74 >>>>>>>>>>>> (/usr/home/rpokala/freebsd/clean/base/head/lib/cs >>>>>>>>>>>> u/amd64/crt1.c:74) >>>>>>>>>>>> =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/build/usr/home/rpokala/freebsd/cle >>>>>>>>>>>> an/base/head/amd64.amd64/tmp/usr/lib/crt1.o:(_sta >>>>>>>>>>>> rt) >>>>>>>>> /usr/bin/ld: error: undefined symbol: Fssh_error >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> referenced by moduli.c:257 >>>>>>>>>>>> (/usr/home/rpokala/freebsd/clean/base/head/crypto >>>>>>>>>>>> /openssh/moduli.c:257) >>>>>>>>>>>> =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/tmp/moduli- >>>>>>>>>>>> 6780ab.o:(Fssh_gen_candidates) >>>>>>>>> ----------------------------------------------------- >>>>>>>>> ----------- >>>>>>>>> >>>>>>>>> At first I thought it was because I was rebuilding >>>>>>>>> without cleaning, but I nuked the tree and rebuilt from >>>>>>>>> scratch, and got the same error. >>>>>>>>> >>>>>>>>> I didn't bisect it to this change, but it's the only >>>>>>>>> recent change to crypto... >>>>>>>> I built worlds many times and I haven't seen such >>>>>>>> problem.=C2=A0=C2=A0In fact, >>>>>>>> Jenkins didn't break on amd64 after the commit. >>>>>>>> >>>>>>>> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ >>>>>>> Do you or jenkins run with meta-mode?=C2=A0=C2=A0That seems to be= a >>>>>>> necessary >>>>>>> condition for the failure. >>>>>> I don't do meta-mode.=C2=A0=C2=A0I don't know much about Jenkins b= uild >>>>>> but I don't >>>>>> think it does.=C2=A0=C2=A0Is it a requirement now? >>>>>> >>>> Jenkins doesn't use META_MODE and it's not a requirement. >>> Can you (bdrewery@) possibly diagnose why meta-mode is messing this >>> up >>> with the moduli file? >>> >>>> >>>> >> Sure. I'm hitting it as well. >> >> >=20 > There's a thread about it in -current@ too. >=20 > -- Ian >=20 META_MODE is a distraction here, it fails without it in a clean build. The current@ thread explains why due to moduli.c being in the .PATH now. > ~/git/freebsd/secure/usr.sbin/sshd # make buildconfig -dmM MK_META_MODE= =3Dno > Make_ExpandUse: examine buildconfig > MakeAddChild: need to examine moduli > MakeAddChild: need to examine sshd_config > Make_ExpandUse: examine moduli > MakeAddChild: need to examine moduli.c > Make_ExpandUse: examine sshd_config > Make_ExpandUse: examine moduli.c > Examining moduli.c...modified 7:59:30 Jun 07, 2018...up-to-date. > Examining moduli...modified 0:00:00 Nov 30, 2017...modified before sou= rce /root/git/freebsd/crypto/openssh/moduli.c...out-of-date. > cc -O2 -pipe -I/root/git/freebsd/crypto/openssh -include ssh_namespac= e.h -DHAVE_LDNS=3D1 -DUSE_BSM_AUDIT=3D1 -DHAVE_GETAUDIT_ADDR=3D1 -DUSE_BL= ACKLIST=3D1 -I/root/git/freebsd/contrib/blacklist/include -include > krb5_config.h -DLIBWRAP=3D1 -DXAUTH_PATH=3D\"/usr/local/bin/xauth\" -g= -std=3Dgnu99 -fstack-protector-strong -Wno-pointer-sign -Wno-empty-body= -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautologic > al-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-func= tion -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packe= d-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-pa > rameter -Wno-parentheses -fcolor-diagnostics -Qunused-arguments -L/s= cratch/obj/root/git/freebsd/amd64.amd64/lib/libblacklist /root/git/freeb= sd/crypto/openssh/moduli.c -o /root/git/freebsd/crypto/op > enssh/moduli > /usr/bin/ld: error: undefined symbol: main >>>> referenced by crt1.c:74 (/usr/src/lib/csu/amd64/crt1.c:74) --=20 Regards, Bryan Drewery --sy8RIjqFgn0Q41o4XU3HLVtiszvlB1TkN-- --LVyvdiDJBmwPDry7qG0gjW0pY0o1uxxwG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlt10PgACgkQNddxu25G l8+0BggAo7dh44plF5h5nJPWma4xfYygEyKYwwuKU4U+sXf6In1lwSfU7QfFRo7u 0u6J3PNAw8Ii6lZEwh9Ha1YFHnQA3LVFInhjlwTDP+xfFot4OsuP3lVjGzCpAgOl j1FgRDzfc6RbT+Za1IrQUUlMKUjT6BiqYIRV57zdxXTAbjGugzQiEiZr2RbyG+2p pXMCKPRbsu8KUQFsyQq6KqS14/wurrZxcxvtWYaObp46uMe9MmlBhd5nNU0nwkJU Dl8DaG/54UNT1YNuzqPgAMF8yFSJi7cIQD61YRDoEFsUDpZMOnXS3wlYJE0Sud8O W9fhhqOD0G6vHyRVY1qfWOqlWGX/Mw== =Qrw6 -----END PGP SIGNATURE----- --LVyvdiDJBmwPDry7qG0gjW0pY0o1uxxwG-- From owner-svn-src-all@freebsd.org Thu Aug 16 19:34: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 3A9AD10745B4; Thu, 16 Aug 2018 19:34:03 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gritton.org", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CB95A757DF; Thu, 16 Aug 2018 19:34:02 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) by gritton.org (8.15.2/8.15.2) with ESMTP id w7GJY1Dw057425; Thu, 16 Aug 2018 13:34:01 -0600 (MDT) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 16 Aug 2018 13:34:01 -0600 From: James Gritton To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337925 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys In-Reply-To: <201808161927.w7GJRF1Q055395@pdx.rh.CN85.dnsmgr.net> References: <201808161927.w7GJRF1Q055395@pdx.rh.CN85.dnsmgr.net> Message-ID: <195df064ecc0afb74d0d3f791c5087eb@freebsd.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.3.6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:34:03 -0000 OK, so noted. But seeing as I've already done the partial in this case, what's best to do now? Should I add another commit to revert the so-far unreverted files? - Jamie On 2018-08-16 13:27, Rodney W. Grimes wrote: >> Author: jamie >> Date: Thu Aug 16 19:09:43 2018 >> New Revision: 337925 >> URL: https://svnweb.freebsd.org/changeset/base/337925 >> >> Log: >> Revert r337922, except for some documention-only bits. This needs >> to wait >> until user is changed to stop using jail(2). > > Can we please stop doing "partial" reverts, it makes log > tracking and sorting out stuff later more difficult. > > If something is seperable and needs to stay it is best > to revert the whole commit, and then commit with a proper > log exactly what it is that you did not want to revert. > >> >> Differential Revision: D14791 >> >> Modified: >> head/lib/libc/sys/jail.2 >> head/sys/compat/freebsd32/freebsd32_misc.c >> head/sys/compat/freebsd32/freebsd32_proto.h >> head/sys/compat/freebsd32/freebsd32_syscall.h >> head/sys/compat/freebsd32/freebsd32_syscalls.c >> head/sys/compat/freebsd32/freebsd32_sysent.c >> head/sys/compat/freebsd32/freebsd32_systrace_args.c >> head/sys/compat/freebsd32/syscalls.master >> head/sys/kern/init_sysent.c >> head/sys/kern/kern_jail.c >> head/sys/kern/syscalls.c >> head/sys/kern/syscalls.master >> head/sys/kern/systrace_args.c >> head/sys/sys/jail.h >> head/sys/sys/syscall.h >> head/sys/sys/syscall.mk >> head/sys/sys/syscallsubr.h >> head/sys/sys/sysproto.h >> >> Modified: head/lib/libc/sys/jail.2 >> ============================================================================== >> --- head/lib/libc/sys/jail.2 Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/lib/libc/sys/jail.2 Thu Aug 16 19:09:43 2018 (r337925) >> @@ -25,10 +25,11 @@ >> .\" >> .\" $FreeBSD$ >> .\" >> -.Dd August 16, 2018 >> +.Dd February 8, 2012 >> .Dt JAIL 2 >> .Os >> .Sh NAME >> +.Nm jail , >> .Nm jail_get , >> .Nm jail_set , >> .Nm jail_remove , >> @@ -40,6 +41,8 @@ >> .In sys/param.h >> .In sys/jail.h >> .Ft int >> +.Fn jail "struct jail *jail" >> +.Ft int >> .Fn jail_attach "int jid" >> .Ft int >> .Fn jail_remove "int jid" >> @@ -50,7 +53,74 @@ >> .Fn jail_set "struct iovec *iov" "u_int niov" "int flags" >> .Sh DESCRIPTION >> The >> +.Fn jail >> +system call sets up a jail and locks the current process in it. >> +.Pp >> +The argument is a pointer to a structure describing the prison: >> +.Bd -literal -offset indent >> +struct jail { >> + uint32_t version; >> + char *path; >> + char *hostname; >> + char *jailname; >> + unsigned int ip4s; >> + unsigned int ip6s; >> + struct in_addr *ip4; >> + struct in6_addr *ip6; >> +}; >> +.Ed >> +.Pp >> +.Dq Li version >> +defines the version of the API in use. >> +.Dv JAIL_API_VERSION >> +is defined for the current version. >> +.Pp >> +The >> +.Dq Li path >> +pointer should be set to the directory which is to be the root of the >> +prison. >> +.Pp >> +The >> +.Dq Li hostname >> +pointer can be set to the hostname of the prison. >> +This can be changed >> +from the inside of the prison. >> +.Pp >> +The >> +.Dq Li jailname >> +pointer is an optional name that can be assigned to the jail >> +for example for management purposes. >> +.Pp >> +The >> +.Dq Li ip4s >> +and >> +.Dq Li ip6s >> +give the numbers of IPv4 and IPv6 addresses that will be passed >> +via their respective pointers. >> +.Pp >> +The >> +.Dq Li ip4 >> +and >> +.Dq Li ip6 >> +pointers can be set to an arrays of IPv4 and IPv6 addresses to be >> assigned to >> +the prison, or NULL if none. >> +IPv4 addresses must be in network byte order. >> +.Pp >> +This is equivalent to, and deprecated in favor of, the >> .Fn jail_set >> +system call (see below), with the parameters >> +.Va path , >> +.Va host.hostname , >> +.Va name , >> +.Va ip4.addr , >> +and >> +.Va ip6.addr , >> +and with the >> +.Dv JAIL_ATTACH >> +flag. >> +.Pp >> +The >> +.Fn jail_set >> system call creates a new jail, or modifies an existing one, and >> optionally >> locks the current process in it. >> Jail parameters are passed as an array of name-value pairs in the >> array >> @@ -76,19 +146,13 @@ The current set of available parameters, and >> their for >> retrieved via the >> .Va security.jail.param >> sysctl MIB entry. >> -Notable parameters include >> +Notable parameters include those mentioned in the >> +.Fn jail >> +description above, as well as >> .Va jid >> and >> -.Va name >> -which identify the jail being created or modified, >> -.Va path >> -(the root directory of the jail), >> -.Va host.hostname >> -(the hostname of the jail), and >> -.Va ip4.addr >> -and >> -.Va ip6.addr >> -(IP addresses to assign to the jail). >> +.Va name , >> +which identify the jail being created or modified. >> See >> .Xr jail 8 >> for more information on the core jail parameters. >> @@ -173,7 +237,8 @@ It will kill all processes belonging to the jail, >> and >> of that jail. >> .Sh RETURN VALUES >> If successful, >> -.Fn jail_set >> +.Fn jail , >> +.Fn jail_set , >> and >> .Fn jail_get >> return a non-negative integer, termed the jail identifier (JID). >> @@ -184,6 +249,25 @@ to indicate the error. >> .Rv -std jail_attach jail_remove >> .Sh ERRORS >> The >> +.Fn jail >> +system call >> +will fail if: >> +.Bl -tag -width Er >> +.It Bq Er EPERM >> +This process is not allowed to create a jail, either because it is >> not >> +the super-user, or because it would exceed the jail's >> +.Va children.max >> +limit. >> +.It Bq Er EFAULT >> +.Fa jail >> +points to an address outside the allocated address space of the >> process. >> +.It Bq Er EINVAL >> +The version number of the argument is not correct. >> +.It Bq Er EAGAIN >> +No free JID could be found. >> +.El >> +.Pp >> +The >> .Fn jail_set >> system call >> will fail if: >> @@ -287,7 +371,8 @@ does not exist. >> .El >> .Pp >> Further >> -.Fn jail_set >> +.Fn jail , >> +.Fn jail_set , >> and >> .Fn jail_attach >> call >> @@ -301,7 +386,7 @@ manual page for details. >> .Xr chroot 2 , >> .Xr jail 8 >> .Sh HISTORY >> -The now-deprecated >> +The >> .Fn jail >> system call appeared in >> .Fx 4.0 . >> >> Modified: head/sys/compat/freebsd32/freebsd32_misc.c >> ============================================================================== >> --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 18:58:34 >> 2018 (r337924) >> +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 19:09:43 >> 2018 (r337925) >> @@ -2289,10 +2289,8 @@ freebsd32_sysctl(struct thread *td, struct >> freebsd32_s >> return (0); >> } >> >> -#ifdef COMPAT_FREEBSD11 >> int >> -freebsd11_freebsd32_jail(struct thread *td, >> - struct freebsd11_freebsd32_jail_args *uap) >> +freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) >> { >> uint32_t version; >> int error; >> @@ -2349,9 +2347,8 @@ freebsd11_freebsd32_jail(struct thread *td, >> /* Sci-Fi jails are not supported, sorry. */ >> return (EINVAL); >> } >> - return (freebsd11_kern_jail(td, &j)); >> + return (kern_jail(td, &j)); >> } >> -#endif /* COMPAT_FREEBSD11 */ >> >> int >> freebsd32_jail_set(struct thread *td, struct freebsd32_jail_set_args >> *uap) >> >> Modified: head/sys/compat/freebsd32/freebsd32_proto.h >> ============================================================================== >> --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 18:58:34 >> 2018 (r337924) >> +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 19:09:43 >> 2018 (r337925) >> @@ -283,6 +283,9 @@ struct freebsd32_sched_rr_get_interval_args { >> char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; >> char interval_l_[PADL_(struct timespec32 *)]; struct timespec32 * >> interval; char interval_r_[PADR_(struct timespec32 *)]; >> }; >> +struct freebsd32_jail_args { >> + char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char >> jail_r_[PADR_(struct jail32 *)]; >> +}; >> struct freebsd32_sigtimedwait_args { >> char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char >> set_r_[PADR_(const sigset_t *)]; >> char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char >> info_r_[PADR_(siginfo_t *)]; >> @@ -758,6 +761,7 @@ int freebsd32_aio_return(struct thread *, struct >> freeb >> int freebsd32_aio_suspend(struct thread *, struct >> freebsd32_aio_suspend_args *); >> int freebsd32_aio_error(struct thread *, struct >> freebsd32_aio_error_args *); >> int freebsd32_sched_rr_get_interval(struct thread *, struct >> freebsd32_sched_rr_get_interval_args *); >> +int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); >> int freebsd32_sigtimedwait(struct thread *, struct >> freebsd32_sigtimedwait_args *); >> int freebsd32_sigwaitinfo(struct thread *, struct >> freebsd32_sigwaitinfo_args *); >> int freebsd32_aio_waitcomplete(struct thread *, struct >> freebsd32_aio_waitcomplete_args *); >> @@ -1180,9 +1184,6 @@ struct freebsd11_freebsd32_fhstat_args { >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; >> char sb_l_[PADL_(struct freebsd11_stat32 *)]; struct >> freebsd11_stat32 * sb; char sb_r_[PADR_(struct freebsd11_stat32 *)]; >> }; >> -struct freebsd11_freebsd32_jail_args { >> - char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char >> jail_r_[PADR_(struct jail32 *)]; >> -}; >> struct freebsd11_freebsd32_kevent_args { >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; >> char changelist_l_[PADL_(const struct kevent32_freebsd11 *)]; const >> struct kevent32_freebsd11 * changelist; char changelist_r_[PADR_(const >> struct kevent32_freebsd11 *)]; >> @@ -1222,7 +1223,6 @@ int freebsd11_freebsd32_lstat(struct thread *, >> struct >> int freebsd11_freebsd32_getdirentries(struct thread *, struct >> freebsd11_freebsd32_getdirentries_args *); >> int freebsd11_freebsd32_getdents(struct thread *, struct >> freebsd11_freebsd32_getdents_args *); >> int freebsd11_freebsd32_fhstat(struct thread *, struct >> freebsd11_freebsd32_fhstat_args *); >> -int freebsd11_freebsd32_jail(struct thread *, struct >> freebsd11_freebsd32_jail_args *); >> int freebsd11_freebsd32_kevent(struct thread *, struct >> freebsd11_freebsd32_kevent_args *); >> int freebsd11_freebsd32_fstatat(struct thread *, struct >> freebsd11_freebsd32_fstatat_args *); >> int freebsd11_freebsd32_mknodat(struct thread *, struct >> freebsd11_freebsd32_mknodat_args *); >> @@ -1317,7 +1317,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, >> struc >> >> #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_LIO_LISTIO >> #define FREEBSD32_SYS_AUE_freebsd32_sched_rr_get_interval AUE_NULL >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE >> -#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_jail AUE_JAIL >> +#define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN >> #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT >> >> Modified: head/sys/compat/freebsd32/freebsd32_syscall.h >> ============================================================================== >> --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 18:58:34 >> 2018 (r337924) >> +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 19:09:43 >> 2018 (r337925) >> @@ -275,7 +275,7 @@ >> #define FREEBSD32_SYS_utrace 335 >> /* 336 is freebsd4 freebsd32_sendfile */ >> #define FREEBSD32_SYS_kldsym 337 >> -#define FREEBSD32_SYS_freebsd11_freebsd32_jail 338 >> +#define FREEBSD32_SYS_freebsd32_jail 338 >> #define FREEBSD32_SYS_sigprocmask 340 >> #define FREEBSD32_SYS_sigsuspend 341 >> /* 342 is freebsd4 freebsd32_sigaction */ >> >> Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c >> ============================================================================== >> --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 18:58:34 >> 2018 (r337924) >> +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 19:09:43 >> 2018 (r337925) >> @@ -347,7 +347,7 @@ const char *freebsd32_syscallnames[] = { >> "utrace", /* 335 = utrace */ >> "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile >> */ >> "kldsym", /* 337 = kldsym */ >> - "compat11.freebsd32_jail", /* 338 = freebsd11 freebsd32_jail */ >> + "freebsd32_jail", /* 338 = freebsd32_jail */ >> "#339", /* 339 = pioctl */ >> "sigprocmask", /* 340 = sigprocmask */ >> "sigsuspend", /* 341 = sigsuspend */ >> >> Modified: head/sys/compat/freebsd32/freebsd32_sysent.c >> ============================================================================== >> --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 18:58:34 >> 2018 (r337924) >> +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 19:09:43 >> 2018 (r337925) >> @@ -394,7 +394,7 @@ struct sysent freebsd32_sysent[] = { >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ >> { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), >> AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = >> freebsd4 freebsd32_sendfile */ >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, >> SY_THR_STATIC }, /* 337 = kldsym */ >> - { compat11(AS(freebsd11_freebsd32_jail_args),freebsd32_jail), >> AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 >> freebsd32_jail */ >> + { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, >> NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd32_jail */ >> { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT >> }, /* 339 = pioctl */ >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = >> sigprocmask */ >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ >> >> Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c >> ============================================================================== >> --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 >> 18:58:34 2018 (r337924) >> +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 >> 19:09:43 2018 (r337925) >> @@ -1559,6 +1559,13 @@ systrace_args(int sysnum, void *params, >> uint64_t *uarg >> *n_args = 3; >> break; >> } >> + /* freebsd32_jail */ >> + case 338: { >> + struct freebsd32_jail_args *p = params; >> + uarg[0] = (intptr_t) p->jail; /* struct jail32 * */ >> + *n_args = 1; >> + break; >> + } >> /* sigprocmask */ >> case 340: { >> struct sigprocmask_args *p = params; >> @@ -5704,6 +5711,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, >> char *d >> break; >> }; >> break; >> + /* freebsd32_jail */ >> + case 338: >> + switch(ndx) { >> + case 0: >> + p = "userland struct jail32 *"; >> + break; >> + default: >> + break; >> + }; >> + break; >> /* sigprocmask */ >> case 340: >> switch(ndx) { >> @@ -9653,6 +9670,11 @@ systrace_return_setargdesc(int sysnum, int ndx, >> char * >> break; >> /* kldsym */ >> case 337: >> + if (ndx == 0 || ndx == 1) >> + p = "int"; >> + break; >> + /* freebsd32_jail */ >> + case 338: >> if (ndx == 0 || ndx == 1) >> p = "int"; >> break; >> >> Modified: head/sys/compat/freebsd32/syscalls.master >> ============================================================================== >> --- head/sys/compat/freebsd32/syscalls.master Thu Aug 16 18:58:34 >> 2018 (r337924) >> +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 16 19:09:43 >> 2018 (r337925) >> @@ -601,7 +601,7 @@ >> off_t *sbytes, int flags); } >> 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ >> void *data); } >> -338 AUE_JAIL COMPAT11 { int freebsd32_jail(struct jail32 *jail); } >> +338 AUE_JAIL STD { int freebsd32_jail(struct jail32 *jail); } >> 339 AUE_NULL UNIMPL pioctl >> 340 AUE_SIGPROCMASK NOPROTO { int sigprocmask(int how, \ >> const sigset_t *set, sigset_t *oset); } >> >> Modified: head/sys/kern/init_sysent.c >> ============================================================================== >> --- head/sys/kern/init_sysent.c Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/kern/init_sysent.c Thu Aug 16 19:09:43 2018 (r337925) >> @@ -387,7 +387,7 @@ struct sysent sysent[] = { >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ >> { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, >> 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, >> SY_THR_STATIC }, /* 337 = kldsym */ >> - { compat11(AS(freebsd11_jail_args),jail), AUE_JAIL, NULL, 0, 0, 0, >> SY_THR_STATIC }, /* 338 = freebsd11 jail */ >> + { AS(jail_args), (sy_call_t *)sys_jail, AUE_JAIL, NULL, 0, 0, 0, >> SY_THR_STATIC }, /* 338 = jail */ >> { AS(nnpfs_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, >> 0, 0, SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = >> sigprocmask */ >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ >> >> Modified: head/sys/kern/kern_jail.c >> ============================================================================== >> --- head/sys/kern/kern_jail.c Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/kern/kern_jail.c Thu Aug 16 19:09:43 2018 (r337925) >> @@ -74,14 +74,6 @@ __FBSDID("$FreeBSD$"); >> >> #include >> >> -/* >> - * The old jail(2) interface will exist under COMPAT_FREEBSD11, but >> the global >> - * permission sysctls are slated to go away sometime (even with >> COMPAT). >> - */ >> -#if defined(COMPAT_FREEBSD11) && !defined(BURN_BRIDGES) >> -#define PR_GLOBAL_ALLOW >> -#endif >> - >> #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" >> >> MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); >> @@ -207,11 +199,9 @@ const size_t pr_flag_allow_size = >> sizeof(pr_flag_allow >> #define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | >> PR_ALLOW_RESERVED_PORTS) >> #define JAIL_DEFAULT_ENFORCE_STATFS 2 >> #define JAIL_DEFAULT_DEVFS_RSNUM 0 >> -#ifdef PR_GLOBAL_ALLOW >> static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; >> static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; >> static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; >> -#endif >> #if defined(INET) || defined(INET6) >> static unsigned jail_max_af_ips = 255; >> #endif >> @@ -229,14 +219,13 @@ prison0_init(void) >> strlcpy(prison0.pr_osrelease, osrelease, >> sizeof(prison0.pr_osrelease)); >> } >> >> -#ifdef COMPAT_FREEBSD11 >> /* >> * struct jail_args { >> * struct jail *jail; >> * }; >> */ >> int >> -freebsd11_jail(struct thread *td, struct freebsd11_jail_args *uap) >> +sys_jail(struct thread *td, struct jail_args *uap) >> { >> uint32_t version; >> int error; >> @@ -281,16 +270,13 @@ freebsd11_jail(struct thread *td, struct >> freebsd11_jai >> /* Sci-Fi jails are not supported, sorry. */ >> return (EINVAL); >> } >> - return (freebsd11_kern_jail(td, &j)); >> + return (kern_jail(td, &j)); >> } >> >> int >> -freebsd11_kern_jail(struct thread *td, struct jail *j) >> +kern_jail(struct thread *td, struct jail *j) >> { >> - struct iovec optiov[2 * (3 >> -#ifdef PR_GLOBAL_ALLOW >> - + 1 + nitems(pr_flag_allow) >> -#endif >> + struct iovec optiov[2 * (4 + nitems(pr_flag_allow) >> #ifdef INET >> + 1 >> #endif >> @@ -300,10 +286,7 @@ freebsd11_kern_jail(struct thread *td, struct >> jail *j) >> )]; >> struct uio opt; >> char *u_path, *u_hostname, *u_name; >> -#ifdef PR_GLOBAL_ALLOW >> struct bool_flags *bf; >> - int enforce_statfs; >> -#endif >> #ifdef INET >> uint32_t ip4s; >> struct in_addr *u_ip4; >> @@ -312,7 +295,7 @@ freebsd11_kern_jail(struct thread *td, struct jail >> *j) >> struct in6_addr *u_ip6; >> #endif >> size_t tmplen; >> - int error; >> + int error, enforce_statfs; >> >> bzero(&optiov, sizeof(optiov)); >> opt.uio_iov = optiov; >> @@ -323,7 +306,6 @@ freebsd11_kern_jail(struct thread *td, struct jail >> *j) >> opt.uio_rw = UIO_READ; >> opt.uio_td = td; >> >> -#ifdef PR_GLOBAL_ALLOW >> /* Set permissions for top-level jails from sysctls. */ >> if (!jailed(td->td_ucred)) { >> for (bf = pr_flag_allow; >> @@ -345,7 +327,6 @@ freebsd11_kern_jail(struct thread *td, struct jail >> *j) >> optiov[opt.uio_iovcnt].iov_len = sizeof(enforce_statfs); >> opt.uio_iovcnt++; >> } >> -#endif >> >> tmplen = MAXPATHLEN + MAXHOSTNAMELEN + MAXHOSTNAMELEN; >> #ifdef INET >> @@ -449,7 +430,6 @@ freebsd11_kern_jail(struct thread *td, struct jail >> *j) >> free(u_path, M_TEMP); >> return (error); >> } >> -#endif /* COMPAT_FREEBSD11 */ >> >> >> /* >> @@ -1267,11 +1247,7 @@ kern_jail_set(struct thread *td, struct uio >> *optuio, i >> >> pr->pr_securelevel = ppr->pr_securelevel; >> pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; >> -#ifdef PR_GLOBAL_ALLOW >> pr->pr_enforce_statfs = jail_default_enforce_statfs; >> -#else >> - pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; >> -#endif >> pr->pr_devfs_rsnum = ppr->pr_devfs_rsnum; >> >> pr->pr_osreldate = osreldt ? osreldt : ppr->pr_osreldate; >> @@ -3439,7 +3415,6 @@ prison_path(struct prison *pr1, struct prison >> *pr2) >> static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW, 0, >> "Jails"); >> >> -#ifdef COMPAT_FREEBSD11 >> static int >> sysctl_jail_list(SYSCTL_HANDLER_ARGS) >> { >> @@ -3543,7 +3518,6 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) >> SYSCTL_OID(_security_jail, OID_AUTO, list, >> CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, >> sysctl_jail_list, "S", "List of active jails"); >> -#endif /* COMPAT_FREEBSD11 */ >> >> static int >> sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) >> @@ -3583,14 +3557,13 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vnet, >> #if defined(INET) || defined(INET6) >> SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, >> &jail_max_af_ips, 0, >> - "Number of IP addresses a jail may have at most per address >> family"); >> + "Number of IP addresses a jail may have at most per address >> family (deprecated)"); >> #endif >> >> /* >> - * Jail permissions - jailed processes can read these to find out >> what they are >> - * allowed to do. A deprecated use is to set default permissions for >> prisons >> - * created via jail(2). For historical reasons, the sysctl names >> have varying >> - * similarity to the parameter names. >> + * Default parameters for jail(2) compatibility. For historical >> reasons, >> + * the sysctl names have varying similarity to the parameter names. >> Prisons >> + * just see their own parameters, and can't change them. >> */ >> static int >> sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) >> @@ -3599,68 +3572,52 @@ sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) >> int allow, error, i; >> >> pr = req->td->td_ucred->cr_prison; >> -#ifdef PR_GLOBAL_ALLOW >> allow = (pr == &prison0) ? jail_default_allow : pr->pr_allow; >> -#else >> - allow = pr->pr_allow; >> -#endif >> >> /* Get the current flag value, and convert it to a boolean. */ >> i = (allow & arg2) ? 1 : 0; >> if (arg1 != NULL) >> i = !i; >> error = sysctl_handle_int(oidp, &i, 0, req); >> - if (error) >> + if (error || !req->newptr) >> return (error); >> -#ifdef PR_GLOBAL_ALLOW >> - if (req->newptr) { >> - i = i ? arg2 : 0; >> - if (arg1 != NULL) >> - i ^= arg2; >> - /* >> - * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 >> - * for writing. >> - */ >> - mtx_lock(&prison0.pr_mtx); >> - jail_default_allow = (jail_default_allow & ~arg2) | i; >> - mtx_unlock(&prison0.pr_mtx); >> - } >> -#endif >> + i = i ? arg2 : 0; >> + if (arg1 != NULL) >> + i ^= arg2; >> + /* >> + * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 >> + * for writing. >> + */ >> + mtx_lock(&prison0.pr_mtx); >> + jail_default_allow = (jail_default_allow & ~arg2) | i; >> + mtx_unlock(&prison0.pr_mtx); >> return (0); >> } >> >> -#ifdef PR_GLOBAL_ALLOW >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RW | CTLFLAG_MPSAFE) >> -#define ADDR_GLOBAL_ALLOW(i) &i >> -#else >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RD | CTLFLAG_MPSAFE) >> -#define ADDR_GLOBAL_ALLOW(i) NULL >> -#endif >> - >> SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", >> - "Processes in jail can set their hostnames"); >> + "Processes in jail can set their hostnames (deprecated)"); >> SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", >> - "Processes in jail are limited to creating UNIX/IP/route sockets >> only"); >> + "Processes in jail are limited to creating UNIX/IP/route sockets >> only (deprecated)"); >> SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", >> - "Processes in jail can use System V IPC primitives"); >> + "Processes in jail can use System V IPC primitives >> (deprecated)"); >> SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", >> - "Prison root can create raw sockets"); >> + "Prison root can create raw sockets (deprecated)"); >> SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", >> - "Processes in jail can alter system file flags"); >> + "Processes in jail can alter system file flags (deprecated)"); >> SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", >> - "Processes in jail can mount/unmount jail-friendly file >> systems"); >> + "Processes in jail can mount/unmount jail-friendly file systems >> (deprecated)"); >> >> static int >> sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) >> @@ -3669,33 +3626,25 @@ sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) >> int level, error; >> >> pr = req->td->td_ucred->cr_prison; >> -#ifdef PR_GLOBAL_ALLOW >> level = (pr == &prison0) ? *(int *)arg1 : *(int *)((char *)pr + >> arg2); >> -#else >> - level = *(int *)((char *)pr + arg2); >> -#endif >> error = sysctl_handle_int(oidp, &level, 0, req); >> - if (error) >> + if (error || !req->newptr) >> return (error); >> -#ifdef PR_GLOBAL_ALLOW >> - if (req->newptr) >> - *(int *)arg1 = level; >> -#endif >> + *(int *)arg1 = level; >> return (0); >> } >> >> SYSCTL_PROC(_security_jail, OID_AUTO, enforce_statfs, >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> - ADDR_GLOBAL_ALLOW(jail_default_enforce_statfs), >> - offsetof(struct prison, pr_enforce_statfs), >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> + &jail_default_enforce_statfs, offsetof(struct prison, >> pr_enforce_statfs), >> sysctl_jail_default_level, "I", >> - "Processes in jail cannot see all mounted file systems"); >> + "Processes in jail cannot see all mounted file systems >> (deprecated)"); >> + >> SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> - ADDR_GLOBAL_ALLOW(jail_default_devfs_rsnum), >> - offsetof(struct prison, pr_devfs_rsnum), >> + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, >> + &jail_default_devfs_rsnum, offsetof(struct prison, >> pr_devfs_rsnum), >> sysctl_jail_default_level, "I", >> - "Ruleset for the devfs filesystem in jail"); >> + "Ruleset for the devfs filesystem in jail (deprecated)"); >> >> /* >> * Nodes to describe jail parameters. Maximum length of string >> parameters >> @@ -3836,6 +3785,9 @@ prison_add_allow(const char *prefix, const char >> *name, >> struct bool_flags *bf; >> struct sysctl_oid *parent; >> char *allow_name, *allow_noname, *allowed; >> +#ifndef NO_SYSCTL_DESCR >> + char *descr_deprecated; >> +#endif >> unsigned allow_flag; >> >> if (prefix >> @@ -3892,7 +3844,10 @@ prison_add_allow(const char *prefix, const char >> *name, >> bf->flag = allow_flag; >> mtx_unlock(&prison0.pr_mtx); >> >> - /* Create sysctls for the paramter, and the current permission. */ >> + /* >> + * Create sysctls for the paramter, and the back-compat global >> + * permission. >> + */ >> parent = prefix >> ? SYSCTL_ADD_NODE(NULL, >> SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), >> @@ -3904,10 +3859,17 @@ prison_add_allow(const char *prefix, const >> char *name, >> if ((prefix >> ? asprintf(&allowed, M_TEMP, "%s_%s_allowed", prefix, name) >> : asprintf(&allowed, M_TEMP, "%s_allowed", name)) >= 0) { >> +#ifndef NO_SYSCTL_DESCR >> + (void)asprintf(&descr_deprecated, M_TEMP, "%s (deprecated)", >> + descr); >> +#endif >> (void)SYSCTL_ADD_PROC(NULL, >> SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, allowed, >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, allow_flag, >> - sysctl_jail_default_allow, "I", descr); >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, allow_flag, >> + sysctl_jail_default_allow, "I", descr_deprecated); >> +#ifndef NO_SYSCTL_DESCR >> + free(descr_deprecated, M_TEMP); >> +#endif >> free(allowed, M_TEMP); >> } >> return allow_flag; >> >> Modified: head/sys/kern/syscalls.c >> ============================================================================== >> --- head/sys/kern/syscalls.c Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/kern/syscalls.c Thu Aug 16 19:09:43 2018 (r337925) >> @@ -344,7 +344,7 @@ const char *syscallnames[] = { >> "utrace", /* 335 = utrace */ >> "compat4.sendfile", /* 336 = freebsd4 sendfile */ >> "kldsym", /* 337 = kldsym */ >> - "compat11.jail", /* 338 = freebsd11 jail */ >> + "jail", /* 338 = jail */ >> "nnpfs_syscall", /* 339 = nnpfs_syscall */ >> "sigprocmask", /* 340 = sigprocmask */ >> "sigsuspend", /* 341 = sigsuspend */ >> >> Modified: head/sys/kern/syscalls.master >> ============================================================================== >> --- head/sys/kern/syscalls.master Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/kern/syscalls.master Thu Aug 16 19:09:43 2018 (r337925) >> @@ -738,7 +738,7 @@ >> _Out_opt_ off_t *sbytes, int flags); } >> 337 AUE_NULL STD { int kldsym(int fileid, int cmd, \ >> _In_ void *data); } >> -338 AUE_JAIL COMPAT11 { int jail( \ >> +338 AUE_JAIL STD { int jail( \ >> _In_ struct jail *jail); } >> >> 339 AUE_NULL NOSTD|NOTSTATIC { int nnpfs_syscall(int operation, \ >> >> Modified: head/sys/kern/systrace_args.c >> ============================================================================== >> --- head/sys/kern/systrace_args.c Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/kern/systrace_args.c Thu Aug 16 19:09:43 2018 (r337925) >> @@ -1593,6 +1593,13 @@ systrace_args(int sysnum, void *params, >> uint64_t *uarg >> *n_args = 3; >> break; >> } >> + /* jail */ >> + case 338: { >> + struct jail_args *p = params; >> + uarg[0] = (intptr_t) p->jail; /* struct jail * */ >> + *n_args = 1; >> + break; >> + } >> /* nnpfs_syscall */ >> case 339: { >> struct nnpfs_syscall_args *p = params; >> @@ -5765,6 +5772,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, >> char *d >> break; >> }; >> break; >> + /* jail */ >> + case 338: >> + switch(ndx) { >> + case 0: >> + p = "userland struct jail *"; >> + break; >> + default: >> + break; >> + }; >> + break; >> /* nnpfs_syscall */ >> case 339: >> switch(ndx) { >> @@ -9627,6 +9644,11 @@ systrace_return_setargdesc(int sysnum, int ndx, >> char * >> break; >> /* kldsym */ >> case 337: >> + if (ndx == 0 || ndx == 1) >> + p = "int"; >> + break; >> + /* jail */ >> + case 338: >> if (ndx == 0 || ndx == 1) >> p = "int"; >> break; >> >> Modified: head/sys/sys/jail.h >> ============================================================================== >> --- head/sys/sys/jail.h Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/sys/jail.h Thu Aug 16 19:09:43 2018 (r337925) >> @@ -32,7 +32,6 @@ >> #ifndef _SYS_JAIL_H_ >> #define _SYS_JAIL_H_ >> >> -#ifdef COMPAT_FREEBSD11 >> #ifdef _KERNEL >> struct jail_v0 { >> u_int32_t version; >> @@ -58,6 +57,16 @@ struct jail { >> * For all xprison structs, always keep the pr_version an int and >> * the first variable so userspace can easily distinguish them. >> */ >> +#ifndef _KERNEL >> +struct xprison_v1 { >> + int pr_version; >> + int pr_id; >> + char pr_path[MAXPATHLEN]; >> + char pr_host[MAXHOSTNAMELEN]; >> + u_int32_t pr_ip; >> +}; >> +#endif >> + >> struct xprison { >> int pr_version; >> int pr_id; >> @@ -82,7 +91,6 @@ struct xprison { >> #define PRISON_STATE_INVALID 0 >> #define PRISON_STATE_ALIVE 1 >> #define PRISON_STATE_DYING 2 >> -#endif /* COMPAT_FREEBSD11 */ >> >> /* >> * Flags for jail_set and jail_get. >> @@ -102,6 +110,7 @@ struct xprison { >> >> struct iovec; >> >> +int jail(struct jail *); >> int jail_set(struct iovec *, unsigned int, int); >> int jail_get(struct iovec *, unsigned int, int); >> int jail_attach(int); >> >> Modified: head/sys/sys/syscall.h >> ============================================================================== >> --- head/sys/sys/syscall.h Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/sys/syscall.h Thu Aug 16 19:09:43 2018 (r337925) >> @@ -280,7 +280,7 @@ >> #define SYS_utrace 335 >> /* 336 is freebsd4 sendfile */ >> #define SYS_kldsym 337 >> -#define SYS_freebsd11_jail 338 >> +#define SYS_jail 338 >> #define SYS_nnpfs_syscall 339 >> #define SYS_sigprocmask 340 >> #define SYS_sigsuspend 341 >> >> Modified: head/sys/sys/syscall.mk >> ============================================================================== >> --- head/sys/sys/syscall.mk Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/sys/syscall.mk Thu Aug 16 19:09:43 2018 (r337925) >> @@ -209,7 +209,7 @@ MIASM = \ >> sched_rr_get_interval.o \ >> utrace.o \ >> kldsym.o \ >> - freebsd11_jail.o \ >> + jail.o \ >> nnpfs_syscall.o \ >> sigprocmask.o \ >> sigsuspend.o \ >> >> Modified: head/sys/sys/syscallsubr.h >> ============================================================================== >> --- head/sys/sys/syscallsubr.h Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/sys/syscallsubr.h Thu Aug 16 19:09:43 2018 (r337925) >> @@ -143,6 +143,7 @@ int kern_getsockname(struct thread *td, int fd, >> struct >> int kern_getsockopt(struct thread *td, int s, int level, int name, >> void *optval, enum uio_seg valseg, socklen_t *valsize); >> int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data); >> +int kern_jail(struct thread *td, struct jail *j); >> int kern_jail_get(struct thread *td, struct uio *options, int flags); >> int kern_jail_set(struct thread *td, struct uio *options, int flags); >> int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, >> @@ -307,6 +308,5 @@ struct freebsd11_dirent; >> >> int freebsd11_kern_getdirentries(struct thread *td, int fd, char >> *ubuf, u_int >> count, long *basep, void (*func)(struct freebsd11_dirent *)); >> -int freebsd11_kern_jail(struct thread *td, struct jail *j); >> >> #endif /* !_SYS_SYSCALLSUBR_H_ */ >> >> Modified: head/sys/sys/sysproto.h >> ============================================================================== >> --- head/sys/sys/sysproto.h Thu Aug 16 18:58:34 2018 (r337924) >> +++ head/sys/sys/sysproto.h Thu Aug 16 19:09:43 2018 (r337925) >> @@ -849,6 +849,9 @@ struct kldsym_args { >> char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; >> char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void >> *)]; >> }; >> +struct jail_args { >> + char jail_l_[PADL_(struct jail *)]; struct jail * jail; char >> jail_r_[PADR_(struct jail *)]; >> +}; >> struct nnpfs_syscall_args { >> char operation_l_[PADL_(int)]; int operation; char >> operation_r_[PADR_(int)]; >> char a_pathP_l_[PADL_(char *)]; char * a_pathP; char >> a_pathP_r_[PADR_(char *)]; >> @@ -1958,6 +1961,7 @@ int sys_sched_get_priority_min(struct thread *, >> struct >> int sys_sched_rr_get_interval(struct thread *, struct >> sched_rr_get_interval_args *); >> int sys_utrace(struct thread *, struct utrace_args *); >> int sys_kldsym(struct thread *, struct kldsym_args *); >> +int sys_jail(struct thread *, struct jail_args *); >> int sys_nnpfs_syscall(struct thread *, struct nnpfs_syscall_args *); >> int sys_sigprocmask(struct thread *, struct sigprocmask_args *); >> int sys_sigsuspend(struct thread *, struct sigsuspend_args *); >> @@ -2527,9 +2531,6 @@ struct freebsd11_fhstat_args { >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; >> char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * >> sb; char sb_r_[PADR_(struct freebsd11_stat *)]; >> }; >> -struct freebsd11_jail_args { >> - char jail_l_[PADL_(struct jail *)]; struct jail * jail; char >> jail_r_[PADR_(struct jail *)]; >> -}; >> struct freebsd11_kevent_args { >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; >> char changelist_l_[PADL_(struct kevent_freebsd11 *)]; struct >> kevent_freebsd11 * changelist; char changelist_r_[PADR_(struct >> kevent_freebsd11 *)]; >> @@ -2578,7 +2579,6 @@ int freebsd11_nstat(struct thread *, struct >> freebsd11_ >> int freebsd11_nfstat(struct thread *, struct freebsd11_nfstat_args >> *); >> int freebsd11_nlstat(struct thread *, struct freebsd11_nlstat_args >> *); >> int freebsd11_fhstat(struct thread *, struct freebsd11_fhstat_args >> *); >> -int freebsd11_jail(struct thread *, struct freebsd11_jail_args *); >> int freebsd11_kevent(struct thread *, struct freebsd11_kevent_args >> *); >> int freebsd11_getfsstat(struct thread *, struct >> freebsd11_getfsstat_args *); >> int freebsd11_statfs(struct thread *, struct freebsd11_statfs_args >> *); >> @@ -2849,7 +2849,7 @@ int freebsd11_mknodat(struct thread *, struct >> freebsd1 >> #define SYS_AUE_utrace AUE_NULL >> #define SYS_AUE_freebsd4_sendfile AUE_SENDFILE >> #define SYS_AUE_kldsym AUE_NULL >> -#define SYS_AUE_freebsd11_jail AUE_JAIL >> +#define SYS_AUE_jail AUE_JAIL >> #define SYS_AUE_nnpfs_syscall AUE_NULL >> #define SYS_AUE_sigprocmask AUE_SIGPROCMASK >> #define SYS_AUE_sigsuspend AUE_SIGSUSPEND >> >> From owner-svn-src-all@freebsd.org Thu Aug 16 19:36: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 F2A0810746C1; Thu, 16 Aug 2018 19:36:35 +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 0778E75979; Thu, 16 Aug 2018 19:36:34 +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 w7GJaXYv055457; Thu, 16 Aug 2018 12:36:33 -0700 (PDT) (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 w7GJaX0Z055456; Thu, 16 Aug 2018 12:36:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808161936.w7GJaX0Z055456@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337925 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys In-Reply-To: <195df064ecc0afb74d0d3f791c5087eb@freebsd.org> To: James Gritton Date: Thu, 16 Aug 2018 12:36:33 -0700 (PDT) CC: rgrimes@freebsd.org, 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:36:36 -0000 > OK, so noted. But seeing as I've already done the partial in this case, > what's best to do now? Should I add another commit to revert the so-far > unreverted files? Thats a mixed bag, how many files is it, and what would the commit message before for them? Usually these are seperable changes that should not of been combined with the original commit. > > - Jamie > > > On 2018-08-16 13:27, Rodney W. Grimes wrote: > >> Author: jamie > >> Date: Thu Aug 16 19:09:43 2018 > >> New Revision: 337925 > >> URL: https://svnweb.freebsd.org/changeset/base/337925 > >> > >> Log: > >> Revert r337922, except for some documention-only bits. This needs > >> to wait > >> until user is changed to stop using jail(2). > > > > Can we please stop doing "partial" reverts, it makes log > > tracking and sorting out stuff later more difficult. > > > > If something is seperable and needs to stay it is best > > to revert the whole commit, and then commit with a proper > > log exactly what it is that you did not want to revert. > > > >> > >> Differential Revision: D14791 > >> > >> Modified: > >> head/lib/libc/sys/jail.2 > >> head/sys/compat/freebsd32/freebsd32_misc.c > >> head/sys/compat/freebsd32/freebsd32_proto.h > >> head/sys/compat/freebsd32/freebsd32_syscall.h > >> head/sys/compat/freebsd32/freebsd32_syscalls.c > >> head/sys/compat/freebsd32/freebsd32_sysent.c > >> head/sys/compat/freebsd32/freebsd32_systrace_args.c > >> head/sys/compat/freebsd32/syscalls.master > >> head/sys/kern/init_sysent.c > >> head/sys/kern/kern_jail.c > >> head/sys/kern/syscalls.c > >> head/sys/kern/syscalls.master > >> head/sys/kern/systrace_args.c > >> head/sys/sys/jail.h > >> head/sys/sys/syscall.h > >> head/sys/sys/syscall.mk > >> head/sys/sys/syscallsubr.h > >> head/sys/sys/sysproto.h > >> > >> Modified: head/lib/libc/sys/jail.2 > >> ============================================================================== > >> --- head/lib/libc/sys/jail.2 Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/lib/libc/sys/jail.2 Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -25,10 +25,11 @@ > >> .\" > >> .\" $FreeBSD$ > >> .\" > >> -.Dd August 16, 2018 > >> +.Dd February 8, 2012 > >> .Dt JAIL 2 > >> .Os > >> .Sh NAME > >> +.Nm jail , > >> .Nm jail_get , > >> .Nm jail_set , > >> .Nm jail_remove , > >> @@ -40,6 +41,8 @@ > >> .In sys/param.h > >> .In sys/jail.h > >> .Ft int > >> +.Fn jail "struct jail *jail" > >> +.Ft int > >> .Fn jail_attach "int jid" > >> .Ft int > >> .Fn jail_remove "int jid" > >> @@ -50,7 +53,74 @@ > >> .Fn jail_set "struct iovec *iov" "u_int niov" "int flags" > >> .Sh DESCRIPTION > >> The > >> +.Fn jail > >> +system call sets up a jail and locks the current process in it. > >> +.Pp > >> +The argument is a pointer to a structure describing the prison: > >> +.Bd -literal -offset indent > >> +struct jail { > >> + uint32_t version; > >> + char *path; > >> + char *hostname; > >> + char *jailname; > >> + unsigned int ip4s; > >> + unsigned int ip6s; > >> + struct in_addr *ip4; > >> + struct in6_addr *ip6; > >> +}; > >> +.Ed > >> +.Pp > >> +.Dq Li version > >> +defines the version of the API in use. > >> +.Dv JAIL_API_VERSION > >> +is defined for the current version. > >> +.Pp > >> +The > >> +.Dq Li path > >> +pointer should be set to the directory which is to be the root of the > >> +prison. > >> +.Pp > >> +The > >> +.Dq Li hostname > >> +pointer can be set to the hostname of the prison. > >> +This can be changed > >> +from the inside of the prison. > >> +.Pp > >> +The > >> +.Dq Li jailname > >> +pointer is an optional name that can be assigned to the jail > >> +for example for management purposes. > >> +.Pp > >> +The > >> +.Dq Li ip4s > >> +and > >> +.Dq Li ip6s > >> +give the numbers of IPv4 and IPv6 addresses that will be passed > >> +via their respective pointers. > >> +.Pp > >> +The > >> +.Dq Li ip4 > >> +and > >> +.Dq Li ip6 > >> +pointers can be set to an arrays of IPv4 and IPv6 addresses to be > >> assigned to > >> +the prison, or NULL if none. > >> +IPv4 addresses must be in network byte order. > >> +.Pp > >> +This is equivalent to, and deprecated in favor of, the > >> .Fn jail_set > >> +system call (see below), with the parameters > >> +.Va path , > >> +.Va host.hostname , > >> +.Va name , > >> +.Va ip4.addr , > >> +and > >> +.Va ip6.addr , > >> +and with the > >> +.Dv JAIL_ATTACH > >> +flag. > >> +.Pp > >> +The > >> +.Fn jail_set > >> system call creates a new jail, or modifies an existing one, and > >> optionally > >> locks the current process in it. > >> Jail parameters are passed as an array of name-value pairs in the > >> array > >> @@ -76,19 +146,13 @@ The current set of available parameters, and > >> their for > >> retrieved via the > >> .Va security.jail.param > >> sysctl MIB entry. > >> -Notable parameters include > >> +Notable parameters include those mentioned in the > >> +.Fn jail > >> +description above, as well as > >> .Va jid > >> and > >> -.Va name > >> -which identify the jail being created or modified, > >> -.Va path > >> -(the root directory of the jail), > >> -.Va host.hostname > >> -(the hostname of the jail), and > >> -.Va ip4.addr > >> -and > >> -.Va ip6.addr > >> -(IP addresses to assign to the jail). > >> +.Va name , > >> +which identify the jail being created or modified. > >> See > >> .Xr jail 8 > >> for more information on the core jail parameters. > >> @@ -173,7 +237,8 @@ It will kill all processes belonging to the jail, > >> and > >> of that jail. > >> .Sh RETURN VALUES > >> If successful, > >> -.Fn jail_set > >> +.Fn jail , > >> +.Fn jail_set , > >> and > >> .Fn jail_get > >> return a non-negative integer, termed the jail identifier (JID). > >> @@ -184,6 +249,25 @@ to indicate the error. > >> .Rv -std jail_attach jail_remove > >> .Sh ERRORS > >> The > >> +.Fn jail > >> +system call > >> +will fail if: > >> +.Bl -tag -width Er > >> +.It Bq Er EPERM > >> +This process is not allowed to create a jail, either because it is > >> not > >> +the super-user, or because it would exceed the jail's > >> +.Va children.max > >> +limit. > >> +.It Bq Er EFAULT > >> +.Fa jail > >> +points to an address outside the allocated address space of the > >> process. > >> +.It Bq Er EINVAL > >> +The version number of the argument is not correct. > >> +.It Bq Er EAGAIN > >> +No free JID could be found. > >> +.El > >> +.Pp > >> +The > >> .Fn jail_set > >> system call > >> will fail if: > >> @@ -287,7 +371,8 @@ does not exist. > >> .El > >> .Pp > >> Further > >> -.Fn jail_set > >> +.Fn jail , > >> +.Fn jail_set , > >> and > >> .Fn jail_attach > >> call > >> @@ -301,7 +386,7 @@ manual page for details. > >> .Xr chroot 2 , > >> .Xr jail 8 > >> .Sh HISTORY > >> -The now-deprecated > >> +The > >> .Fn jail > >> system call appeared in > >> .Fx 4.0 . > >> > >> Modified: head/sys/compat/freebsd32/freebsd32_misc.c > >> ============================================================================== > >> --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 18:58:34 > >> 2018 (r337924) > >> +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 19:09:43 > >> 2018 (r337925) > >> @@ -2289,10 +2289,8 @@ freebsd32_sysctl(struct thread *td, struct > >> freebsd32_s > >> return (0); > >> } > >> > >> -#ifdef COMPAT_FREEBSD11 > >> int > >> -freebsd11_freebsd32_jail(struct thread *td, > >> - struct freebsd11_freebsd32_jail_args *uap) > >> +freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) > >> { > >> uint32_t version; > >> int error; > >> @@ -2349,9 +2347,8 @@ freebsd11_freebsd32_jail(struct thread *td, > >> /* Sci-Fi jails are not supported, sorry. */ > >> return (EINVAL); > >> } > >> - return (freebsd11_kern_jail(td, &j)); > >> + return (kern_jail(td, &j)); > >> } > >> -#endif /* COMPAT_FREEBSD11 */ > >> > >> int > >> freebsd32_jail_set(struct thread *td, struct freebsd32_jail_set_args > >> *uap) > >> > >> Modified: head/sys/compat/freebsd32/freebsd32_proto.h > >> ============================================================================== > >> --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 18:58:34 > >> 2018 (r337924) > >> +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 19:09:43 > >> 2018 (r337925) > >> @@ -283,6 +283,9 @@ struct freebsd32_sched_rr_get_interval_args { > >> char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; > >> char interval_l_[PADL_(struct timespec32 *)]; struct timespec32 * > >> interval; char interval_r_[PADR_(struct timespec32 *)]; > >> }; > >> +struct freebsd32_jail_args { > >> + char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char > >> jail_r_[PADR_(struct jail32 *)]; > >> +}; > >> struct freebsd32_sigtimedwait_args { > >> char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char > >> set_r_[PADR_(const sigset_t *)]; > >> char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char > >> info_r_[PADR_(siginfo_t *)]; > >> @@ -758,6 +761,7 @@ int freebsd32_aio_return(struct thread *, struct > >> freeb > >> int freebsd32_aio_suspend(struct thread *, struct > >> freebsd32_aio_suspend_args *); > >> int freebsd32_aio_error(struct thread *, struct > >> freebsd32_aio_error_args *); > >> int freebsd32_sched_rr_get_interval(struct thread *, struct > >> freebsd32_sched_rr_get_interval_args *); > >> +int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); > >> int freebsd32_sigtimedwait(struct thread *, struct > >> freebsd32_sigtimedwait_args *); > >> int freebsd32_sigwaitinfo(struct thread *, struct > >> freebsd32_sigwaitinfo_args *); > >> int freebsd32_aio_waitcomplete(struct thread *, struct > >> freebsd32_aio_waitcomplete_args *); > >> @@ -1180,9 +1184,6 @@ struct freebsd11_freebsd32_fhstat_args { > >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * > >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; > >> char sb_l_[PADL_(struct freebsd11_stat32 *)]; struct > >> freebsd11_stat32 * sb; char sb_r_[PADR_(struct freebsd11_stat32 *)]; > >> }; > >> -struct freebsd11_freebsd32_jail_args { > >> - char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char > >> jail_r_[PADR_(struct jail32 *)]; > >> -}; > >> struct freebsd11_freebsd32_kevent_args { > >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; > >> char changelist_l_[PADL_(const struct kevent32_freebsd11 *)]; const > >> struct kevent32_freebsd11 * changelist; char changelist_r_[PADR_(const > >> struct kevent32_freebsd11 *)]; > >> @@ -1222,7 +1223,6 @@ int freebsd11_freebsd32_lstat(struct thread *, > >> struct > >> int freebsd11_freebsd32_getdirentries(struct thread *, struct > >> freebsd11_freebsd32_getdirentries_args *); > >> int freebsd11_freebsd32_getdents(struct thread *, struct > >> freebsd11_freebsd32_getdents_args *); > >> int freebsd11_freebsd32_fhstat(struct thread *, struct > >> freebsd11_freebsd32_fhstat_args *); > >> -int freebsd11_freebsd32_jail(struct thread *, struct > >> freebsd11_freebsd32_jail_args *); > >> int freebsd11_freebsd32_kevent(struct thread *, struct > >> freebsd11_freebsd32_kevent_args *); > >> int freebsd11_freebsd32_fstatat(struct thread *, struct > >> freebsd11_freebsd32_fstatat_args *); > >> int freebsd11_freebsd32_mknodat(struct thread *, struct > >> freebsd11_freebsd32_mknodat_args *); > >> @@ -1317,7 +1317,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, > >> struc > >> > >> #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_LIO_LISTIO > >> #define FREEBSD32_SYS_AUE_freebsd32_sched_rr_get_interval AUE_NULL > >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE > >> -#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_jail AUE_JAIL > >> +#define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL > >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION > >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN > >> #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT > >> > >> Modified: head/sys/compat/freebsd32/freebsd32_syscall.h > >> ============================================================================== > >> --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 18:58:34 > >> 2018 (r337924) > >> +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 19:09:43 > >> 2018 (r337925) > >> @@ -275,7 +275,7 @@ > >> #define FREEBSD32_SYS_utrace 335 > >> /* 336 is freebsd4 freebsd32_sendfile */ > >> #define FREEBSD32_SYS_kldsym 337 > >> -#define FREEBSD32_SYS_freebsd11_freebsd32_jail 338 > >> +#define FREEBSD32_SYS_freebsd32_jail 338 > >> #define FREEBSD32_SYS_sigprocmask 340 > >> #define FREEBSD32_SYS_sigsuspend 341 > >> /* 342 is freebsd4 freebsd32_sigaction */ > >> > >> Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c > >> ============================================================================== > >> --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 18:58:34 > >> 2018 (r337924) > >> +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 19:09:43 > >> 2018 (r337925) > >> @@ -347,7 +347,7 @@ const char *freebsd32_syscallnames[] = { > >> "utrace", /* 335 = utrace */ > >> "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile > >> */ > >> "kldsym", /* 337 = kldsym */ > >> - "compat11.freebsd32_jail", /* 338 = freebsd11 freebsd32_jail */ > >> + "freebsd32_jail", /* 338 = freebsd32_jail */ > >> "#339", /* 339 = pioctl */ > >> "sigprocmask", /* 340 = sigprocmask */ > >> "sigsuspend", /* 341 = sigsuspend */ > >> > >> Modified: head/sys/compat/freebsd32/freebsd32_sysent.c > >> ============================================================================== > >> --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 18:58:34 > >> 2018 (r337924) > >> +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 19:09:43 > >> 2018 (r337925) > >> @@ -394,7 +394,7 @@ struct sysent freebsd32_sysent[] = { > >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, > >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ > >> { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), > >> AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = > >> freebsd4 freebsd32_sendfile */ > >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, > >> SY_THR_STATIC }, /* 337 = kldsym */ > >> - { compat11(AS(freebsd11_freebsd32_jail_args),freebsd32_jail), > >> AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 > >> freebsd32_jail */ > >> + { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, > >> NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd32_jail */ > >> { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT > >> }, /* 339 = pioctl */ > >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, > >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = > >> sigprocmask */ > >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, > >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ > >> > >> Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c > >> ============================================================================== > >> --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 > >> 18:58:34 2018 (r337924) > >> +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 > >> 19:09:43 2018 (r337925) > >> @@ -1559,6 +1559,13 @@ systrace_args(int sysnum, void *params, > >> uint64_t *uarg > >> *n_args = 3; > >> break; > >> } > >> + /* freebsd32_jail */ > >> + case 338: { > >> + struct freebsd32_jail_args *p = params; > >> + uarg[0] = (intptr_t) p->jail; /* struct jail32 * */ > >> + *n_args = 1; > >> + break; > >> + } > >> /* sigprocmask */ > >> case 340: { > >> struct sigprocmask_args *p = params; > >> @@ -5704,6 +5711,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, > >> char *d > >> break; > >> }; > >> break; > >> + /* freebsd32_jail */ > >> + case 338: > >> + switch(ndx) { > >> + case 0: > >> + p = "userland struct jail32 *"; > >> + break; > >> + default: > >> + break; > >> + }; > >> + break; > >> /* sigprocmask */ > >> case 340: > >> switch(ndx) { > >> @@ -9653,6 +9670,11 @@ systrace_return_setargdesc(int sysnum, int ndx, > >> char * > >> break; > >> /* kldsym */ > >> case 337: > >> + if (ndx == 0 || ndx == 1) > >> + p = "int"; > >> + break; > >> + /* freebsd32_jail */ > >> + case 338: > >> if (ndx == 0 || ndx == 1) > >> p = "int"; > >> break; > >> > >> Modified: head/sys/compat/freebsd32/syscalls.master > >> ============================================================================== > >> --- head/sys/compat/freebsd32/syscalls.master Thu Aug 16 18:58:34 > >> 2018 (r337924) > >> +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 16 19:09:43 > >> 2018 (r337925) > >> @@ -601,7 +601,7 @@ > >> off_t *sbytes, int flags); } > >> 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ > >> void *data); } > >> -338 AUE_JAIL COMPAT11 { int freebsd32_jail(struct jail32 *jail); } > >> +338 AUE_JAIL STD { int freebsd32_jail(struct jail32 *jail); } > >> 339 AUE_NULL UNIMPL pioctl > >> 340 AUE_SIGPROCMASK NOPROTO { int sigprocmask(int how, \ > >> const sigset_t *set, sigset_t *oset); } > >> > >> Modified: head/sys/kern/init_sysent.c > >> ============================================================================== > >> --- head/sys/kern/init_sysent.c Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/kern/init_sysent.c Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -387,7 +387,7 @@ struct sysent sysent[] = { > >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, > >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ > >> { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, > >> 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ > >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, > >> SY_THR_STATIC }, /* 337 = kldsym */ > >> - { compat11(AS(freebsd11_jail_args),jail), AUE_JAIL, NULL, 0, 0, 0, > >> SY_THR_STATIC }, /* 338 = freebsd11 jail */ > >> + { AS(jail_args), (sy_call_t *)sys_jail, AUE_JAIL, NULL, 0, 0, 0, > >> SY_THR_STATIC }, /* 338 = jail */ > >> { AS(nnpfs_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, > >> 0, 0, SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ > >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, > >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = > >> sigprocmask */ > >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, > >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ > >> > >> Modified: head/sys/kern/kern_jail.c > >> ============================================================================== > >> --- head/sys/kern/kern_jail.c Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/kern/kern_jail.c Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -74,14 +74,6 @@ __FBSDID("$FreeBSD$"); > >> > >> #include > >> > >> -/* > >> - * The old jail(2) interface will exist under COMPAT_FREEBSD11, but > >> the global > >> - * permission sysctls are slated to go away sometime (even with > >> COMPAT). > >> - */ > >> -#if defined(COMPAT_FREEBSD11) && !defined(BURN_BRIDGES) > >> -#define PR_GLOBAL_ALLOW > >> -#endif > >> - > >> #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" > >> > >> MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); > >> @@ -207,11 +199,9 @@ const size_t pr_flag_allow_size = > >> sizeof(pr_flag_allow > >> #define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | > >> PR_ALLOW_RESERVED_PORTS) > >> #define JAIL_DEFAULT_ENFORCE_STATFS 2 > >> #define JAIL_DEFAULT_DEVFS_RSNUM 0 > >> -#ifdef PR_GLOBAL_ALLOW > >> static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; > >> static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; > >> static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; > >> -#endif > >> #if defined(INET) || defined(INET6) > >> static unsigned jail_max_af_ips = 255; > >> #endif > >> @@ -229,14 +219,13 @@ prison0_init(void) > >> strlcpy(prison0.pr_osrelease, osrelease, > >> sizeof(prison0.pr_osrelease)); > >> } > >> > >> -#ifdef COMPAT_FREEBSD11 > >> /* > >> * struct jail_args { > >> * struct jail *jail; > >> * }; > >> */ > >> int > >> -freebsd11_jail(struct thread *td, struct freebsd11_jail_args *uap) > >> +sys_jail(struct thread *td, struct jail_args *uap) > >> { > >> uint32_t version; > >> int error; > >> @@ -281,16 +270,13 @@ freebsd11_jail(struct thread *td, struct > >> freebsd11_jai > >> /* Sci-Fi jails are not supported, sorry. */ > >> return (EINVAL); > >> } > >> - return (freebsd11_kern_jail(td, &j)); > >> + return (kern_jail(td, &j)); > >> } > >> > >> int > >> -freebsd11_kern_jail(struct thread *td, struct jail *j) > >> +kern_jail(struct thread *td, struct jail *j) > >> { > >> - struct iovec optiov[2 * (3 > >> -#ifdef PR_GLOBAL_ALLOW > >> - + 1 + nitems(pr_flag_allow) > >> -#endif > >> + struct iovec optiov[2 * (4 + nitems(pr_flag_allow) > >> #ifdef INET > >> + 1 > >> #endif > >> @@ -300,10 +286,7 @@ freebsd11_kern_jail(struct thread *td, struct > >> jail *j) > >> )]; > >> struct uio opt; > >> char *u_path, *u_hostname, *u_name; > >> -#ifdef PR_GLOBAL_ALLOW > >> struct bool_flags *bf; > >> - int enforce_statfs; > >> -#endif > >> #ifdef INET > >> uint32_t ip4s; > >> struct in_addr *u_ip4; > >> @@ -312,7 +295,7 @@ freebsd11_kern_jail(struct thread *td, struct jail > >> *j) > >> struct in6_addr *u_ip6; > >> #endif > >> size_t tmplen; > >> - int error; > >> + int error, enforce_statfs; > >> > >> bzero(&optiov, sizeof(optiov)); > >> opt.uio_iov = optiov; > >> @@ -323,7 +306,6 @@ freebsd11_kern_jail(struct thread *td, struct jail > >> *j) > >> opt.uio_rw = UIO_READ; > >> opt.uio_td = td; > >> > >> -#ifdef PR_GLOBAL_ALLOW > >> /* Set permissions for top-level jails from sysctls. */ > >> if (!jailed(td->td_ucred)) { > >> for (bf = pr_flag_allow; > >> @@ -345,7 +327,6 @@ freebsd11_kern_jail(struct thread *td, struct jail > >> *j) > >> optiov[opt.uio_iovcnt].iov_len = sizeof(enforce_statfs); > >> opt.uio_iovcnt++; > >> } > >> -#endif > >> > >> tmplen = MAXPATHLEN + MAXHOSTNAMELEN + MAXHOSTNAMELEN; > >> #ifdef INET > >> @@ -449,7 +430,6 @@ freebsd11_kern_jail(struct thread *td, struct jail > >> *j) > >> free(u_path, M_TEMP); > >> return (error); > >> } > >> -#endif /* COMPAT_FREEBSD11 */ > >> > >> > >> /* > >> @@ -1267,11 +1247,7 @@ kern_jail_set(struct thread *td, struct uio > >> *optuio, i > >> > >> pr->pr_securelevel = ppr->pr_securelevel; > >> pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; > >> -#ifdef PR_GLOBAL_ALLOW > >> pr->pr_enforce_statfs = jail_default_enforce_statfs; > >> -#else > >> - pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; > >> -#endif > >> pr->pr_devfs_rsnum = ppr->pr_devfs_rsnum; > >> > >> pr->pr_osreldate = osreldt ? osreldt : ppr->pr_osreldate; > >> @@ -3439,7 +3415,6 @@ prison_path(struct prison *pr1, struct prison > >> *pr2) > >> static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW, 0, > >> "Jails"); > >> > >> -#ifdef COMPAT_FREEBSD11 > >> static int > >> sysctl_jail_list(SYSCTL_HANDLER_ARGS) > >> { > >> @@ -3543,7 +3518,6 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) > >> SYSCTL_OID(_security_jail, OID_AUTO, list, > >> CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, > >> sysctl_jail_list, "S", "List of active jails"); > >> -#endif /* COMPAT_FREEBSD11 */ > >> > >> static int > >> sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) > >> @@ -3583,14 +3557,13 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vnet, > >> #if defined(INET) || defined(INET6) > >> SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, > >> &jail_max_af_ips, 0, > >> - "Number of IP addresses a jail may have at most per address > >> family"); > >> + "Number of IP addresses a jail may have at most per address > >> family (deprecated)"); > >> #endif > >> > >> /* > >> - * Jail permissions - jailed processes can read these to find out > >> what they are > >> - * allowed to do. A deprecated use is to set default permissions for > >> prisons > >> - * created via jail(2). For historical reasons, the sysctl names > >> have varying > >> - * similarity to the parameter names. > >> + * Default parameters for jail(2) compatibility. For historical > >> reasons, > >> + * the sysctl names have varying similarity to the parameter names. > >> Prisons > >> + * just see their own parameters, and can't change them. > >> */ > >> static int > >> sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) > >> @@ -3599,68 +3572,52 @@ sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) > >> int allow, error, i; > >> > >> pr = req->td->td_ucred->cr_prison; > >> -#ifdef PR_GLOBAL_ALLOW > >> allow = (pr == &prison0) ? jail_default_allow : pr->pr_allow; > >> -#else > >> - allow = pr->pr_allow; > >> -#endif > >> > >> /* Get the current flag value, and convert it to a boolean. */ > >> i = (allow & arg2) ? 1 : 0; > >> if (arg1 != NULL) > >> i = !i; > >> error = sysctl_handle_int(oidp, &i, 0, req); > >> - if (error) > >> + if (error || !req->newptr) > >> return (error); > >> -#ifdef PR_GLOBAL_ALLOW > >> - if (req->newptr) { > >> - i = i ? arg2 : 0; > >> - if (arg1 != NULL) > >> - i ^= arg2; > >> - /* > >> - * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 > >> - * for writing. > >> - */ > >> - mtx_lock(&prison0.pr_mtx); > >> - jail_default_allow = (jail_default_allow & ~arg2) | i; > >> - mtx_unlock(&prison0.pr_mtx); > >> - } > >> -#endif > >> + i = i ? arg2 : 0; > >> + if (arg1 != NULL) > >> + i ^= arg2; > >> + /* > >> + * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 > >> + * for writing. > >> + */ > >> + mtx_lock(&prison0.pr_mtx); > >> + jail_default_allow = (jail_default_allow & ~arg2) | i; > >> + mtx_unlock(&prison0.pr_mtx); > >> return (0); > >> } > >> > >> -#ifdef PR_GLOBAL_ALLOW > >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RW | CTLFLAG_MPSAFE) > >> -#define ADDR_GLOBAL_ALLOW(i) &i > >> -#else > >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RD | CTLFLAG_MPSAFE) > >> -#define ADDR_GLOBAL_ALLOW(i) NULL > >> -#endif > >> - > >> SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, > >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", > >> - "Processes in jail can set their hostnames"); > >> + "Processes in jail can set their hostnames (deprecated)"); > >> SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, > >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", > >> - "Processes in jail are limited to creating UNIX/IP/route sockets > >> only"); > >> + "Processes in jail are limited to creating UNIX/IP/route sockets > >> only (deprecated)"); > >> SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, > >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", > >> - "Processes in jail can use System V IPC primitives"); > >> + "Processes in jail can use System V IPC primitives > >> (deprecated)"); > >> SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, > >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", > >> - "Prison root can create raw sockets"); > >> + "Prison root can create raw sockets (deprecated)"); > >> SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, > >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", > >> - "Processes in jail can alter system file flags"); > >> + "Processes in jail can alter system file flags (deprecated)"); > >> SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, > >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", > >> - "Processes in jail can mount/unmount jail-friendly file > >> systems"); > >> + "Processes in jail can mount/unmount jail-friendly file systems > >> (deprecated)"); > >> > >> static int > >> sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) > >> @@ -3669,33 +3626,25 @@ sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) > >> int level, error; > >> > >> pr = req->td->td_ucred->cr_prison; > >> -#ifdef PR_GLOBAL_ALLOW > >> level = (pr == &prison0) ? *(int *)arg1 : *(int *)((char *)pr + > >> arg2); > >> -#else > >> - level = *(int *)((char *)pr + arg2); > >> -#endif > >> error = sysctl_handle_int(oidp, &level, 0, req); > >> - if (error) > >> + if (error || !req->newptr) > >> return (error); > >> -#ifdef PR_GLOBAL_ALLOW > >> - if (req->newptr) > >> - *(int *)arg1 = level; > >> -#endif > >> + *(int *)arg1 = level; > >> return (0); > >> } > >> > >> SYSCTL_PROC(_security_jail, OID_AUTO, enforce_statfs, > >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> - ADDR_GLOBAL_ALLOW(jail_default_enforce_statfs), > >> - offsetof(struct prison, pr_enforce_statfs), > >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> + &jail_default_enforce_statfs, offsetof(struct prison, > >> pr_enforce_statfs), > >> sysctl_jail_default_level, "I", > >> - "Processes in jail cannot see all mounted file systems"); > >> + "Processes in jail cannot see all mounted file systems > >> (deprecated)"); > >> + > >> SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, > >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> - ADDR_GLOBAL_ALLOW(jail_default_devfs_rsnum), > >> - offsetof(struct prison, pr_devfs_rsnum), > >> + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, > >> + &jail_default_devfs_rsnum, offsetof(struct prison, > >> pr_devfs_rsnum), > >> sysctl_jail_default_level, "I", > >> - "Ruleset for the devfs filesystem in jail"); > >> + "Ruleset for the devfs filesystem in jail (deprecated)"); > >> > >> /* > >> * Nodes to describe jail parameters. Maximum length of string > >> parameters > >> @@ -3836,6 +3785,9 @@ prison_add_allow(const char *prefix, const char > >> *name, > >> struct bool_flags *bf; > >> struct sysctl_oid *parent; > >> char *allow_name, *allow_noname, *allowed; > >> +#ifndef NO_SYSCTL_DESCR > >> + char *descr_deprecated; > >> +#endif > >> unsigned allow_flag; > >> > >> if (prefix > >> @@ -3892,7 +3844,10 @@ prison_add_allow(const char *prefix, const char > >> *name, > >> bf->flag = allow_flag; > >> mtx_unlock(&prison0.pr_mtx); > >> > >> - /* Create sysctls for the paramter, and the current permission. */ > >> + /* > >> + * Create sysctls for the paramter, and the back-compat global > >> + * permission. > >> + */ > >> parent = prefix > >> ? SYSCTL_ADD_NODE(NULL, > >> SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), > >> @@ -3904,10 +3859,17 @@ prison_add_allow(const char *prefix, const > >> char *name, > >> if ((prefix > >> ? asprintf(&allowed, M_TEMP, "%s_%s_allowed", prefix, name) > >> : asprintf(&allowed, M_TEMP, "%s_allowed", name)) >= 0) { > >> +#ifndef NO_SYSCTL_DESCR > >> + (void)asprintf(&descr_deprecated, M_TEMP, "%s (deprecated)", > >> + descr); > >> +#endif > >> (void)SYSCTL_ADD_PROC(NULL, > >> SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, allowed, > >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, allow_flag, > >> - sysctl_jail_default_allow, "I", descr); > >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, allow_flag, > >> + sysctl_jail_default_allow, "I", descr_deprecated); > >> +#ifndef NO_SYSCTL_DESCR > >> + free(descr_deprecated, M_TEMP); > >> +#endif > >> free(allowed, M_TEMP); > >> } > >> return allow_flag; > >> > >> Modified: head/sys/kern/syscalls.c > >> ============================================================================== > >> --- head/sys/kern/syscalls.c Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/kern/syscalls.c Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -344,7 +344,7 @@ const char *syscallnames[] = { > >> "utrace", /* 335 = utrace */ > >> "compat4.sendfile", /* 336 = freebsd4 sendfile */ > >> "kldsym", /* 337 = kldsym */ > >> - "compat11.jail", /* 338 = freebsd11 jail */ > >> + "jail", /* 338 = jail */ > >> "nnpfs_syscall", /* 339 = nnpfs_syscall */ > >> "sigprocmask", /* 340 = sigprocmask */ > >> "sigsuspend", /* 341 = sigsuspend */ > >> > >> Modified: head/sys/kern/syscalls.master > >> ============================================================================== > >> --- head/sys/kern/syscalls.master Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/kern/syscalls.master Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -738,7 +738,7 @@ > >> _Out_opt_ off_t *sbytes, int flags); } > >> 337 AUE_NULL STD { int kldsym(int fileid, int cmd, \ > >> _In_ void *data); } > >> -338 AUE_JAIL COMPAT11 { int jail( \ > >> +338 AUE_JAIL STD { int jail( \ > >> _In_ struct jail *jail); } > >> > >> 339 AUE_NULL NOSTD|NOTSTATIC { int nnpfs_syscall(int operation, \ > >> > >> Modified: head/sys/kern/systrace_args.c > >> ============================================================================== > >> --- head/sys/kern/systrace_args.c Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/kern/systrace_args.c Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -1593,6 +1593,13 @@ systrace_args(int sysnum, void *params, > >> uint64_t *uarg > >> *n_args = 3; > >> break; > >> } > >> + /* jail */ > >> + case 338: { > >> + struct jail_args *p = params; > >> + uarg[0] = (intptr_t) p->jail; /* struct jail * */ > >> + *n_args = 1; > >> + break; > >> + } > >> /* nnpfs_syscall */ > >> case 339: { > >> struct nnpfs_syscall_args *p = params; > >> @@ -5765,6 +5772,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, > >> char *d > >> break; > >> }; > >> break; > >> + /* jail */ > >> + case 338: > >> + switch(ndx) { > >> + case 0: > >> + p = "userland struct jail *"; > >> + break; > >> + default: > >> + break; > >> + }; > >> + break; > >> /* nnpfs_syscall */ > >> case 339: > >> switch(ndx) { > >> @@ -9627,6 +9644,11 @@ systrace_return_setargdesc(int sysnum, int ndx, > >> char * > >> break; > >> /* kldsym */ > >> case 337: > >> + if (ndx == 0 || ndx == 1) > >> + p = "int"; > >> + break; > >> + /* jail */ > >> + case 338: > >> if (ndx == 0 || ndx == 1) > >> p = "int"; > >> break; > >> > >> Modified: head/sys/sys/jail.h > >> ============================================================================== > >> --- head/sys/sys/jail.h Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/sys/jail.h Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -32,7 +32,6 @@ > >> #ifndef _SYS_JAIL_H_ > >> #define _SYS_JAIL_H_ > >> > >> -#ifdef COMPAT_FREEBSD11 > >> #ifdef _KERNEL > >> struct jail_v0 { > >> u_int32_t version; > >> @@ -58,6 +57,16 @@ struct jail { > >> * For all xprison structs, always keep the pr_version an int and > >> * the first variable so userspace can easily distinguish them. > >> */ > >> +#ifndef _KERNEL > >> +struct xprison_v1 { > >> + int pr_version; > >> + int pr_id; > >> + char pr_path[MAXPATHLEN]; > >> + char pr_host[MAXHOSTNAMELEN]; > >> + u_int32_t pr_ip; > >> +}; > >> +#endif > >> + > >> struct xprison { > >> int pr_version; > >> int pr_id; > >> @@ -82,7 +91,6 @@ struct xprison { > >> #define PRISON_STATE_INVALID 0 > >> #define PRISON_STATE_ALIVE 1 > >> #define PRISON_STATE_DYING 2 > >> -#endif /* COMPAT_FREEBSD11 */ > >> > >> /* > >> * Flags for jail_set and jail_get. > >> @@ -102,6 +110,7 @@ struct xprison { > >> > >> struct iovec; > >> > >> +int jail(struct jail *); > >> int jail_set(struct iovec *, unsigned int, int); > >> int jail_get(struct iovec *, unsigned int, int); > >> int jail_attach(int); > >> > >> Modified: head/sys/sys/syscall.h > >> ============================================================================== > >> --- head/sys/sys/syscall.h Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/sys/syscall.h Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -280,7 +280,7 @@ > >> #define SYS_utrace 335 > >> /* 336 is freebsd4 sendfile */ > >> #define SYS_kldsym 337 > >> -#define SYS_freebsd11_jail 338 > >> +#define SYS_jail 338 > >> #define SYS_nnpfs_syscall 339 > >> #define SYS_sigprocmask 340 > >> #define SYS_sigsuspend 341 > >> > >> Modified: head/sys/sys/syscall.mk > >> ============================================================================== > >> --- head/sys/sys/syscall.mk Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/sys/syscall.mk Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -209,7 +209,7 @@ MIASM = \ > >> sched_rr_get_interval.o \ > >> utrace.o \ > >> kldsym.o \ > >> - freebsd11_jail.o \ > >> + jail.o \ > >> nnpfs_syscall.o \ > >> sigprocmask.o \ > >> sigsuspend.o \ > >> > >> Modified: head/sys/sys/syscallsubr.h > >> ============================================================================== > >> --- head/sys/sys/syscallsubr.h Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/sys/syscallsubr.h Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -143,6 +143,7 @@ int kern_getsockname(struct thread *td, int fd, > >> struct > >> int kern_getsockopt(struct thread *td, int s, int level, int name, > >> void *optval, enum uio_seg valseg, socklen_t *valsize); > >> int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data); > >> +int kern_jail(struct thread *td, struct jail *j); > >> int kern_jail_get(struct thread *td, struct uio *options, int flags); > >> int kern_jail_set(struct thread *td, struct uio *options, int flags); > >> int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, > >> @@ -307,6 +308,5 @@ struct freebsd11_dirent; > >> > >> int freebsd11_kern_getdirentries(struct thread *td, int fd, char > >> *ubuf, u_int > >> count, long *basep, void (*func)(struct freebsd11_dirent *)); > >> -int freebsd11_kern_jail(struct thread *td, struct jail *j); > >> > >> #endif /* !_SYS_SYSCALLSUBR_H_ */ > >> > >> Modified: head/sys/sys/sysproto.h > >> ============================================================================== > >> --- head/sys/sys/sysproto.h Thu Aug 16 18:58:34 2018 (r337924) > >> +++ head/sys/sys/sysproto.h Thu Aug 16 19:09:43 2018 (r337925) > >> @@ -849,6 +849,9 @@ struct kldsym_args { > >> char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; > >> char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void > >> *)]; > >> }; > >> +struct jail_args { > >> + char jail_l_[PADL_(struct jail *)]; struct jail * jail; char > >> jail_r_[PADR_(struct jail *)]; > >> +}; > >> struct nnpfs_syscall_args { > >> char operation_l_[PADL_(int)]; int operation; char > >> operation_r_[PADR_(int)]; > >> char a_pathP_l_[PADL_(char *)]; char * a_pathP; char > >> a_pathP_r_[PADR_(char *)]; > >> @@ -1958,6 +1961,7 @@ int sys_sched_get_priority_min(struct thread *, > >> struct > >> int sys_sched_rr_get_interval(struct thread *, struct > >> sched_rr_get_interval_args *); > >> int sys_utrace(struct thread *, struct utrace_args *); > >> int sys_kldsym(struct thread *, struct kldsym_args *); > >> +int sys_jail(struct thread *, struct jail_args *); > >> int sys_nnpfs_syscall(struct thread *, struct nnpfs_syscall_args *); > >> int sys_sigprocmask(struct thread *, struct sigprocmask_args *); > >> int sys_sigsuspend(struct thread *, struct sigsuspend_args *); > >> @@ -2527,9 +2531,6 @@ struct freebsd11_fhstat_args { > >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * > >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; > >> char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * > >> sb; char sb_r_[PADR_(struct freebsd11_stat *)]; > >> }; > >> -struct freebsd11_jail_args { > >> - char jail_l_[PADL_(struct jail *)]; struct jail * jail; char > >> jail_r_[PADR_(struct jail *)]; > >> -}; > >> struct freebsd11_kevent_args { > >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; > >> char changelist_l_[PADL_(struct kevent_freebsd11 *)]; struct > >> kevent_freebsd11 * changelist; char changelist_r_[PADR_(struct > >> kevent_freebsd11 *)]; > >> @@ -2578,7 +2579,6 @@ int freebsd11_nstat(struct thread *, struct > >> freebsd11_ > >> int freebsd11_nfstat(struct thread *, struct freebsd11_nfstat_args > >> *); > >> int freebsd11_nlstat(struct thread *, struct freebsd11_nlstat_args > >> *); > >> int freebsd11_fhstat(struct thread *, struct freebsd11_fhstat_args > >> *); > >> -int freebsd11_jail(struct thread *, struct freebsd11_jail_args *); > >> int freebsd11_kevent(struct thread *, struct freebsd11_kevent_args > >> *); > >> int freebsd11_getfsstat(struct thread *, struct > >> freebsd11_getfsstat_args *); > >> int freebsd11_statfs(struct thread *, struct freebsd11_statfs_args > >> *); > >> @@ -2849,7 +2849,7 @@ int freebsd11_mknodat(struct thread *, struct > >> freebsd1 > >> #define SYS_AUE_utrace AUE_NULL > >> #define SYS_AUE_freebsd4_sendfile AUE_SENDFILE > >> #define SYS_AUE_kldsym AUE_NULL > >> -#define SYS_AUE_freebsd11_jail AUE_JAIL > >> +#define SYS_AUE_jail AUE_JAIL > >> #define SYS_AUE_nnpfs_syscall AUE_NULL > >> #define SYS_AUE_sigprocmask AUE_SIGPROCMASK > >> #define SYS_AUE_sigsuspend AUE_SIGSUSPEND > >> > >> > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 16 19:39: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 241EF1074767; Thu, 16 Aug 2018 19:39:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBFFB75B11; Thu, 16 Aug 2018 19:39:02 +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 ACAEB1DDD0; Thu, 16 Aug 2018 19:39:02 +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 w7GJd2oI076040; Thu, 16 Aug 2018 19:39:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GJd2VX076039; Thu, 16 Aug 2018 19:39:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808161939.w7GJd2VX076039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Aug 2018 19:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337927 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 337927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:39:03 -0000 Author: imp Date: Thu Aug 16 19:39:02 2018 New Revision: 337927 URL: https://svnweb.freebsd.org/changeset/base/337927 Log: Add ashldi3 and ashrdi3 to mips. Now that we're using -Os, mips needs these routines. Modified: head/stand/libsa/Makefile Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Thu Aug 16 19:28:44 2018 (r337926) +++ head/stand/libsa/Makefile Thu Aug 16 19:39:02 2018 (r337927) @@ -77,6 +77,11 @@ SRCS+= ashldi3.c ashrdi3.c SRCS+= syncicache.c .endif +.if ${MACHINE_CPUARCH} == "mips" +.PATH: ${LIBC_SRC}/quad +SRCS+= ashldi3.c ashrdi3.c +.endif + # uuid functions from libc .PATH: ${LIBC_SRC}/uuid SRCS+= uuid_create_nil.c uuid_equal.c uuid_from_string.c uuid_is_nil.c uuid_to_string.c From owner-svn-src-all@freebsd.org Thu Aug 16 19:45: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 265C11074A7F; Thu, 16 Aug 2018 19:45:11 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gritton.org", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B086776057; Thu, 16 Aug 2018 19:45:10 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) by gritton.org (8.15.2/8.15.2) with ESMTP id w7GJj9Df057754; Thu, 16 Aug 2018 13:45:09 -0600 (MDT) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 16 Aug 2018 13:45:09 -0600 From: James Gritton To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337925 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys In-Reply-To: <201808161936.w7GJaX0Z055456@pdx.rh.CN85.dnsmgr.net> References: <201808161936.w7GJaX0Z055456@pdx.rh.CN85.dnsmgr.net> Message-ID: <4ff9cbb56df7a7467f0a66746fe0af5e@freebsd.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.3.6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:45:11 -0000 On 2018-08-16 13:36, Rodney W. Grimes wrote: >> OK, so noted. But seeing as I've already done the partial in this >> case, >> what's best to do now? Should I add another commit to revert the >> so-far >> unreverted files? > > Thats a mixed bag, how many files is it, and what would the > commit message before for them? > > Usually these are seperable changes that should not of been combined > with the original commit. There are five files I didn't revert: two man pages, and two code files with a changed comment. The changes being the docs up to date, with or without the other deprecation changes, so at this point they're correct whether they're changed or not. The commit message would be something like: Revert the remainder of r337922 that I didn't revert in r337925, until such point as I re-commit the whole thing. >> >> - Jamie >> >> >> On 2018-08-16 13:27, Rodney W. Grimes wrote: >> >> Author: jamie >> >> Date: Thu Aug 16 19:09:43 2018 >> >> New Revision: 337925 >> >> URL: https://svnweb.freebsd.org/changeset/base/337925 >> >> >> >> Log: >> >> Revert r337922, except for some documention-only bits. This needs >> >> to wait >> >> until user is changed to stop using jail(2). >> > >> > Can we please stop doing "partial" reverts, it makes log >> > tracking and sorting out stuff later more difficult. >> > >> > If something is seperable and needs to stay it is best >> > to revert the whole commit, and then commit with a proper >> > log exactly what it is that you did not want to revert. >> > >> >> >> >> Differential Revision: D14791 >> >> >> >> Modified: >> >> head/lib/libc/sys/jail.2 >> >> head/sys/compat/freebsd32/freebsd32_misc.c >> >> head/sys/compat/freebsd32/freebsd32_proto.h >> >> head/sys/compat/freebsd32/freebsd32_syscall.h >> >> head/sys/compat/freebsd32/freebsd32_syscalls.c >> >> head/sys/compat/freebsd32/freebsd32_sysent.c >> >> head/sys/compat/freebsd32/freebsd32_systrace_args.c >> >> head/sys/compat/freebsd32/syscalls.master >> >> head/sys/kern/init_sysent.c >> >> head/sys/kern/kern_jail.c >> >> head/sys/kern/syscalls.c >> >> head/sys/kern/syscalls.master >> >> head/sys/kern/systrace_args.c >> >> head/sys/sys/jail.h >> >> head/sys/sys/syscall.h >> >> head/sys/sys/syscall.mk >> >> head/sys/sys/syscallsubr.h >> >> head/sys/sys/sysproto.h >> >> >> >> Modified: head/lib/libc/sys/jail.2 >> >> ============================================================================== >> >> --- head/lib/libc/sys/jail.2 Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/lib/libc/sys/jail.2 Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -25,10 +25,11 @@ >> >> .\" >> >> .\" $FreeBSD$ >> >> .\" >> >> -.Dd August 16, 2018 >> >> +.Dd February 8, 2012 >> >> .Dt JAIL 2 >> >> .Os >> >> .Sh NAME >> >> +.Nm jail , >> >> .Nm jail_get , >> >> .Nm jail_set , >> >> .Nm jail_remove , >> >> @@ -40,6 +41,8 @@ >> >> .In sys/param.h >> >> .In sys/jail.h >> >> .Ft int >> >> +.Fn jail "struct jail *jail" >> >> +.Ft int >> >> .Fn jail_attach "int jid" >> >> .Ft int >> >> .Fn jail_remove "int jid" >> >> @@ -50,7 +53,74 @@ >> >> .Fn jail_set "struct iovec *iov" "u_int niov" "int flags" >> >> .Sh DESCRIPTION >> >> The >> >> +.Fn jail >> >> +system call sets up a jail and locks the current process in it. >> >> +.Pp >> >> +The argument is a pointer to a structure describing the prison: >> >> +.Bd -literal -offset indent >> >> +struct jail { >> >> + uint32_t version; >> >> + char *path; >> >> + char *hostname; >> >> + char *jailname; >> >> + unsigned int ip4s; >> >> + unsigned int ip6s; >> >> + struct in_addr *ip4; >> >> + struct in6_addr *ip6; >> >> +}; >> >> +.Ed >> >> +.Pp >> >> +.Dq Li version >> >> +defines the version of the API in use. >> >> +.Dv JAIL_API_VERSION >> >> +is defined for the current version. >> >> +.Pp >> >> +The >> >> +.Dq Li path >> >> +pointer should be set to the directory which is to be the root of the >> >> +prison. >> >> +.Pp >> >> +The >> >> +.Dq Li hostname >> >> +pointer can be set to the hostname of the prison. >> >> +This can be changed >> >> +from the inside of the prison. >> >> +.Pp >> >> +The >> >> +.Dq Li jailname >> >> +pointer is an optional name that can be assigned to the jail >> >> +for example for management purposes. >> >> +.Pp >> >> +The >> >> +.Dq Li ip4s >> >> +and >> >> +.Dq Li ip6s >> >> +give the numbers of IPv4 and IPv6 addresses that will be passed >> >> +via their respective pointers. >> >> +.Pp >> >> +The >> >> +.Dq Li ip4 >> >> +and >> >> +.Dq Li ip6 >> >> +pointers can be set to an arrays of IPv4 and IPv6 addresses to be >> >> assigned to >> >> +the prison, or NULL if none. >> >> +IPv4 addresses must be in network byte order. >> >> +.Pp >> >> +This is equivalent to, and deprecated in favor of, the >> >> .Fn jail_set >> >> +system call (see below), with the parameters >> >> +.Va path , >> >> +.Va host.hostname , >> >> +.Va name , >> >> +.Va ip4.addr , >> >> +and >> >> +.Va ip6.addr , >> >> +and with the >> >> +.Dv JAIL_ATTACH >> >> +flag. >> >> +.Pp >> >> +The >> >> +.Fn jail_set >> >> system call creates a new jail, or modifies an existing one, and >> >> optionally >> >> locks the current process in it. >> >> Jail parameters are passed as an array of name-value pairs in the >> >> array >> >> @@ -76,19 +146,13 @@ The current set of available parameters, and >> >> their for >> >> retrieved via the >> >> .Va security.jail.param >> >> sysctl MIB entry. >> >> -Notable parameters include >> >> +Notable parameters include those mentioned in the >> >> +.Fn jail >> >> +description above, as well as >> >> .Va jid >> >> and >> >> -.Va name >> >> -which identify the jail being created or modified, >> >> -.Va path >> >> -(the root directory of the jail), >> >> -.Va host.hostname >> >> -(the hostname of the jail), and >> >> -.Va ip4.addr >> >> -and >> >> -.Va ip6.addr >> >> -(IP addresses to assign to the jail). >> >> +.Va name , >> >> +which identify the jail being created or modified. >> >> See >> >> .Xr jail 8 >> >> for more information on the core jail parameters. >> >> @@ -173,7 +237,8 @@ It will kill all processes belonging to the jail, >> >> and >> >> of that jail. >> >> .Sh RETURN VALUES >> >> If successful, >> >> -.Fn jail_set >> >> +.Fn jail , >> >> +.Fn jail_set , >> >> and >> >> .Fn jail_get >> >> return a non-negative integer, termed the jail identifier (JID). >> >> @@ -184,6 +249,25 @@ to indicate the error. >> >> .Rv -std jail_attach jail_remove >> >> .Sh ERRORS >> >> The >> >> +.Fn jail >> >> +system call >> >> +will fail if: >> >> +.Bl -tag -width Er >> >> +.It Bq Er EPERM >> >> +This process is not allowed to create a jail, either because it is >> >> not >> >> +the super-user, or because it would exceed the jail's >> >> +.Va children.max >> >> +limit. >> >> +.It Bq Er EFAULT >> >> +.Fa jail >> >> +points to an address outside the allocated address space of the >> >> process. >> >> +.It Bq Er EINVAL >> >> +The version number of the argument is not correct. >> >> +.It Bq Er EAGAIN >> >> +No free JID could be found. >> >> +.El >> >> +.Pp >> >> +The >> >> .Fn jail_set >> >> system call >> >> will fail if: >> >> @@ -287,7 +371,8 @@ does not exist. >> >> .El >> >> .Pp >> >> Further >> >> -.Fn jail_set >> >> +.Fn jail , >> >> +.Fn jail_set , >> >> and >> >> .Fn jail_attach >> >> call >> >> @@ -301,7 +386,7 @@ manual page for details. >> >> .Xr chroot 2 , >> >> .Xr jail 8 >> >> .Sh HISTORY >> >> -The now-deprecated >> >> +The >> >> .Fn jail >> >> system call appeared in >> >> .Fx 4.0 . >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_misc.c >> >> ============================================================================== >> >> --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 18:58:34 >> >> 2018 (r337924) >> >> +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 19:09:43 >> >> 2018 (r337925) >> >> @@ -2289,10 +2289,8 @@ freebsd32_sysctl(struct thread *td, struct >> >> freebsd32_s >> >> return (0); >> >> } >> >> >> >> -#ifdef COMPAT_FREEBSD11 >> >> int >> >> -freebsd11_freebsd32_jail(struct thread *td, >> >> - struct freebsd11_freebsd32_jail_args *uap) >> >> +freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) >> >> { >> >> uint32_t version; >> >> int error; >> >> @@ -2349,9 +2347,8 @@ freebsd11_freebsd32_jail(struct thread *td, >> >> /* Sci-Fi jails are not supported, sorry. */ >> >> return (EINVAL); >> >> } >> >> - return (freebsd11_kern_jail(td, &j)); >> >> + return (kern_jail(td, &j)); >> >> } >> >> -#endif /* COMPAT_FREEBSD11 */ >> >> >> >> int >> >> freebsd32_jail_set(struct thread *td, struct freebsd32_jail_set_args >> >> *uap) >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_proto.h >> >> ============================================================================== >> >> --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 18:58:34 >> >> 2018 (r337924) >> >> +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 19:09:43 >> >> 2018 (r337925) >> >> @@ -283,6 +283,9 @@ struct freebsd32_sched_rr_get_interval_args { >> >> char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; >> >> char interval_l_[PADL_(struct timespec32 *)]; struct timespec32 * >> >> interval; char interval_r_[PADR_(struct timespec32 *)]; >> >> }; >> >> +struct freebsd32_jail_args { >> >> + char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char >> >> jail_r_[PADR_(struct jail32 *)]; >> >> +}; >> >> struct freebsd32_sigtimedwait_args { >> >> char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char >> >> set_r_[PADR_(const sigset_t *)]; >> >> char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char >> >> info_r_[PADR_(siginfo_t *)]; >> >> @@ -758,6 +761,7 @@ int freebsd32_aio_return(struct thread *, struct >> >> freeb >> >> int freebsd32_aio_suspend(struct thread *, struct >> >> freebsd32_aio_suspend_args *); >> >> int freebsd32_aio_error(struct thread *, struct >> >> freebsd32_aio_error_args *); >> >> int freebsd32_sched_rr_get_interval(struct thread *, struct >> >> freebsd32_sched_rr_get_interval_args *); >> >> +int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); >> >> int freebsd32_sigtimedwait(struct thread *, struct >> >> freebsd32_sigtimedwait_args *); >> >> int freebsd32_sigwaitinfo(struct thread *, struct >> >> freebsd32_sigwaitinfo_args *); >> >> int freebsd32_aio_waitcomplete(struct thread *, struct >> >> freebsd32_aio_waitcomplete_args *); >> >> @@ -1180,9 +1184,6 @@ struct freebsd11_freebsd32_fhstat_args { >> >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * >> >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; >> >> char sb_l_[PADL_(struct freebsd11_stat32 *)]; struct >> >> freebsd11_stat32 * sb; char sb_r_[PADR_(struct freebsd11_stat32 *)]; >> >> }; >> >> -struct freebsd11_freebsd32_jail_args { >> >> - char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char >> >> jail_r_[PADR_(struct jail32 *)]; >> >> -}; >> >> struct freebsd11_freebsd32_kevent_args { >> >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; >> >> char changelist_l_[PADL_(const struct kevent32_freebsd11 *)]; const >> >> struct kevent32_freebsd11 * changelist; char changelist_r_[PADR_(const >> >> struct kevent32_freebsd11 *)]; >> >> @@ -1222,7 +1223,6 @@ int freebsd11_freebsd32_lstat(struct thread *, >> >> struct >> >> int freebsd11_freebsd32_getdirentries(struct thread *, struct >> >> freebsd11_freebsd32_getdirentries_args *); >> >> int freebsd11_freebsd32_getdents(struct thread *, struct >> >> freebsd11_freebsd32_getdents_args *); >> >> int freebsd11_freebsd32_fhstat(struct thread *, struct >> >> freebsd11_freebsd32_fhstat_args *); >> >> -int freebsd11_freebsd32_jail(struct thread *, struct >> >> freebsd11_freebsd32_jail_args *); >> >> int freebsd11_freebsd32_kevent(struct thread *, struct >> >> freebsd11_freebsd32_kevent_args *); >> >> int freebsd11_freebsd32_fstatat(struct thread *, struct >> >> freebsd11_freebsd32_fstatat_args *); >> >> int freebsd11_freebsd32_mknodat(struct thread *, struct >> >> freebsd11_freebsd32_mknodat_args *); >> >> @@ -1317,7 +1317,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, >> >> struc >> >> >> >> #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_LIO_LISTIO >> >> #define FREEBSD32_SYS_AUE_freebsd32_sched_rr_get_interval AUE_NULL >> >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE >> >> -#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_jail AUE_JAIL >> >> +#define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL >> >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION >> >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN >> >> #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_syscall.h >> >> ============================================================================== >> >> --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 18:58:34 >> >> 2018 (r337924) >> >> +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 19:09:43 >> >> 2018 (r337925) >> >> @@ -275,7 +275,7 @@ >> >> #define FREEBSD32_SYS_utrace 335 >> >> /* 336 is freebsd4 freebsd32_sendfile */ >> >> #define FREEBSD32_SYS_kldsym 337 >> >> -#define FREEBSD32_SYS_freebsd11_freebsd32_jail 338 >> >> +#define FREEBSD32_SYS_freebsd32_jail 338 >> >> #define FREEBSD32_SYS_sigprocmask 340 >> >> #define FREEBSD32_SYS_sigsuspend 341 >> >> /* 342 is freebsd4 freebsd32_sigaction */ >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c >> >> ============================================================================== >> >> --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 18:58:34 >> >> 2018 (r337924) >> >> +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 19:09:43 >> >> 2018 (r337925) >> >> @@ -347,7 +347,7 @@ const char *freebsd32_syscallnames[] = { >> >> "utrace", /* 335 = utrace */ >> >> "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile >> >> */ >> >> "kldsym", /* 337 = kldsym */ >> >> - "compat11.freebsd32_jail", /* 338 = freebsd11 freebsd32_jail */ >> >> + "freebsd32_jail", /* 338 = freebsd32_jail */ >> >> "#339", /* 339 = pioctl */ >> >> "sigprocmask", /* 340 = sigprocmask */ >> >> "sigsuspend", /* 341 = sigsuspend */ >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_sysent.c >> >> ============================================================================== >> >> --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 18:58:34 >> >> 2018 (r337924) >> >> +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 19:09:43 >> >> 2018 (r337925) >> >> @@ -394,7 +394,7 @@ struct sysent freebsd32_sysent[] = { >> >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, >> >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ >> >> { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), >> >> AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = >> >> freebsd4 freebsd32_sendfile */ >> >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, >> >> SY_THR_STATIC }, /* 337 = kldsym */ >> >> - { compat11(AS(freebsd11_freebsd32_jail_args),freebsd32_jail), >> >> AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 >> >> freebsd32_jail */ >> >> + { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, >> >> NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd32_jail */ >> >> { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT >> >> }, /* 339 = pioctl */ >> >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, >> >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = >> >> sigprocmask */ >> >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, >> >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c >> >> ============================================================================== >> >> --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 >> >> 18:58:34 2018 (r337924) >> >> +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 >> >> 19:09:43 2018 (r337925) >> >> @@ -1559,6 +1559,13 @@ systrace_args(int sysnum, void *params, >> >> uint64_t *uarg >> >> *n_args = 3; >> >> break; >> >> } >> >> + /* freebsd32_jail */ >> >> + case 338: { >> >> + struct freebsd32_jail_args *p = params; >> >> + uarg[0] = (intptr_t) p->jail; /* struct jail32 * */ >> >> + *n_args = 1; >> >> + break; >> >> + } >> >> /* sigprocmask */ >> >> case 340: { >> >> struct sigprocmask_args *p = params; >> >> @@ -5704,6 +5711,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, >> >> char *d >> >> break; >> >> }; >> >> break; >> >> + /* freebsd32_jail */ >> >> + case 338: >> >> + switch(ndx) { >> >> + case 0: >> >> + p = "userland struct jail32 *"; >> >> + break; >> >> + default: >> >> + break; >> >> + }; >> >> + break; >> >> /* sigprocmask */ >> >> case 340: >> >> switch(ndx) { >> >> @@ -9653,6 +9670,11 @@ systrace_return_setargdesc(int sysnum, int ndx, >> >> char * >> >> break; >> >> /* kldsym */ >> >> case 337: >> >> + if (ndx == 0 || ndx == 1) >> >> + p = "int"; >> >> + break; >> >> + /* freebsd32_jail */ >> >> + case 338: >> >> if (ndx == 0 || ndx == 1) >> >> p = "int"; >> >> break; >> >> >> >> Modified: head/sys/compat/freebsd32/syscalls.master >> >> ============================================================================== >> >> --- head/sys/compat/freebsd32/syscalls.master Thu Aug 16 18:58:34 >> >> 2018 (r337924) >> >> +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 16 19:09:43 >> >> 2018 (r337925) >> >> @@ -601,7 +601,7 @@ >> >> off_t *sbytes, int flags); } >> >> 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ >> >> void *data); } >> >> -338 AUE_JAIL COMPAT11 { int freebsd32_jail(struct jail32 *jail); } >> >> +338 AUE_JAIL STD { int freebsd32_jail(struct jail32 *jail); } >> >> 339 AUE_NULL UNIMPL pioctl >> >> 340 AUE_SIGPROCMASK NOPROTO { int sigprocmask(int how, \ >> >> const sigset_t *set, sigset_t *oset); } >> >> >> >> Modified: head/sys/kern/init_sysent.c >> >> ============================================================================== >> >> --- head/sys/kern/init_sysent.c Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/kern/init_sysent.c Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -387,7 +387,7 @@ struct sysent sysent[] = { >> >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, >> >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ >> >> { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, >> >> 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ >> >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, >> >> SY_THR_STATIC }, /* 337 = kldsym */ >> >> - { compat11(AS(freebsd11_jail_args),jail), AUE_JAIL, NULL, 0, 0, 0, >> >> SY_THR_STATIC }, /* 338 = freebsd11 jail */ >> >> + { AS(jail_args), (sy_call_t *)sys_jail, AUE_JAIL, NULL, 0, 0, 0, >> >> SY_THR_STATIC }, /* 338 = jail */ >> >> { AS(nnpfs_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, >> >> 0, 0, SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ >> >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, >> >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = >> >> sigprocmask */ >> >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, >> >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ >> >> >> >> Modified: head/sys/kern/kern_jail.c >> >> ============================================================================== >> >> --- head/sys/kern/kern_jail.c Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/kern/kern_jail.c Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -74,14 +74,6 @@ __FBSDID("$FreeBSD$"); >> >> >> >> #include >> >> >> >> -/* >> >> - * The old jail(2) interface will exist under COMPAT_FREEBSD11, but >> >> the global >> >> - * permission sysctls are slated to go away sometime (even with >> >> COMPAT). >> >> - */ >> >> -#if defined(COMPAT_FREEBSD11) && !defined(BURN_BRIDGES) >> >> -#define PR_GLOBAL_ALLOW >> >> -#endif >> >> - >> >> #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" >> >> >> >> MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); >> >> @@ -207,11 +199,9 @@ const size_t pr_flag_allow_size = >> >> sizeof(pr_flag_allow >> >> #define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | >> >> PR_ALLOW_RESERVED_PORTS) >> >> #define JAIL_DEFAULT_ENFORCE_STATFS 2 >> >> #define JAIL_DEFAULT_DEVFS_RSNUM 0 >> >> -#ifdef PR_GLOBAL_ALLOW >> >> static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; >> >> static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; >> >> static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; >> >> -#endif >> >> #if defined(INET) || defined(INET6) >> >> static unsigned jail_max_af_ips = 255; >> >> #endif >> >> @@ -229,14 +219,13 @@ prison0_init(void) >> >> strlcpy(prison0.pr_osrelease, osrelease, >> >> sizeof(prison0.pr_osrelease)); >> >> } >> >> >> >> -#ifdef COMPAT_FREEBSD11 >> >> /* >> >> * struct jail_args { >> >> * struct jail *jail; >> >> * }; >> >> */ >> >> int >> >> -freebsd11_jail(struct thread *td, struct freebsd11_jail_args *uap) >> >> +sys_jail(struct thread *td, struct jail_args *uap) >> >> { >> >> uint32_t version; >> >> int error; >> >> @@ -281,16 +270,13 @@ freebsd11_jail(struct thread *td, struct >> >> freebsd11_jai >> >> /* Sci-Fi jails are not supported, sorry. */ >> >> return (EINVAL); >> >> } >> >> - return (freebsd11_kern_jail(td, &j)); >> >> + return (kern_jail(td, &j)); >> >> } >> >> >> >> int >> >> -freebsd11_kern_jail(struct thread *td, struct jail *j) >> >> +kern_jail(struct thread *td, struct jail *j) >> >> { >> >> - struct iovec optiov[2 * (3 >> >> -#ifdef PR_GLOBAL_ALLOW >> >> - + 1 + nitems(pr_flag_allow) >> >> -#endif >> >> + struct iovec optiov[2 * (4 + nitems(pr_flag_allow) >> >> #ifdef INET >> >> + 1 >> >> #endif >> >> @@ -300,10 +286,7 @@ freebsd11_kern_jail(struct thread *td, struct >> >> jail *j) >> >> )]; >> >> struct uio opt; >> >> char *u_path, *u_hostname, *u_name; >> >> -#ifdef PR_GLOBAL_ALLOW >> >> struct bool_flags *bf; >> >> - int enforce_statfs; >> >> -#endif >> >> #ifdef INET >> >> uint32_t ip4s; >> >> struct in_addr *u_ip4; >> >> @@ -312,7 +295,7 @@ freebsd11_kern_jail(struct thread *td, struct jail >> >> *j) >> >> struct in6_addr *u_ip6; >> >> #endif >> >> size_t tmplen; >> >> - int error; >> >> + int error, enforce_statfs; >> >> >> >> bzero(&optiov, sizeof(optiov)); >> >> opt.uio_iov = optiov; >> >> @@ -323,7 +306,6 @@ freebsd11_kern_jail(struct thread *td, struct jail >> >> *j) >> >> opt.uio_rw = UIO_READ; >> >> opt.uio_td = td; >> >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> /* Set permissions for top-level jails from sysctls. */ >> >> if (!jailed(td->td_ucred)) { >> >> for (bf = pr_flag_allow; >> >> @@ -345,7 +327,6 @@ freebsd11_kern_jail(struct thread *td, struct jail >> >> *j) >> >> optiov[opt.uio_iovcnt].iov_len = sizeof(enforce_statfs); >> >> opt.uio_iovcnt++; >> >> } >> >> -#endif >> >> >> >> tmplen = MAXPATHLEN + MAXHOSTNAMELEN + MAXHOSTNAMELEN; >> >> #ifdef INET >> >> @@ -449,7 +430,6 @@ freebsd11_kern_jail(struct thread *td, struct jail >> >> *j) >> >> free(u_path, M_TEMP); >> >> return (error); >> >> } >> >> -#endif /* COMPAT_FREEBSD11 */ >> >> >> >> >> >> /* >> >> @@ -1267,11 +1247,7 @@ kern_jail_set(struct thread *td, struct uio >> >> *optuio, i >> >> >> >> pr->pr_securelevel = ppr->pr_securelevel; >> >> pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; >> >> -#ifdef PR_GLOBAL_ALLOW >> >> pr->pr_enforce_statfs = jail_default_enforce_statfs; >> >> -#else >> >> - pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; >> >> -#endif >> >> pr->pr_devfs_rsnum = ppr->pr_devfs_rsnum; >> >> >> >> pr->pr_osreldate = osreldt ? osreldt : ppr->pr_osreldate; >> >> @@ -3439,7 +3415,6 @@ prison_path(struct prison *pr1, struct prison >> >> *pr2) >> >> static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW, 0, >> >> "Jails"); >> >> >> >> -#ifdef COMPAT_FREEBSD11 >> >> static int >> >> sysctl_jail_list(SYSCTL_HANDLER_ARGS) >> >> { >> >> @@ -3543,7 +3518,6 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) >> >> SYSCTL_OID(_security_jail, OID_AUTO, list, >> >> CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, >> >> sysctl_jail_list, "S", "List of active jails"); >> >> -#endif /* COMPAT_FREEBSD11 */ >> >> >> >> static int >> >> sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) >> >> @@ -3583,14 +3557,13 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vnet, >> >> #if defined(INET) || defined(INET6) >> >> SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, >> >> &jail_max_af_ips, 0, >> >> - "Number of IP addresses a jail may have at most per address >> >> family"); >> >> + "Number of IP addresses a jail may have at most per address >> >> family (deprecated)"); >> >> #endif >> >> >> >> /* >> >> - * Jail permissions - jailed processes can read these to find out >> >> what they are >> >> - * allowed to do. A deprecated use is to set default permissions for >> >> prisons >> >> - * created via jail(2). For historical reasons, the sysctl names >> >> have varying >> >> - * similarity to the parameter names. >> >> + * Default parameters for jail(2) compatibility. For historical >> >> reasons, >> >> + * the sysctl names have varying similarity to the parameter names. >> >> Prisons >> >> + * just see their own parameters, and can't change them. >> >> */ >> >> static int >> >> sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) >> >> @@ -3599,68 +3572,52 @@ sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) >> >> int allow, error, i; >> >> >> >> pr = req->td->td_ucred->cr_prison; >> >> -#ifdef PR_GLOBAL_ALLOW >> >> allow = (pr == &prison0) ? jail_default_allow : pr->pr_allow; >> >> -#else >> >> - allow = pr->pr_allow; >> >> -#endif >> >> >> >> /* Get the current flag value, and convert it to a boolean. */ >> >> i = (allow & arg2) ? 1 : 0; >> >> if (arg1 != NULL) >> >> i = !i; >> >> error = sysctl_handle_int(oidp, &i, 0, req); >> >> - if (error) >> >> + if (error || !req->newptr) >> >> return (error); >> >> -#ifdef PR_GLOBAL_ALLOW >> >> - if (req->newptr) { >> >> - i = i ? arg2 : 0; >> >> - if (arg1 != NULL) >> >> - i ^= arg2; >> >> - /* >> >> - * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 >> >> - * for writing. >> >> - */ >> >> - mtx_lock(&prison0.pr_mtx); >> >> - jail_default_allow = (jail_default_allow & ~arg2) | i; >> >> - mtx_unlock(&prison0.pr_mtx); >> >> - } >> >> -#endif >> >> + i = i ? arg2 : 0; >> >> + if (arg1 != NULL) >> >> + i ^= arg2; >> >> + /* >> >> + * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 >> >> + * for writing. >> >> + */ >> >> + mtx_lock(&prison0.pr_mtx); >> >> + jail_default_allow = (jail_default_allow & ~arg2) | i; >> >> + mtx_unlock(&prison0.pr_mtx); >> >> return (0); >> >> } >> >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RW | CTLFLAG_MPSAFE) >> >> -#define ADDR_GLOBAL_ALLOW(i) &i >> >> -#else >> >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RD | CTLFLAG_MPSAFE) >> >> -#define ADDR_GLOBAL_ALLOW(i) NULL >> >> -#endif >> >> - >> >> SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", >> >> - "Processes in jail can set their hostnames"); >> >> + "Processes in jail can set their hostnames (deprecated)"); >> >> SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", >> >> - "Processes in jail are limited to creating UNIX/IP/route sockets >> >> only"); >> >> + "Processes in jail are limited to creating UNIX/IP/route sockets >> >> only (deprecated)"); >> >> SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", >> >> - "Processes in jail can use System V IPC primitives"); >> >> + "Processes in jail can use System V IPC primitives >> >> (deprecated)"); >> >> SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", >> >> - "Prison root can create raw sockets"); >> >> + "Prison root can create raw sockets (deprecated)"); >> >> SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", >> >> - "Processes in jail can alter system file flags"); >> >> + "Processes in jail can alter system file flags (deprecated)"); >> >> SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", >> >> - "Processes in jail can mount/unmount jail-friendly file >> >> systems"); >> >> + "Processes in jail can mount/unmount jail-friendly file systems >> >> (deprecated)"); >> >> >> >> static int >> >> sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) >> >> @@ -3669,33 +3626,25 @@ sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) >> >> int level, error; >> >> >> >> pr = req->td->td_ucred->cr_prison; >> >> -#ifdef PR_GLOBAL_ALLOW >> >> level = (pr == &prison0) ? *(int *)arg1 : *(int *)((char *)pr + >> >> arg2); >> >> -#else >> >> - level = *(int *)((char *)pr + arg2); >> >> -#endif >> >> error = sysctl_handle_int(oidp, &level, 0, req); >> >> - if (error) >> >> + if (error || !req->newptr) >> >> return (error); >> >> -#ifdef PR_GLOBAL_ALLOW >> >> - if (req->newptr) >> >> - *(int *)arg1 = level; >> >> -#endif >> >> + *(int *)arg1 = level; >> >> return (0); >> >> } >> >> >> >> SYSCTL_PROC(_security_jail, OID_AUTO, enforce_statfs, >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> - ADDR_GLOBAL_ALLOW(jail_default_enforce_statfs), >> >> - offsetof(struct prison, pr_enforce_statfs), >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> + &jail_default_enforce_statfs, offsetof(struct prison, >> >> pr_enforce_statfs), >> >> sysctl_jail_default_level, "I", >> >> - "Processes in jail cannot see all mounted file systems"); >> >> + "Processes in jail cannot see all mounted file systems >> >> (deprecated)"); >> >> + >> >> SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> - ADDR_GLOBAL_ALLOW(jail_default_devfs_rsnum), >> >> - offsetof(struct prison, pr_devfs_rsnum), >> >> + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, >> >> + &jail_default_devfs_rsnum, offsetof(struct prison, >> >> pr_devfs_rsnum), >> >> sysctl_jail_default_level, "I", >> >> - "Ruleset for the devfs filesystem in jail"); >> >> + "Ruleset for the devfs filesystem in jail (deprecated)"); >> >> >> >> /* >> >> * Nodes to describe jail parameters. Maximum length of string >> >> parameters >> >> @@ -3836,6 +3785,9 @@ prison_add_allow(const char *prefix, const char >> >> *name, >> >> struct bool_flags *bf; >> >> struct sysctl_oid *parent; >> >> char *allow_name, *allow_noname, *allowed; >> >> +#ifndef NO_SYSCTL_DESCR >> >> + char *descr_deprecated; >> >> +#endif >> >> unsigned allow_flag; >> >> >> >> if (prefix >> >> @@ -3892,7 +3844,10 @@ prison_add_allow(const char *prefix, const char >> >> *name, >> >> bf->flag = allow_flag; >> >> mtx_unlock(&prison0.pr_mtx); >> >> >> >> - /* Create sysctls for the paramter, and the current permission. */ >> >> + /* >> >> + * Create sysctls for the paramter, and the back-compat global >> >> + * permission. >> >> + */ >> >> parent = prefix >> >> ? SYSCTL_ADD_NODE(NULL, >> >> SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), >> >> @@ -3904,10 +3859,17 @@ prison_add_allow(const char *prefix, const >> >> char *name, >> >> if ((prefix >> >> ? asprintf(&allowed, M_TEMP, "%s_%s_allowed", prefix, name) >> >> : asprintf(&allowed, M_TEMP, "%s_allowed", name)) >= 0) { >> >> +#ifndef NO_SYSCTL_DESCR >> >> + (void)asprintf(&descr_deprecated, M_TEMP, "%s (deprecated)", >> >> + descr); >> >> +#endif >> >> (void)SYSCTL_ADD_PROC(NULL, >> >> SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, allowed, >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, allow_flag, >> >> - sysctl_jail_default_allow, "I", descr); >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, allow_flag, >> >> + sysctl_jail_default_allow, "I", descr_deprecated); >> >> +#ifndef NO_SYSCTL_DESCR >> >> + free(descr_deprecated, M_TEMP); >> >> +#endif >> >> free(allowed, M_TEMP); >> >> } >> >> return allow_flag; >> >> >> >> Modified: head/sys/kern/syscalls.c >> >> ============================================================================== >> >> --- head/sys/kern/syscalls.c Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/kern/syscalls.c Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -344,7 +344,7 @@ const char *syscallnames[] = { >> >> "utrace", /* 335 = utrace */ >> >> "compat4.sendfile", /* 336 = freebsd4 sendfile */ >> >> "kldsym", /* 337 = kldsym */ >> >> - "compat11.jail", /* 338 = freebsd11 jail */ >> >> + "jail", /* 338 = jail */ >> >> "nnpfs_syscall", /* 339 = nnpfs_syscall */ >> >> "sigprocmask", /* 340 = sigprocmask */ >> >> "sigsuspend", /* 341 = sigsuspend */ >> >> >> >> Modified: head/sys/kern/syscalls.master >> >> ============================================================================== >> >> --- head/sys/kern/syscalls.master Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/kern/syscalls.master Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -738,7 +738,7 @@ >> >> _Out_opt_ off_t *sbytes, int flags); } >> >> 337 AUE_NULL STD { int kldsym(int fileid, int cmd, \ >> >> _In_ void *data); } >> >> -338 AUE_JAIL COMPAT11 { int jail( \ >> >> +338 AUE_JAIL STD { int jail( \ >> >> _In_ struct jail *jail); } >> >> >> >> 339 AUE_NULL NOSTD|NOTSTATIC { int nnpfs_syscall(int operation, \ >> >> >> >> Modified: head/sys/kern/systrace_args.c >> >> ============================================================================== >> >> --- head/sys/kern/systrace_args.c Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/kern/systrace_args.c Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -1593,6 +1593,13 @@ systrace_args(int sysnum, void *params, >> >> uint64_t *uarg >> >> *n_args = 3; >> >> break; >> >> } >> >> + /* jail */ >> >> + case 338: { >> >> + struct jail_args *p = params; >> >> + uarg[0] = (intptr_t) p->jail; /* struct jail * */ >> >> + *n_args = 1; >> >> + break; >> >> + } >> >> /* nnpfs_syscall */ >> >> case 339: { >> >> struct nnpfs_syscall_args *p = params; >> >> @@ -5765,6 +5772,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, >> >> char *d >> >> break; >> >> }; >> >> break; >> >> + /* jail */ >> >> + case 338: >> >> + switch(ndx) { >> >> + case 0: >> >> + p = "userland struct jail *"; >> >> + break; >> >> + default: >> >> + break; >> >> + }; >> >> + break; >> >> /* nnpfs_syscall */ >> >> case 339: >> >> switch(ndx) { >> >> @@ -9627,6 +9644,11 @@ systrace_return_setargdesc(int sysnum, int ndx, >> >> char * >> >> break; >> >> /* kldsym */ >> >> case 337: >> >> + if (ndx == 0 || ndx == 1) >> >> + p = "int"; >> >> + break; >> >> + /* jail */ >> >> + case 338: >> >> if (ndx == 0 || ndx == 1) >> >> p = "int"; >> >> break; >> >> >> >> Modified: head/sys/sys/jail.h >> >> ============================================================================== >> >> --- head/sys/sys/jail.h Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/sys/jail.h Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -32,7 +32,6 @@ >> >> #ifndef _SYS_JAIL_H_ >> >> #define _SYS_JAIL_H_ >> >> >> >> -#ifdef COMPAT_FREEBSD11 >> >> #ifdef _KERNEL >> >> struct jail_v0 { >> >> u_int32_t version; >> >> @@ -58,6 +57,16 @@ struct jail { >> >> * For all xprison structs, always keep the pr_version an int and >> >> * the first variable so userspace can easily distinguish them. >> >> */ >> >> +#ifndef _KERNEL >> >> +struct xprison_v1 { >> >> + int pr_version; >> >> + int pr_id; >> >> + char pr_path[MAXPATHLEN]; >> >> + char pr_host[MAXHOSTNAMELEN]; >> >> + u_int32_t pr_ip; >> >> +}; >> >> +#endif >> >> + >> >> struct xprison { >> >> int pr_version; >> >> int pr_id; >> >> @@ -82,7 +91,6 @@ struct xprison { >> >> #define PRISON_STATE_INVALID 0 >> >> #define PRISON_STATE_ALIVE 1 >> >> #define PRISON_STATE_DYING 2 >> >> -#endif /* COMPAT_FREEBSD11 */ >> >> >> >> /* >> >> * Flags for jail_set and jail_get. >> >> @@ -102,6 +110,7 @@ struct xprison { >> >> >> >> struct iovec; >> >> >> >> +int jail(struct jail *); >> >> int jail_set(struct iovec *, unsigned int, int); >> >> int jail_get(struct iovec *, unsigned int, int); >> >> int jail_attach(int); >> >> >> >> Modified: head/sys/sys/syscall.h >> >> ============================================================================== >> >> --- head/sys/sys/syscall.h Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/sys/syscall.h Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -280,7 +280,7 @@ >> >> #define SYS_utrace 335 >> >> /* 336 is freebsd4 sendfile */ >> >> #define SYS_kldsym 337 >> >> -#define SYS_freebsd11_jail 338 >> >> +#define SYS_jail 338 >> >> #define SYS_nnpfs_syscall 339 >> >> #define SYS_sigprocmask 340 >> >> #define SYS_sigsuspend 341 >> >> >> >> Modified: head/sys/sys/syscall.mk >> >> ============================================================================== >> >> --- head/sys/sys/syscall.mk Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/sys/syscall.mk Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -209,7 +209,7 @@ MIASM = \ >> >> sched_rr_get_interval.o \ >> >> utrace.o \ >> >> kldsym.o \ >> >> - freebsd11_jail.o \ >> >> + jail.o \ >> >> nnpfs_syscall.o \ >> >> sigprocmask.o \ >> >> sigsuspend.o \ >> >> >> >> Modified: head/sys/sys/syscallsubr.h >> >> ============================================================================== >> >> --- head/sys/sys/syscallsubr.h Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/sys/syscallsubr.h Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -143,6 +143,7 @@ int kern_getsockname(struct thread *td, int fd, >> >> struct >> >> int kern_getsockopt(struct thread *td, int s, int level, int name, >> >> void *optval, enum uio_seg valseg, socklen_t *valsize); >> >> int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data); >> >> +int kern_jail(struct thread *td, struct jail *j); >> >> int kern_jail_get(struct thread *td, struct uio *options, int flags); >> >> int kern_jail_set(struct thread *td, struct uio *options, int flags); >> >> int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, >> >> @@ -307,6 +308,5 @@ struct freebsd11_dirent; >> >> >> >> int freebsd11_kern_getdirentries(struct thread *td, int fd, char >> >> *ubuf, u_int >> >> count, long *basep, void (*func)(struct freebsd11_dirent *)); >> >> -int freebsd11_kern_jail(struct thread *td, struct jail *j); >> >> >> >> #endif /* !_SYS_SYSCALLSUBR_H_ */ >> >> >> >> Modified: head/sys/sys/sysproto.h >> >> ============================================================================== >> >> --- head/sys/sys/sysproto.h Thu Aug 16 18:58:34 2018 (r337924) >> >> +++ head/sys/sys/sysproto.h Thu Aug 16 19:09:43 2018 (r337925) >> >> @@ -849,6 +849,9 @@ struct kldsym_args { >> >> char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; >> >> char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void >> >> *)]; >> >> }; >> >> +struct jail_args { >> >> + char jail_l_[PADL_(struct jail *)]; struct jail * jail; char >> >> jail_r_[PADR_(struct jail *)]; >> >> +}; >> >> struct nnpfs_syscall_args { >> >> char operation_l_[PADL_(int)]; int operation; char >> >> operation_r_[PADR_(int)]; >> >> char a_pathP_l_[PADL_(char *)]; char * a_pathP; char >> >> a_pathP_r_[PADR_(char *)]; >> >> @@ -1958,6 +1961,7 @@ int sys_sched_get_priority_min(struct thread *, >> >> struct >> >> int sys_sched_rr_get_interval(struct thread *, struct >> >> sched_rr_get_interval_args *); >> >> int sys_utrace(struct thread *, struct utrace_args *); >> >> int sys_kldsym(struct thread *, struct kldsym_args *); >> >> +int sys_jail(struct thread *, struct jail_args *); >> >> int sys_nnpfs_syscall(struct thread *, struct nnpfs_syscall_args *); >> >> int sys_sigprocmask(struct thread *, struct sigprocmask_args *); >> >> int sys_sigsuspend(struct thread *, struct sigsuspend_args *); >> >> @@ -2527,9 +2531,6 @@ struct freebsd11_fhstat_args { >> >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * >> >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; >> >> char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * >> >> sb; char sb_r_[PADR_(struct freebsd11_stat *)]; >> >> }; >> >> -struct freebsd11_jail_args { >> >> - char jail_l_[PADL_(struct jail *)]; struct jail * jail; char >> >> jail_r_[PADR_(struct jail *)]; >> >> -}; >> >> struct freebsd11_kevent_args { >> >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; >> >> char changelist_l_[PADL_(struct kevent_freebsd11 *)]; struct >> >> kevent_freebsd11 * changelist; char changelist_r_[PADR_(struct >> >> kevent_freebsd11 *)]; >> >> @@ -2578,7 +2579,6 @@ int freebsd11_nstat(struct thread *, struct >> >> freebsd11_ >> >> int freebsd11_nfstat(struct thread *, struct freebsd11_nfstat_args >> >> *); >> >> int freebsd11_nlstat(struct thread *, struct freebsd11_nlstat_args >> >> *); >> >> int freebsd11_fhstat(struct thread *, struct freebsd11_fhstat_args >> >> *); >> >> -int freebsd11_jail(struct thread *, struct freebsd11_jail_args *); >> >> int freebsd11_kevent(struct thread *, struct freebsd11_kevent_args >> >> *); >> >> int freebsd11_getfsstat(struct thread *, struct >> >> freebsd11_getfsstat_args *); >> >> int freebsd11_statfs(struct thread *, struct freebsd11_statfs_args >> >> *); >> >> @@ -2849,7 +2849,7 @@ int freebsd11_mknodat(struct thread *, struct >> >> freebsd1 >> >> #define SYS_AUE_utrace AUE_NULL >> >> #define SYS_AUE_freebsd4_sendfile AUE_SENDFILE >> >> #define SYS_AUE_kldsym AUE_NULL >> >> -#define SYS_AUE_freebsd11_jail AUE_JAIL >> >> +#define SYS_AUE_jail AUE_JAIL >> >> #define SYS_AUE_nnpfs_syscall AUE_NULL >> >> #define SYS_AUE_sigprocmask AUE_SIGPROCMASK >> >> #define SYS_AUE_sigsuspend AUE_SIGSUSPEND >> >> >> >> >> From owner-svn-src-all@freebsd.org Thu Aug 16 19:48: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 3A5BA1074BEF; Thu, 16 Aug 2018 19:48:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E420A762DE; Thu, 16 Aug 2018 19:48:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C09001DF7A; Thu, 16 Aug 2018 19:48:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GJm7J0081007; Thu, 16 Aug 2018 19:48:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GJm7ZM081006; Thu, 16 Aug 2018 19:48:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808161948.w7GJm7ZM081006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 16 Aug 2018 19:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337928 - head/secure/usr.sbin/sshd X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/secure/usr.sbin/sshd X-SVN-Commit-Revision: 337928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:48:08 -0000 Author: bdrewery Date: Thu Aug 16 19:48:07 2018 New Revision: 337928 URL: https://svnweb.freebsd.org/changeset/base/337928 Log: Fix build after r337852: Don't rebuild moduli based on unrelated moduli.c Reported by: many, delphij (moduli.c issue) Modified: head/secure/usr.sbin/sshd/Makefile Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Thu Aug 16 19:39:02 2018 (r337927) +++ head/secure/usr.sbin/sshd/Makefile Thu Aug 16 19:48:07 2018 (r337928) @@ -28,6 +28,9 @@ MAN= sshd.8 sshd_config.5 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h SRCS+= ssh_namespace.h +# Don't rebuild based on moduli.c +moduli: .MADE + # pam should always happen before ssh here for static linking LIBADD= pam ssh util From owner-svn-src-all@freebsd.org Thu Aug 16 19:48: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 3FAFA1074C5D; Thu, 16 Aug 2018 19:48:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBBD77644B; Thu, 16 Aug 2018 19:48:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 99F7C9CE9; Thu, 16 Aug 2018 19:48:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id D30471346; Thu, 16 Aug 2018 19:48:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id c22vyTtbUAGH; Thu, 16 Aug 2018 19:48:46 +0000 (UTC) Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 557AF133A From: Bryan Drewery To: Ian Lepore , Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Brad Davis References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> <57eef2b1-d126-a8da-c45a-d8cab0373a08@FreeBSD.org> <1534446846.1466.43.camel@freebsd.org> <8e232b42-e74a-d1c2-561d-f729c8c7c431@FreeBSD.org> Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8FAlJp hmsCGwwFCQlmAYAACgkQNddxu25Gl89UPggA2mGQp28yCUKsJ6KHFVy/lpHfoQrKF+s7HfKT U2ObVeVNX4I8ZdW1UO48mRqxEOwY8r5YSH6X06OmiqCX2aSMXg3N06/l+ztlB0+UGGlkXBjv l9/nii+bC6b8XWuu0X7Qpb9oYBK9YtoaoyuVplAmjdj/cPou65meKIaS1yDTjHh450DrW8Qg he6l0bFX4BHKTSm99U90ML7EY19B6iI2BZSqWutVsyD71oAREY6NGgDpCOIO6FS41+WeYCDR j8vsa/BiaoX2d2SBDsCwsEwe9fg5PYMi2uVIhvL6OrxnwOdB+TkgvOy5zZSNO29UG/JilZKo Ndz2wpEaUzChGGqLvcLAZQQYAQoADwIbDAUCWujOKAUJCmB7PQAKCRA113G7bkaXz6bkB/9H dUR3E0wBwMh6z0AOFDKh+PbRI9Xd4IncdhE55tNK410650a3gADIDwqz3i72GIinkgaxzpEO xP1bs7a+BeF3p5Xd6Jjk6J/nEshisgNW7VjUbJHFGs8Sf9A6oM3q4VkI/ArVo5qkZxgKs72U HSAy5NV+AdqdTrWuAL20xfQ6gA7JF35Xf8zyUM2GMl0X8ik7dJ1jMp+TB27LipqbDgamFzH9 F9hC9gur94OQ/x3nQ+mFZ1uipYHA1EdrKuhb/Ts4bN/Ezl8nmYGxc9Bw7ZBxGOTId/rEIzoe LWpAvg6dcw0T9lNfSWc6PX+kf3dOXNIdkw9NqKID8wEPe8axcGYG Organization: FreeBSD Message-ID: <546b1fd2-6b80-a3a1-c39e-28c57d4451bf@FreeBSD.org> Date: Thu, 16 Aug 2018 12:48:44 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <8e232b42-e74a-d1c2-561d-f729c8c7c431@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZNV8Re9qz8EFM4F9iW61UBQamQ967sV7r" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:48:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ZNV8Re9qz8EFM4F9iW61UBQamQ967sV7r Content-Type: multipart/mixed; boundary="ogMxxLplnEIVgpOXLSHc587H7mRoc6DN2"; protected-headers="v1" From: Bryan Drewery To: Ian Lepore , Jung-uk Kim , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Brad Davis Message-ID: <546b1fd2-6b80-a3a1-c39e-28c57d4451bf@FreeBSD.org> Subject: Re: svn commit: r337791 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm cr... References: <201808141748.w7EHm3wI027223@repo.freebsd.org> <20180816175403.ub22a5glkczrmfij@ler-imac.local> <20180816182115.mqxkpzgifomjodwl@ler-imac.local> <1a403266-d3f8-1e06-01d6-fb1a7e5f29e5@FreeBSD.org> <20180816184745.bmfgz42ko5kfpyz6@ler-imac.local> <57eef2b1-d126-a8da-c45a-d8cab0373a08@FreeBSD.org> <1534446846.1466.43.camel@freebsd.org> <8e232b42-e74a-d1c2-561d-f729c8c7c431@FreeBSD.org> In-Reply-To: <8e232b42-e74a-d1c2-561d-f729c8c7c431@FreeBSD.org> --ogMxxLplnEIVgpOXLSHc587H7mRoc6DN2 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/16/18 12:31 PM, Bryan Drewery wrote: > On 8/16/18 12:14 PM, Ian Lepore wrote: >> On Thu, 2018-08-16 at 12:10 -0700, Bryan Drewery wrote: >>> On 8/16/18 11:47 AM, Larry Rosenman wrote: >>>> >>>> On Thu, Aug 16, 2018 at 11:34:59AM -0700, Bryan Drewery wrote: >>>>> >>>>> On 8/16/18 11:21 AM, Larry Rosenman wrote: >>>>>> >>>>>> On Thu, Aug 16, 2018 at 02:02:52PM -0400, Jung-uk Kim wrote: >>>>>>> >>>>>>> On 18. 8. 16., Larry Rosenman wrote: >>>>>>>> >>>>>>>> On Thu, Aug 16, 2018 at 01:48:40PM -0400, Jung-uk Kim >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> On 18. 8. 16., Ravi Pokala wrote: >>>>>>>>>> >>>>>>>>>> -----Original Message----- >>>>>>>>>> From: on behalf of >>>>>>>>>> Jung-uk Kim >>>>>>>>>> Date: 2018-08-14, Tuesday at 10:48 >>>>>>>>>> To: , >>>>>>>>> org>, >>>>>>>>>> Subject: svn commit: r337791 - in head: crypto/openssl >>>>>>>>>> crypto/openssl/apps crypto/openssl/crypto >>>>>>>>>> crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio >>>>>>>>>> crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm >>>>>>>>>> cr... >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Author: jkim >>>>>>>>>>> Date: Tue Aug 14 17:48:02 2018 >>>>>>>>>>> New Revision: 337791 >>>>>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/337791 >>>>>>>>>>> >>>>>>>>>>> Log: >>>>>>>>>>> =C2=A0 Merge OpenSSL 1.0.2p. >>>>>>>>>> Is it just me, or did this change break all the worlds? >>>>>>>>>> >>>>>>>>>> I got errors like this: >>>>>>>>>> >>>>>>>>>> ----------------------------------------------------- >>>>>>>>>> ----------- >>>>>>>>>> /usr/bin/ld: error: undefined symbol: main >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> referenced by crt1.c:74 >>>>>>>>>>>>> (/usr/home/rpokala/freebsd/clean/base/head/lib/cs >>>>>>>>>>>>> u/amd64/crt1.c:74) >>>>>>>>>>>>> =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/build/usr/home/rpokala/freebsd/cle >>>>>>>>>>>>> an/base/head/amd64.amd64/tmp/usr/lib/crt1.o:(_sta >>>>>>>>>>>>> rt) >>>>>>>>>> /usr/bin/ld: error: undefined symbol: Fssh_error >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> referenced by moduli.c:257 >>>>>>>>>>>>> (/usr/home/rpokala/freebsd/clean/base/head/crypto >>>>>>>>>>>>> /openssh/moduli.c:257) >>>>>>>>>>>>> =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/tmp/moduli- >>>>>>>>>>>>> 6780ab.o:(Fssh_gen_candidates) >>>>>>>>>> ----------------------------------------------------- >>>>>>>>>> ----------- >>>>>>>>>> >>>>>>>>>> At first I thought it was because I was rebuilding >>>>>>>>>> without cleaning, but I nuked the tree and rebuilt from >>>>>>>>>> scratch, and got the same error. >>>>>>>>>> >>>>>>>>>> I didn't bisect it to this change, but it's the only >>>>>>>>>> recent change to crypto... >>>>>>>>> I built worlds many times and I haven't seen such >>>>>>>>> problem.=C2=A0=C2=A0In fact, >>>>>>>>> Jenkins didn't break on amd64 after the commit. >>>>>>>>> >>>>>>>>> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/9888/ >>>>>>>> Do you or jenkins run with meta-mode?=C2=A0=C2=A0That seems to b= e a >>>>>>>> necessary >>>>>>>> condition for the failure. >>>>>>> I don't do meta-mode.=C2=A0=C2=A0I don't know much about Jenkins = build >>>>>>> but I don't >>>>>>> think it does.=C2=A0=C2=A0Is it a requirement now? >>>>>>> >>>>> Jenkins doesn't use META_MODE and it's not a requirement. >>>> Can you (bdrewery@) possibly diagnose why meta-mode is messing this >>>> up >>>> with the moduli file? >>>> >>>>> >>>>> >>> Sure. I'm hitting it as well. >>> >>> >> >> There's a thread about it in -current@ too. >> >> -- Ian >> >=20 >=20 > META_MODE is a distraction here, it fails without it in a clean build. > The current@ thread explains why due to moduli.c being in the .PATH now= =2E >=20 >> ~/git/freebsd/secure/usr.sbin/sshd # make buildconfig -dmM MK_META_MOD= E=3Dno >> Make_ExpandUse: examine buildconfig >> MakeAddChild: need to examine moduli >> MakeAddChild: need to examine sshd_config >> Make_ExpandUse: examine moduli >> MakeAddChild: need to examine moduli.c >> Make_ExpandUse: examine sshd_config >> Make_ExpandUse: examine moduli.c >> Examining moduli.c...modified 7:59:30 Jun 07, 2018...up-to-date. >> Examining moduli...modified 0:00:00 Nov 30, 2017...modified before so= urce /root/git/freebsd/crypto/openssh/moduli.c...out-of-date. >> cc -O2 -pipe -I/root/git/freebsd/crypto/openssh -include ssh_namespa= ce.h -DHAVE_LDNS=3D1 -DUSE_BSM_AUDIT=3D1 -DHAVE_GETAUDIT_ADDR=3D1 -DUSE_B= LACKLIST=3D1 -I/root/git/freebsd/contrib/blacklist/include -include >> krb5_config.h -DLIBWRAP=3D1 -DXAUTH_PATH=3D\"/usr/local/bin/xauth\" -= g -std=3Dgnu99 -fstack-protector-strong -Wno-pointer-sign -Wno-empty-bod= y -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautologic >> al-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-fun= ction -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-pack= ed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-pa >> rameter -Wno-parentheses -fcolor-diagnostics -Qunused-arguments -L/= scratch/obj/root/git/freebsd/amd64.amd64/lib/libblacklist /root/git/free= bsd/crypto/openssh/moduli.c -o /root/git/freebsd/crypto/op >> enssh/moduli >> /usr/bin/ld: error: undefined symbol: main >>>>> referenced by crt1.c:74 (/usr/src/lib/csu/amd64/crt1.c:74) >=20 >=20 >=20 r337928 should fix it. --=20 Regards, Bryan Drewery --ogMxxLplnEIVgpOXLSHc587H7mRoc6DN2-- --ZNV8Re9qz8EFM4F9iW61UBQamQ967sV7r Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlt11R0ACgkQNddxu25G l8+xrggAuK2hJ6AR4/RcyBEDWJNo6mL3RTXhFeujp67my+OPOC64XSXJIF96HrDu 9ACWHfXuJHsb7duq7dk808VFd+GGOjAkEbqbUYJfOmsJHduW92lcUF4r4X4IDWaX RQgNnKX1xeFEzX1Ik6Olhqm+p+88zH8cJhFDtNeqlRnzCyWAQlo8XpdPYJRGt17J Gb0AbzG5SJOYpqe6bCOWaSwMwYw/pJtIQC9ZrZe5+HdKbDri7iy096lRH1ENSSwK dXyAiJJMIZZS17eyeB1k7EBlrCeRX+q94vztN3RGyBfQ8y4xUgDhz6NZdM/MYrOd 40LsUA6OD64hSVmFVtmw/2m89KSJxQ== =dSFa -----END PGP SIGNATURE----- --ZNV8Re9qz8EFM4F9iW61UBQamQ967sV7r-- From owner-svn-src-all@freebsd.org Thu Aug 16 19:58: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 1614E107524C; Thu, 16 Aug 2018 19:58:52 +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 EB13F76BDC; Thu, 16 Aug 2018 19:58:50 +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 w7GJwnTn055611; Thu, 16 Aug 2018 12:58:49 -0700 (PDT) (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 w7GJwnpl055610; Thu, 16 Aug 2018 12:58:49 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808161958.w7GJwnpl055610@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337925 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys In-Reply-To: <4ff9cbb56df7a7467f0a66746fe0af5e@freebsd.org> To: James Gritton Date: Thu, 16 Aug 2018 12:58:49 -0700 (PDT) CC: rgrimes@freebsd.org, 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 19:58:52 -0000 > On 2018-08-16 13:36, Rodney W. Grimes wrote: > >> OK, so noted. But seeing as I've already done the partial in this > >> case, > >> what's best to do now? Should I add another commit to revert the > >> so-far > >> unreverted files? > > > > Thats a mixed bag, how many files is it, and what would the > > commit message before for them? be for them? > > > > Usually these are seperable changes that should not of been combined > > with the original commit. > > There are five files I didn't revert: two man pages, and two code files > with a changed comment. The changes being the docs up to date, with or bring? > without the other deprecation changes, so at this point they're correct > whether they're changed or not. > > The commit message would be something like: > > Revert the remainder of r337922 that I didn't revert in r337925, until > such point as I re-commit the whole thing. I was more asking for what would the commit for this two man pages and two code files look like? It sounds like these are standalone changes that should of probably been done in there own commit anyway? Or are they some how integral to r337922? I guess just leave it be for now, and try to avoid these types of situations in the future. > >> - Jamie > >> > >> > >> On 2018-08-16 13:27, Rodney W. Grimes wrote: > >> >> Author: jamie > >> >> Date: Thu Aug 16 19:09:43 2018 > >> >> New Revision: 337925 > >> >> URL: https://svnweb.freebsd.org/changeset/base/337925 > >> >> > >> >> Log: > >> >> Revert r337922, except for some documention-only bits. This needs > >> >> to wait > >> >> until user is changed to stop using jail(2). > >> > > >> > Can we please stop doing "partial" reverts, it makes log > >> > tracking and sorting out stuff later more difficult. > >> > > >> > If something is seperable and needs to stay it is best > >> > to revert the whole commit, and then commit with a proper > >> > log exactly what it is that you did not want to revert. > >> > > >> >> > >> >> Differential Revision: D14791 > >> >> > >> >> Modified: > >> >> head/lib/libc/sys/jail.2 > >> >> head/sys/compat/freebsd32/freebsd32_misc.c > >> >> head/sys/compat/freebsd32/freebsd32_proto.h > >> >> head/sys/compat/freebsd32/freebsd32_syscall.h > >> >> head/sys/compat/freebsd32/freebsd32_syscalls.c > >> >> head/sys/compat/freebsd32/freebsd32_sysent.c > >> >> head/sys/compat/freebsd32/freebsd32_systrace_args.c > >> >> head/sys/compat/freebsd32/syscalls.master > >> >> head/sys/kern/init_sysent.c > >> >> head/sys/kern/kern_jail.c > >> >> head/sys/kern/syscalls.c > >> >> head/sys/kern/syscalls.master > >> >> head/sys/kern/systrace_args.c > >> >> head/sys/sys/jail.h > >> >> head/sys/sys/syscall.h > >> >> head/sys/sys/syscall.mk > >> >> head/sys/sys/syscallsubr.h > >> >> head/sys/sys/sysproto.h > >> >> > >> >> Modified: head/lib/libc/sys/jail.2 > >> >> ============================================================================== > >> >> --- head/lib/libc/sys/jail.2 Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/lib/libc/sys/jail.2 Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -25,10 +25,11 @@ > >> >> .\" > >> >> .\" $FreeBSD$ > >> >> .\" > >> >> -.Dd August 16, 2018 > >> >> +.Dd February 8, 2012 > >> >> .Dt JAIL 2 > >> >> .Os > >> >> .Sh NAME > >> >> +.Nm jail , > >> >> .Nm jail_get , > >> >> .Nm jail_set , > >> >> .Nm jail_remove , > >> >> @@ -40,6 +41,8 @@ > >> >> .In sys/param.h > >> >> .In sys/jail.h > >> >> .Ft int > >> >> +.Fn jail "struct jail *jail" > >> >> +.Ft int > >> >> .Fn jail_attach "int jid" > >> >> .Ft int > >> >> .Fn jail_remove "int jid" > >> >> @@ -50,7 +53,74 @@ > >> >> .Fn jail_set "struct iovec *iov" "u_int niov" "int flags" > >> >> .Sh DESCRIPTION > >> >> The > >> >> +.Fn jail > >> >> +system call sets up a jail and locks the current process in it. > >> >> +.Pp > >> >> +The argument is a pointer to a structure describing the prison: > >> >> +.Bd -literal -offset indent > >> >> +struct jail { > >> >> + uint32_t version; > >> >> + char *path; > >> >> + char *hostname; > >> >> + char *jailname; > >> >> + unsigned int ip4s; > >> >> + unsigned int ip6s; > >> >> + struct in_addr *ip4; > >> >> + struct in6_addr *ip6; > >> >> +}; > >> >> +.Ed > >> >> +.Pp > >> >> +.Dq Li version > >> >> +defines the version of the API in use. > >> >> +.Dv JAIL_API_VERSION > >> >> +is defined for the current version. > >> >> +.Pp > >> >> +The > >> >> +.Dq Li path > >> >> +pointer should be set to the directory which is to be the root of the > >> >> +prison. > >> >> +.Pp > >> >> +The > >> >> +.Dq Li hostname > >> >> +pointer can be set to the hostname of the prison. > >> >> +This can be changed > >> >> +from the inside of the prison. > >> >> +.Pp > >> >> +The > >> >> +.Dq Li jailname > >> >> +pointer is an optional name that can be assigned to the jail > >> >> +for example for management purposes. > >> >> +.Pp > >> >> +The > >> >> +.Dq Li ip4s > >> >> +and > >> >> +.Dq Li ip6s > >> >> +give the numbers of IPv4 and IPv6 addresses that will be passed > >> >> +via their respective pointers. > >> >> +.Pp > >> >> +The > >> >> +.Dq Li ip4 > >> >> +and > >> >> +.Dq Li ip6 > >> >> +pointers can be set to an arrays of IPv4 and IPv6 addresses to be > >> >> assigned to > >> >> +the prison, or NULL if none. > >> >> +IPv4 addresses must be in network byte order. > >> >> +.Pp > >> >> +This is equivalent to, and deprecated in favor of, the > >> >> .Fn jail_set > >> >> +system call (see below), with the parameters > >> >> +.Va path , > >> >> +.Va host.hostname , > >> >> +.Va name , > >> >> +.Va ip4.addr , > >> >> +and > >> >> +.Va ip6.addr , > >> >> +and with the > >> >> +.Dv JAIL_ATTACH > >> >> +flag. > >> >> +.Pp > >> >> +The > >> >> +.Fn jail_set > >> >> system call creates a new jail, or modifies an existing one, and > >> >> optionally > >> >> locks the current process in it. > >> >> Jail parameters are passed as an array of name-value pairs in the > >> >> array > >> >> @@ -76,19 +146,13 @@ The current set of available parameters, and > >> >> their for > >> >> retrieved via the > >> >> .Va security.jail.param > >> >> sysctl MIB entry. > >> >> -Notable parameters include > >> >> +Notable parameters include those mentioned in the > >> >> +.Fn jail > >> >> +description above, as well as > >> >> .Va jid > >> >> and > >> >> -.Va name > >> >> -which identify the jail being created or modified, > >> >> -.Va path > >> >> -(the root directory of the jail), > >> >> -.Va host.hostname > >> >> -(the hostname of the jail), and > >> >> -.Va ip4.addr > >> >> -and > >> >> -.Va ip6.addr > >> >> -(IP addresses to assign to the jail). > >> >> +.Va name , > >> >> +which identify the jail being created or modified. > >> >> See > >> >> .Xr jail 8 > >> >> for more information on the core jail parameters. > >> >> @@ -173,7 +237,8 @@ It will kill all processes belonging to the jail, > >> >> and > >> >> of that jail. > >> >> .Sh RETURN VALUES > >> >> If successful, > >> >> -.Fn jail_set > >> >> +.Fn jail , > >> >> +.Fn jail_set , > >> >> and > >> >> .Fn jail_get > >> >> return a non-negative integer, termed the jail identifier (JID). > >> >> @@ -184,6 +249,25 @@ to indicate the error. > >> >> .Rv -std jail_attach jail_remove > >> >> .Sh ERRORS > >> >> The > >> >> +.Fn jail > >> >> +system call > >> >> +will fail if: > >> >> +.Bl -tag -width Er > >> >> +.It Bq Er EPERM > >> >> +This process is not allowed to create a jail, either because it is > >> >> not > >> >> +the super-user, or because it would exceed the jail's > >> >> +.Va children.max > >> >> +limit. > >> >> +.It Bq Er EFAULT > >> >> +.Fa jail > >> >> +points to an address outside the allocated address space of the > >> >> process. > >> >> +.It Bq Er EINVAL > >> >> +The version number of the argument is not correct. > >> >> +.It Bq Er EAGAIN > >> >> +No free JID could be found. > >> >> +.El > >> >> +.Pp > >> >> +The > >> >> .Fn jail_set > >> >> system call > >> >> will fail if: > >> >> @@ -287,7 +371,8 @@ does not exist. > >> >> .El > >> >> .Pp > >> >> Further > >> >> -.Fn jail_set > >> >> +.Fn jail , > >> >> +.Fn jail_set , > >> >> and > >> >> .Fn jail_attach > >> >> call > >> >> @@ -301,7 +386,7 @@ manual page for details. > >> >> .Xr chroot 2 , > >> >> .Xr jail 8 > >> >> .Sh HISTORY > >> >> -The now-deprecated > >> >> +The > >> >> .Fn jail > >> >> system call appeared in > >> >> .Fx 4.0 . > >> >> > >> >> Modified: head/sys/compat/freebsd32/freebsd32_misc.c > >> >> ============================================================================== > >> >> --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 18:58:34 > >> >> 2018 (r337924) > >> >> +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 19:09:43 > >> >> 2018 (r337925) > >> >> @@ -2289,10 +2289,8 @@ freebsd32_sysctl(struct thread *td, struct > >> >> freebsd32_s > >> >> return (0); > >> >> } > >> >> > >> >> -#ifdef COMPAT_FREEBSD11 > >> >> int > >> >> -freebsd11_freebsd32_jail(struct thread *td, > >> >> - struct freebsd11_freebsd32_jail_args *uap) > >> >> +freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) > >> >> { > >> >> uint32_t version; > >> >> int error; > >> >> @@ -2349,9 +2347,8 @@ freebsd11_freebsd32_jail(struct thread *td, > >> >> /* Sci-Fi jails are not supported, sorry. */ > >> >> return (EINVAL); > >> >> } > >> >> - return (freebsd11_kern_jail(td, &j)); > >> >> + return (kern_jail(td, &j)); > >> >> } > >> >> -#endif /* COMPAT_FREEBSD11 */ > >> >> > >> >> int > >> >> freebsd32_jail_set(struct thread *td, struct freebsd32_jail_set_args > >> >> *uap) > >> >> > >> >> Modified: head/sys/compat/freebsd32/freebsd32_proto.h > >> >> ============================================================================== > >> >> --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 18:58:34 > >> >> 2018 (r337924) > >> >> +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 19:09:43 > >> >> 2018 (r337925) > >> >> @@ -283,6 +283,9 @@ struct freebsd32_sched_rr_get_interval_args { > >> >> char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; > >> >> char interval_l_[PADL_(struct timespec32 *)]; struct timespec32 * > >> >> interval; char interval_r_[PADR_(struct timespec32 *)]; > >> >> }; > >> >> +struct freebsd32_jail_args { > >> >> + char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char > >> >> jail_r_[PADR_(struct jail32 *)]; > >> >> +}; > >> >> struct freebsd32_sigtimedwait_args { > >> >> char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char > >> >> set_r_[PADR_(const sigset_t *)]; > >> >> char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char > >> >> info_r_[PADR_(siginfo_t *)]; > >> >> @@ -758,6 +761,7 @@ int freebsd32_aio_return(struct thread *, struct > >> >> freeb > >> >> int freebsd32_aio_suspend(struct thread *, struct > >> >> freebsd32_aio_suspend_args *); > >> >> int freebsd32_aio_error(struct thread *, struct > >> >> freebsd32_aio_error_args *); > >> >> int freebsd32_sched_rr_get_interval(struct thread *, struct > >> >> freebsd32_sched_rr_get_interval_args *); > >> >> +int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); > >> >> int freebsd32_sigtimedwait(struct thread *, struct > >> >> freebsd32_sigtimedwait_args *); > >> >> int freebsd32_sigwaitinfo(struct thread *, struct > >> >> freebsd32_sigwaitinfo_args *); > >> >> int freebsd32_aio_waitcomplete(struct thread *, struct > >> >> freebsd32_aio_waitcomplete_args *); > >> >> @@ -1180,9 +1184,6 @@ struct freebsd11_freebsd32_fhstat_args { > >> >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * > >> >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; > >> >> char sb_l_[PADL_(struct freebsd11_stat32 *)]; struct > >> >> freebsd11_stat32 * sb; char sb_r_[PADR_(struct freebsd11_stat32 *)]; > >> >> }; > >> >> -struct freebsd11_freebsd32_jail_args { > >> >> - char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char > >> >> jail_r_[PADR_(struct jail32 *)]; > >> >> -}; > >> >> struct freebsd11_freebsd32_kevent_args { > >> >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; > >> >> char changelist_l_[PADL_(const struct kevent32_freebsd11 *)]; const > >> >> struct kevent32_freebsd11 * changelist; char changelist_r_[PADR_(const > >> >> struct kevent32_freebsd11 *)]; > >> >> @@ -1222,7 +1223,6 @@ int freebsd11_freebsd32_lstat(struct thread *, > >> >> struct > >> >> int freebsd11_freebsd32_getdirentries(struct thread *, struct > >> >> freebsd11_freebsd32_getdirentries_args *); > >> >> int freebsd11_freebsd32_getdents(struct thread *, struct > >> >> freebsd11_freebsd32_getdents_args *); > >> >> int freebsd11_freebsd32_fhstat(struct thread *, struct > >> >> freebsd11_freebsd32_fhstat_args *); > >> >> -int freebsd11_freebsd32_jail(struct thread *, struct > >> >> freebsd11_freebsd32_jail_args *); > >> >> int freebsd11_freebsd32_kevent(struct thread *, struct > >> >> freebsd11_freebsd32_kevent_args *); > >> >> int freebsd11_freebsd32_fstatat(struct thread *, struct > >> >> freebsd11_freebsd32_fstatat_args *); > >> >> int freebsd11_freebsd32_mknodat(struct thread *, struct > >> >> freebsd11_freebsd32_mknodat_args *); > >> >> @@ -1317,7 +1317,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, > >> >> struc > >> >> > >> >> #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_LIO_LISTIO > >> >> #define FREEBSD32_SYS_AUE_freebsd32_sched_rr_get_interval AUE_NULL > >> >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE > >> >> -#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_jail AUE_JAIL > >> >> +#define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL > >> >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION > >> >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN > >> >> #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT > >> >> > >> >> Modified: head/sys/compat/freebsd32/freebsd32_syscall.h > >> >> ============================================================================== > >> >> --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 18:58:34 > >> >> 2018 (r337924) > >> >> +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 19:09:43 > >> >> 2018 (r337925) > >> >> @@ -275,7 +275,7 @@ > >> >> #define FREEBSD32_SYS_utrace 335 > >> >> /* 336 is freebsd4 freebsd32_sendfile */ > >> >> #define FREEBSD32_SYS_kldsym 337 > >> >> -#define FREEBSD32_SYS_freebsd11_freebsd32_jail 338 > >> >> +#define FREEBSD32_SYS_freebsd32_jail 338 > >> >> #define FREEBSD32_SYS_sigprocmask 340 > >> >> #define FREEBSD32_SYS_sigsuspend 341 > >> >> /* 342 is freebsd4 freebsd32_sigaction */ > >> >> > >> >> Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c > >> >> ============================================================================== > >> >> --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 18:58:34 > >> >> 2018 (r337924) > >> >> +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 19:09:43 > >> >> 2018 (r337925) > >> >> @@ -347,7 +347,7 @@ const char *freebsd32_syscallnames[] = { > >> >> "utrace", /* 335 = utrace */ > >> >> "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile > >> >> */ > >> >> "kldsym", /* 337 = kldsym */ > >> >> - "compat11.freebsd32_jail", /* 338 = freebsd11 freebsd32_jail */ > >> >> + "freebsd32_jail", /* 338 = freebsd32_jail */ > >> >> "#339", /* 339 = pioctl */ > >> >> "sigprocmask", /* 340 = sigprocmask */ > >> >> "sigsuspend", /* 341 = sigsuspend */ > >> >> > >> >> Modified: head/sys/compat/freebsd32/freebsd32_sysent.c > >> >> ============================================================================== > >> >> --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 18:58:34 > >> >> 2018 (r337924) > >> >> +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 19:09:43 > >> >> 2018 (r337925) > >> >> @@ -394,7 +394,7 @@ struct sysent freebsd32_sysent[] = { > >> >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, > >> >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ > >> >> { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), > >> >> AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = > >> >> freebsd4 freebsd32_sendfile */ > >> >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, > >> >> SY_THR_STATIC }, /* 337 = kldsym */ > >> >> - { compat11(AS(freebsd11_freebsd32_jail_args),freebsd32_jail), > >> >> AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 > >> >> freebsd32_jail */ > >> >> + { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, > >> >> NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd32_jail */ > >> >> { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT > >> >> }, /* 339 = pioctl */ > >> >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, > >> >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = > >> >> sigprocmask */ > >> >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, > >> >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ > >> >> > >> >> Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c > >> >> ============================================================================== > >> >> --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 > >> >> 18:58:34 2018 (r337924) > >> >> +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 > >> >> 19:09:43 2018 (r337925) > >> >> @@ -1559,6 +1559,13 @@ systrace_args(int sysnum, void *params, > >> >> uint64_t *uarg > >> >> *n_args = 3; > >> >> break; > >> >> } > >> >> + /* freebsd32_jail */ > >> >> + case 338: { > >> >> + struct freebsd32_jail_args *p = params; > >> >> + uarg[0] = (intptr_t) p->jail; /* struct jail32 * */ > >> >> + *n_args = 1; > >> >> + break; > >> >> + } > >> >> /* sigprocmask */ > >> >> case 340: { > >> >> struct sigprocmask_args *p = params; > >> >> @@ -5704,6 +5711,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, > >> >> char *d > >> >> break; > >> >> }; > >> >> break; > >> >> + /* freebsd32_jail */ > >> >> + case 338: > >> >> + switch(ndx) { > >> >> + case 0: > >> >> + p = "userland struct jail32 *"; > >> >> + break; > >> >> + default: > >> >> + break; > >> >> + }; > >> >> + break; > >> >> /* sigprocmask */ > >> >> case 340: > >> >> switch(ndx) { > >> >> @@ -9653,6 +9670,11 @@ systrace_return_setargdesc(int sysnum, int ndx, > >> >> char * > >> >> break; > >> >> /* kldsym */ > >> >> case 337: > >> >> + if (ndx == 0 || ndx == 1) > >> >> + p = "int"; > >> >> + break; > >> >> + /* freebsd32_jail */ > >> >> + case 338: > >> >> if (ndx == 0 || ndx == 1) > >> >> p = "int"; > >> >> break; > >> >> > >> >> Modified: head/sys/compat/freebsd32/syscalls.master > >> >> ============================================================================== > >> >> --- head/sys/compat/freebsd32/syscalls.master Thu Aug 16 18:58:34 > >> >> 2018 (r337924) > >> >> +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 16 19:09:43 > >> >> 2018 (r337925) > >> >> @@ -601,7 +601,7 @@ > >> >> off_t *sbytes, int flags); } > >> >> 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ > >> >> void *data); } > >> >> -338 AUE_JAIL COMPAT11 { int freebsd32_jail(struct jail32 *jail); } > >> >> +338 AUE_JAIL STD { int freebsd32_jail(struct jail32 *jail); } > >> >> 339 AUE_NULL UNIMPL pioctl > >> >> 340 AUE_SIGPROCMASK NOPROTO { int sigprocmask(int how, \ > >> >> const sigset_t *set, sigset_t *oset); } > >> >> > >> >> Modified: head/sys/kern/init_sysent.c > >> >> ============================================================================== > >> >> --- head/sys/kern/init_sysent.c Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/kern/init_sysent.c Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -387,7 +387,7 @@ struct sysent sysent[] = { > >> >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, > >> >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ > >> >> { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, > >> >> 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ > >> >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, > >> >> SY_THR_STATIC }, /* 337 = kldsym */ > >> >> - { compat11(AS(freebsd11_jail_args),jail), AUE_JAIL, NULL, 0, 0, 0, > >> >> SY_THR_STATIC }, /* 338 = freebsd11 jail */ > >> >> + { AS(jail_args), (sy_call_t *)sys_jail, AUE_JAIL, NULL, 0, 0, 0, > >> >> SY_THR_STATIC }, /* 338 = jail */ > >> >> { AS(nnpfs_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, > >> >> 0, 0, SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ > >> >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, > >> >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = > >> >> sigprocmask */ > >> >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, > >> >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ > >> >> > >> >> Modified: head/sys/kern/kern_jail.c > >> >> ============================================================================== > >> >> --- head/sys/kern/kern_jail.c Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/kern/kern_jail.c Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -74,14 +74,6 @@ __FBSDID("$FreeBSD$"); > >> >> > >> >> #include > >> >> > >> >> -/* > >> >> - * The old jail(2) interface will exist under COMPAT_FREEBSD11, but > >> >> the global > >> >> - * permission sysctls are slated to go away sometime (even with > >> >> COMPAT). > >> >> - */ > >> >> -#if defined(COMPAT_FREEBSD11) && !defined(BURN_BRIDGES) > >> >> -#define PR_GLOBAL_ALLOW > >> >> -#endif > >> >> - > >> >> #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" > >> >> > >> >> MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); > >> >> @@ -207,11 +199,9 @@ const size_t pr_flag_allow_size = > >> >> sizeof(pr_flag_allow > >> >> #define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | > >> >> PR_ALLOW_RESERVED_PORTS) > >> >> #define JAIL_DEFAULT_ENFORCE_STATFS 2 > >> >> #define JAIL_DEFAULT_DEVFS_RSNUM 0 > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; > >> >> static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; > >> >> static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; > >> >> -#endif > >> >> #if defined(INET) || defined(INET6) > >> >> static unsigned jail_max_af_ips = 255; > >> >> #endif > >> >> @@ -229,14 +219,13 @@ prison0_init(void) > >> >> strlcpy(prison0.pr_osrelease, osrelease, > >> >> sizeof(prison0.pr_osrelease)); > >> >> } > >> >> > >> >> -#ifdef COMPAT_FREEBSD11 > >> >> /* > >> >> * struct jail_args { > >> >> * struct jail *jail; > >> >> * }; > >> >> */ > >> >> int > >> >> -freebsd11_jail(struct thread *td, struct freebsd11_jail_args *uap) > >> >> +sys_jail(struct thread *td, struct jail_args *uap) > >> >> { > >> >> uint32_t version; > >> >> int error; > >> >> @@ -281,16 +270,13 @@ freebsd11_jail(struct thread *td, struct > >> >> freebsd11_jai > >> >> /* Sci-Fi jails are not supported, sorry. */ > >> >> return (EINVAL); > >> >> } > >> >> - return (freebsd11_kern_jail(td, &j)); > >> >> + return (kern_jail(td, &j)); > >> >> } > >> >> > >> >> int > >> >> -freebsd11_kern_jail(struct thread *td, struct jail *j) > >> >> +kern_jail(struct thread *td, struct jail *j) > >> >> { > >> >> - struct iovec optiov[2 * (3 > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> - + 1 + nitems(pr_flag_allow) > >> >> -#endif > >> >> + struct iovec optiov[2 * (4 + nitems(pr_flag_allow) > >> >> #ifdef INET > >> >> + 1 > >> >> #endif > >> >> @@ -300,10 +286,7 @@ freebsd11_kern_jail(struct thread *td, struct > >> >> jail *j) > >> >> )]; > >> >> struct uio opt; > >> >> char *u_path, *u_hostname, *u_name; > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> struct bool_flags *bf; > >> >> - int enforce_statfs; > >> >> -#endif > >> >> #ifdef INET > >> >> uint32_t ip4s; > >> >> struct in_addr *u_ip4; > >> >> @@ -312,7 +295,7 @@ freebsd11_kern_jail(struct thread *td, struct jail > >> >> *j) > >> >> struct in6_addr *u_ip6; > >> >> #endif > >> >> size_t tmplen; > >> >> - int error; > >> >> + int error, enforce_statfs; > >> >> > >> >> bzero(&optiov, sizeof(optiov)); > >> >> opt.uio_iov = optiov; > >> >> @@ -323,7 +306,6 @@ freebsd11_kern_jail(struct thread *td, struct jail > >> >> *j) > >> >> opt.uio_rw = UIO_READ; > >> >> opt.uio_td = td; > >> >> > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> /* Set permissions for top-level jails from sysctls. */ > >> >> if (!jailed(td->td_ucred)) { > >> >> for (bf = pr_flag_allow; > >> >> @@ -345,7 +327,6 @@ freebsd11_kern_jail(struct thread *td, struct jail > >> >> *j) > >> >> optiov[opt.uio_iovcnt].iov_len = sizeof(enforce_statfs); > >> >> opt.uio_iovcnt++; > >> >> } > >> >> -#endif > >> >> > >> >> tmplen = MAXPATHLEN + MAXHOSTNAMELEN + MAXHOSTNAMELEN; > >> >> #ifdef INET > >> >> @@ -449,7 +430,6 @@ freebsd11_kern_jail(struct thread *td, struct jail > >> >> *j) > >> >> free(u_path, M_TEMP); > >> >> return (error); > >> >> } > >> >> -#endif /* COMPAT_FREEBSD11 */ > >> >> > >> >> > >> >> /* > >> >> @@ -1267,11 +1247,7 @@ kern_jail_set(struct thread *td, struct uio > >> >> *optuio, i > >> >> > >> >> pr->pr_securelevel = ppr->pr_securelevel; > >> >> pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> pr->pr_enforce_statfs = jail_default_enforce_statfs; > >> >> -#else > >> >> - pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; > >> >> -#endif > >> >> pr->pr_devfs_rsnum = ppr->pr_devfs_rsnum; > >> >> > >> >> pr->pr_osreldate = osreldt ? osreldt : ppr->pr_osreldate; > >> >> @@ -3439,7 +3415,6 @@ prison_path(struct prison *pr1, struct prison > >> >> *pr2) > >> >> static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW, 0, > >> >> "Jails"); > >> >> > >> >> -#ifdef COMPAT_FREEBSD11 > >> >> static int > >> >> sysctl_jail_list(SYSCTL_HANDLER_ARGS) > >> >> { > >> >> @@ -3543,7 +3518,6 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) > >> >> SYSCTL_OID(_security_jail, OID_AUTO, list, > >> >> CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, > >> >> sysctl_jail_list, "S", "List of active jails"); > >> >> -#endif /* COMPAT_FREEBSD11 */ > >> >> > >> >> static int > >> >> sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) > >> >> @@ -3583,14 +3557,13 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vnet, > >> >> #if defined(INET) || defined(INET6) > >> >> SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, > >> >> &jail_max_af_ips, 0, > >> >> - "Number of IP addresses a jail may have at most per address > >> >> family"); > >> >> + "Number of IP addresses a jail may have at most per address > >> >> family (deprecated)"); > >> >> #endif > >> >> > >> >> /* > >> >> - * Jail permissions - jailed processes can read these to find out > >> >> what they are > >> >> - * allowed to do. A deprecated use is to set default permissions for > >> >> prisons > >> >> - * created via jail(2). For historical reasons, the sysctl names > >> >> have varying > >> >> - * similarity to the parameter names. > >> >> + * Default parameters for jail(2) compatibility. For historical > >> >> reasons, > >> >> + * the sysctl names have varying similarity to the parameter names. > >> >> Prisons > >> >> + * just see their own parameters, and can't change them. > >> >> */ > >> >> static int > >> >> sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) > >> >> @@ -3599,68 +3572,52 @@ sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) > >> >> int allow, error, i; > >> >> > >> >> pr = req->td->td_ucred->cr_prison; > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> allow = (pr == &prison0) ? jail_default_allow : pr->pr_allow; > >> >> -#else > >> >> - allow = pr->pr_allow; > >> >> -#endif > >> >> > >> >> /* Get the current flag value, and convert it to a boolean. */ > >> >> i = (allow & arg2) ? 1 : 0; > >> >> if (arg1 != NULL) > >> >> i = !i; > >> >> error = sysctl_handle_int(oidp, &i, 0, req); > >> >> - if (error) > >> >> + if (error || !req->newptr) > >> >> return (error); > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> - if (req->newptr) { > >> >> - i = i ? arg2 : 0; > >> >> - if (arg1 != NULL) > >> >> - i ^= arg2; > >> >> - /* > >> >> - * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 > >> >> - * for writing. > >> >> - */ > >> >> - mtx_lock(&prison0.pr_mtx); > >> >> - jail_default_allow = (jail_default_allow & ~arg2) | i; > >> >> - mtx_unlock(&prison0.pr_mtx); > >> >> - } > >> >> -#endif > >> >> + i = i ? arg2 : 0; > >> >> + if (arg1 != NULL) > >> >> + i ^= arg2; > >> >> + /* > >> >> + * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 > >> >> + * for writing. > >> >> + */ > >> >> + mtx_lock(&prison0.pr_mtx); > >> >> + jail_default_allow = (jail_default_allow & ~arg2) | i; > >> >> + mtx_unlock(&prison0.pr_mtx); > >> >> return (0); > >> >> } > >> >> > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RW | CTLFLAG_MPSAFE) > >> >> -#define ADDR_GLOBAL_ALLOW(i) &i > >> >> -#else > >> >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RD | CTLFLAG_MPSAFE) > >> >> -#define ADDR_GLOBAL_ALLOW(i) NULL > >> >> -#endif > >> >> - > >> >> SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, > >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> >> NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", > >> >> - "Processes in jail can set their hostnames"); > >> >> + "Processes in jail can set their hostnames (deprecated)"); > >> >> SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, > >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> >> (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", > >> >> - "Processes in jail are limited to creating UNIX/IP/route sockets > >> >> only"); > >> >> + "Processes in jail are limited to creating UNIX/IP/route sockets > >> >> only (deprecated)"); > >> >> SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, > >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> >> NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", > >> >> - "Processes in jail can use System V IPC primitives"); > >> >> + "Processes in jail can use System V IPC primitives > >> >> (deprecated)"); > >> >> SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, > >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> >> NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", > >> >> - "Prison root can create raw sockets"); > >> >> + "Prison root can create raw sockets (deprecated)"); > >> >> SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, > >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> >> NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", > >> >> - "Processes in jail can alter system file flags"); > >> >> + "Processes in jail can alter system file flags (deprecated)"); > >> >> SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, > >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> >> NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", > >> >> - "Processes in jail can mount/unmount jail-friendly file > >> >> systems"); > >> >> + "Processes in jail can mount/unmount jail-friendly file systems > >> >> (deprecated)"); > >> >> > >> >> static int > >> >> sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) > >> >> @@ -3669,33 +3626,25 @@ sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) > >> >> int level, error; > >> >> > >> >> pr = req->td->td_ucred->cr_prison; > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> level = (pr == &prison0) ? *(int *)arg1 : *(int *)((char *)pr + > >> >> arg2); > >> >> -#else > >> >> - level = *(int *)((char *)pr + arg2); > >> >> -#endif > >> >> error = sysctl_handle_int(oidp, &level, 0, req); > >> >> - if (error) > >> >> + if (error || !req->newptr) > >> >> return (error); > >> >> -#ifdef PR_GLOBAL_ALLOW > >> >> - if (req->newptr) > >> >> - *(int *)arg1 = level; > >> >> -#endif > >> >> + *(int *)arg1 = level; > >> >> return (0); > >> >> } > >> >> > >> >> SYSCTL_PROC(_security_jail, OID_AUTO, enforce_statfs, > >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> >> - ADDR_GLOBAL_ALLOW(jail_default_enforce_statfs), > >> >> - offsetof(struct prison, pr_enforce_statfs), > >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, > >> >> + &jail_default_enforce_statfs, offsetof(struct prison, > >> >> pr_enforce_statfs), > >> >> sysctl_jail_default_level, "I", > >> >> - "Processes in jail cannot see all mounted file systems"); > >> >> + "Processes in jail cannot see all mounted file systems > >> >> (deprecated)"); > >> >> + > >> >> SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, > >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, > >> >> - ADDR_GLOBAL_ALLOW(jail_default_devfs_rsnum), > >> >> - offsetof(struct prison, pr_devfs_rsnum), > >> >> + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, > >> >> + &jail_default_devfs_rsnum, offsetof(struct prison, > >> >> pr_devfs_rsnum), > >> >> sysctl_jail_default_level, "I", > >> >> - "Ruleset for the devfs filesystem in jail"); > >> >> + "Ruleset for the devfs filesystem in jail (deprecated)"); > >> >> > >> >> /* > >> >> * Nodes to describe jail parameters. Maximum length of string > >> >> parameters > >> >> @@ -3836,6 +3785,9 @@ prison_add_allow(const char *prefix, const char > >> >> *name, > >> >> struct bool_flags *bf; > >> >> struct sysctl_oid *parent; > >> >> char *allow_name, *allow_noname, *allowed; > >> >> +#ifndef NO_SYSCTL_DESCR > >> >> + char *descr_deprecated; > >> >> +#endif > >> >> unsigned allow_flag; > >> >> > >> >> if (prefix > >> >> @@ -3892,7 +3844,10 @@ prison_add_allow(const char *prefix, const char > >> >> *name, > >> >> bf->flag = allow_flag; > >> >> mtx_unlock(&prison0.pr_mtx); > >> >> > >> >> - /* Create sysctls for the paramter, and the current permission. */ > >> >> + /* > >> >> + * Create sysctls for the paramter, and the back-compat global > >> >> + * permission. > >> >> + */ > >> >> parent = prefix > >> >> ? SYSCTL_ADD_NODE(NULL, > >> >> SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), > >> >> @@ -3904,10 +3859,17 @@ prison_add_allow(const char *prefix, const > >> >> char *name, > >> >> if ((prefix > >> >> ? asprintf(&allowed, M_TEMP, "%s_%s_allowed", prefix, name) > >> >> : asprintf(&allowed, M_TEMP, "%s_allowed", name)) >= 0) { > >> >> +#ifndef NO_SYSCTL_DESCR > >> >> + (void)asprintf(&descr_deprecated, M_TEMP, "%s (deprecated)", > >> >> + descr); > >> >> +#endif > >> >> (void)SYSCTL_ADD_PROC(NULL, > >> >> SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, allowed, > >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, allow_flag, > >> >> - sysctl_jail_default_allow, "I", descr); > >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, allow_flag, > >> >> + sysctl_jail_default_allow, "I", descr_deprecated); > >> >> +#ifndef NO_SYSCTL_DESCR > >> >> + free(descr_deprecated, M_TEMP); > >> >> +#endif > >> >> free(allowed, M_TEMP); > >> >> } > >> >> return allow_flag; > >> >> > >> >> Modified: head/sys/kern/syscalls.c > >> >> ============================================================================== > >> >> --- head/sys/kern/syscalls.c Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/kern/syscalls.c Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -344,7 +344,7 @@ const char *syscallnames[] = { > >> >> "utrace", /* 335 = utrace */ > >> >> "compat4.sendfile", /* 336 = freebsd4 sendfile */ > >> >> "kldsym", /* 337 = kldsym */ > >> >> - "compat11.jail", /* 338 = freebsd11 jail */ > >> >> + "jail", /* 338 = jail */ > >> >> "nnpfs_syscall", /* 339 = nnpfs_syscall */ > >> >> "sigprocmask", /* 340 = sigprocmask */ > >> >> "sigsuspend", /* 341 = sigsuspend */ > >> >> > >> >> Modified: head/sys/kern/syscalls.master > >> >> ============================================================================== > >> >> --- head/sys/kern/syscalls.master Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/kern/syscalls.master Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -738,7 +738,7 @@ > >> >> _Out_opt_ off_t *sbytes, int flags); } > >> >> 337 AUE_NULL STD { int kldsym(int fileid, int cmd, \ > >> >> _In_ void *data); } > >> >> -338 AUE_JAIL COMPAT11 { int jail( \ > >> >> +338 AUE_JAIL STD { int jail( \ > >> >> _In_ struct jail *jail); } > >> >> > >> >> 339 AUE_NULL NOSTD|NOTSTATIC { int nnpfs_syscall(int operation, \ > >> >> > >> >> Modified: head/sys/kern/systrace_args.c > >> >> ============================================================================== > >> >> --- head/sys/kern/systrace_args.c Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/kern/systrace_args.c Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -1593,6 +1593,13 @@ systrace_args(int sysnum, void *params, > >> >> uint64_t *uarg > >> >> *n_args = 3; > >> >> break; > >> >> } > >> >> + /* jail */ > >> >> + case 338: { > >> >> + struct jail_args *p = params; > >> >> + uarg[0] = (intptr_t) p->jail; /* struct jail * */ > >> >> + *n_args = 1; > >> >> + break; > >> >> + } > >> >> /* nnpfs_syscall */ > >> >> case 339: { > >> >> struct nnpfs_syscall_args *p = params; > >> >> @@ -5765,6 +5772,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, > >> >> char *d > >> >> break; > >> >> }; > >> >> break; > >> >> + /* jail */ > >> >> + case 338: > >> >> + switch(ndx) { > >> >> + case 0: > >> >> + p = "userland struct jail *"; > >> >> + break; > >> >> + default: > >> >> + break; > >> >> + }; > >> >> + break; > >> >> /* nnpfs_syscall */ > >> >> case 339: > >> >> switch(ndx) { > >> >> @@ -9627,6 +9644,11 @@ systrace_return_setargdesc(int sysnum, int ndx, > >> >> char * > >> >> break; > >> >> /* kldsym */ > >> >> case 337: > >> >> + if (ndx == 0 || ndx == 1) > >> >> + p = "int"; > >> >> + break; > >> >> + /* jail */ > >> >> + case 338: > >> >> if (ndx == 0 || ndx == 1) > >> >> p = "int"; > >> >> break; > >> >> > >> >> Modified: head/sys/sys/jail.h > >> >> ============================================================================== > >> >> --- head/sys/sys/jail.h Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/sys/jail.h Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -32,7 +32,6 @@ > >> >> #ifndef _SYS_JAIL_H_ > >> >> #define _SYS_JAIL_H_ > >> >> > >> >> -#ifdef COMPAT_FREEBSD11 > >> >> #ifdef _KERNEL > >> >> struct jail_v0 { > >> >> u_int32_t version; > >> >> @@ -58,6 +57,16 @@ struct jail { > >> >> * For all xprison structs, always keep the pr_version an int and > >> >> * the first variable so userspace can easily distinguish them. > >> >> */ > >> >> +#ifndef _KERNEL > >> >> +struct xprison_v1 { > >> >> + int pr_version; > >> >> + int pr_id; > >> >> + char pr_path[MAXPATHLEN]; > >> >> + char pr_host[MAXHOSTNAMELEN]; > >> >> + u_int32_t pr_ip; > >> >> +}; > >> >> +#endif > >> >> + > >> >> struct xprison { > >> >> int pr_version; > >> >> int pr_id; > >> >> @@ -82,7 +91,6 @@ struct xprison { > >> >> #define PRISON_STATE_INVALID 0 > >> >> #define PRISON_STATE_ALIVE 1 > >> >> #define PRISON_STATE_DYING 2 > >> >> -#endif /* COMPAT_FREEBSD11 */ > >> >> > >> >> /* > >> >> * Flags for jail_set and jail_get. > >> >> @@ -102,6 +110,7 @@ struct xprison { > >> >> > >> >> struct iovec; > >> >> > >> >> +int jail(struct jail *); > >> >> int jail_set(struct iovec *, unsigned int, int); > >> >> int jail_get(struct iovec *, unsigned int, int); > >> >> int jail_attach(int); > >> >> > >> >> Modified: head/sys/sys/syscall.h > >> >> ============================================================================== > >> >> --- head/sys/sys/syscall.h Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/sys/syscall.h Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -280,7 +280,7 @@ > >> >> #define SYS_utrace 335 > >> >> /* 336 is freebsd4 sendfile */ > >> >> #define SYS_kldsym 337 > >> >> -#define SYS_freebsd11_jail 338 > >> >> +#define SYS_jail 338 > >> >> #define SYS_nnpfs_syscall 339 > >> >> #define SYS_sigprocmask 340 > >> >> #define SYS_sigsuspend 341 > >> >> > >> >> Modified: head/sys/sys/syscall.mk > >> >> ============================================================================== > >> >> --- head/sys/sys/syscall.mk Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/sys/syscall.mk Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -209,7 +209,7 @@ MIASM = \ > >> >> sched_rr_get_interval.o \ > >> >> utrace.o \ > >> >> kldsym.o \ > >> >> - freebsd11_jail.o \ > >> >> + jail.o \ > >> >> nnpfs_syscall.o \ > >> >> sigprocmask.o \ > >> >> sigsuspend.o \ > >> >> > >> >> Modified: head/sys/sys/syscallsubr.h > >> >> ============================================================================== > >> >> --- head/sys/sys/syscallsubr.h Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/sys/syscallsubr.h Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -143,6 +143,7 @@ int kern_getsockname(struct thread *td, int fd, > >> >> struct > >> >> int kern_getsockopt(struct thread *td, int s, int level, int name, > >> >> void *optval, enum uio_seg valseg, socklen_t *valsize); > >> >> int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data); > >> >> +int kern_jail(struct thread *td, struct jail *j); > >> >> int kern_jail_get(struct thread *td, struct uio *options, int flags); > >> >> int kern_jail_set(struct thread *td, struct uio *options, int flags); > >> >> int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, > >> >> @@ -307,6 +308,5 @@ struct freebsd11_dirent; > >> >> > >> >> int freebsd11_kern_getdirentries(struct thread *td, int fd, char > >> >> *ubuf, u_int > >> >> count, long *basep, void (*func)(struct freebsd11_dirent *)); > >> >> -int freebsd11_kern_jail(struct thread *td, struct jail *j); > >> >> > >> >> #endif /* !_SYS_SYSCALLSUBR_H_ */ > >> >> > >> >> Modified: head/sys/sys/sysproto.h > >> >> ============================================================================== > >> >> --- head/sys/sys/sysproto.h Thu Aug 16 18:58:34 2018 (r337924) > >> >> +++ head/sys/sys/sysproto.h Thu Aug 16 19:09:43 2018 (r337925) > >> >> @@ -849,6 +849,9 @@ struct kldsym_args { > >> >> char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; > >> >> char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void > >> >> *)]; > >> >> }; > >> >> +struct jail_args { > >> >> + char jail_l_[PADL_(struct jail *)]; struct jail * jail; char > >> >> jail_r_[PADR_(struct jail *)]; > >> >> +}; > >> >> struct nnpfs_syscall_args { > >> >> char operation_l_[PADL_(int)]; int operation; char > >> >> operation_r_[PADR_(int)]; > >> >> char a_pathP_l_[PADL_(char *)]; char * a_pathP; char > >> >> a_pathP_r_[PADR_(char *)]; > >> >> @@ -1958,6 +1961,7 @@ int sys_sched_get_priority_min(struct thread *, > >> >> struct > >> >> int sys_sched_rr_get_interval(struct thread *, struct > >> >> sched_rr_get_interval_args *); > >> >> int sys_utrace(struct thread *, struct utrace_args *); > >> >> int sys_kldsym(struct thread *, struct kldsym_args *); > >> >> +int sys_jail(struct thread *, struct jail_args *); > >> >> int sys_nnpfs_syscall(struct thread *, struct nnpfs_syscall_args *); > >> >> int sys_sigprocmask(struct thread *, struct sigprocmask_args *); > >> >> int sys_sigsuspend(struct thread *, struct sigsuspend_args *); > >> >> @@ -2527,9 +2531,6 @@ struct freebsd11_fhstat_args { > >> >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * > >> >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; > >> >> char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * > >> >> sb; char sb_r_[PADR_(struct freebsd11_stat *)]; > >> >> }; > >> >> -struct freebsd11_jail_args { > >> >> - char jail_l_[PADL_(struct jail *)]; struct jail * jail; char > >> >> jail_r_[PADR_(struct jail *)]; > >> >> -}; > >> >> struct freebsd11_kevent_args { > >> >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; > >> >> char changelist_l_[PADL_(struct kevent_freebsd11 *)]; struct > >> >> kevent_freebsd11 * changelist; char changelist_r_[PADR_(struct > >> >> kevent_freebsd11 *)]; > >> >> @@ -2578,7 +2579,6 @@ int freebsd11_nstat(struct thread *, struct > >> >> freebsd11_ > >> >> int freebsd11_nfstat(struct thread *, struct freebsd11_nfstat_args > >> >> *); > >> >> int freebsd11_nlstat(struct thread *, struct freebsd11_nlstat_args > >> >> *); > >> >> int freebsd11_fhstat(struct thread *, struct freebsd11_fhstat_args > >> >> *); > >> >> -int freebsd11_jail(struct thread *, struct freebsd11_jail_args *); > >> >> int freebsd11_kevent(struct thread *, struct freebsd11_kevent_args > >> >> *); > >> >> int freebsd11_getfsstat(struct thread *, struct > >> >> freebsd11_getfsstat_args *); > >> >> int freebsd11_statfs(struct thread *, struct freebsd11_statfs_args > >> >> *); > >> >> @@ -2849,7 +2849,7 @@ int freebsd11_mknodat(struct thread *, struct > >> >> freebsd1 > >> >> #define SYS_AUE_utrace AUE_NULL > >> >> #define SYS_AUE_freebsd4_sendfile AUE_SENDFILE > >> >> #define SYS_AUE_kldsym AUE_NULL > >> >> -#define SYS_AUE_freebsd11_jail AUE_JAIL > >> >> +#define SYS_AUE_jail AUE_JAIL > >> >> #define SYS_AUE_nnpfs_syscall AUE_NULL > >> >> #define SYS_AUE_sigprocmask AUE_SIGPROCMASK > >> >> #define SYS_AUE_sigsuspend AUE_SIGSUSPEND > >> >> > >> >> > >> > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 16 20:01: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 62A7410754DA; Thu, 16 Aug 2018 20:01:32 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gritton.org", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DE40476F5D; Thu, 16 Aug 2018 20:01:31 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) by gritton.org (8.15.2/8.15.2) with ESMTP id w7GK1Uks058781; Thu, 16 Aug 2018 14:01:30 -0600 (MDT) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 16 Aug 2018 14:01:30 -0600 From: James Gritton To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337925 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys In-Reply-To: <201808161958.w7GJwnpl055610@pdx.rh.CN85.dnsmgr.net> References: <201808161958.w7GJwnpl055610@pdx.rh.CN85.dnsmgr.net> Message-ID: <140ab04c1c3856c633e12b98a50ef5c4@freebsd.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.3.6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 20:01:32 -0000 On 2018-08-16 13:58, Rodney W. Grimes wrote: >> On 2018-08-16 13:36, Rodney W. Grimes wrote: >> >> OK, so noted. But seeing as I've already done the partial in this >> >> case, >> >> what's best to do now? Should I add another commit to revert the >> >> so-far >> >> unreverted files? >> > >> > Thats a mixed bag, how many files is it, and what would the >> > commit message before for them? > be for them? > >> > >> > Usually these are seperable changes that should not of been combined >> > with the original commit. >> >> There are five files I didn't revert: two man pages, and two code >> files >> with a changed comment. The changes being the docs up to date, with >> or > bring? >> without the other deprecation changes, so at this point they're >> correct >> whether they're changed or not. >> >> The commit message would be something like: >> >> Revert the remainder of r337922 that I didn't revert in r337925, >> until >> such point as I re-commit the whole thing. > > I was more asking for what would the commit for this two man pages > and two code files look like? > > It sounds like these are standalone changes that should of probably > been done in there own commit anyway? Or are they some how integral > to r337922? > > I guess just leave it be for now, and try to avoid > these types of situations in the future. OK, I'll just stick with things as they are. My apologies for muddying the waters. >> >> - Jamie >> >> >> >> >> >> On 2018-08-16 13:27, Rodney W. Grimes wrote: >> >> >> Author: jamie >> >> >> Date: Thu Aug 16 19:09:43 2018 >> >> >> New Revision: 337925 >> >> >> URL: https://svnweb.freebsd.org/changeset/base/337925 >> >> >> >> >> >> Log: >> >> >> Revert r337922, except for some documention-only bits. This needs >> >> >> to wait >> >> >> until user is changed to stop using jail(2). >> >> > >> >> > Can we please stop doing "partial" reverts, it makes log >> >> > tracking and sorting out stuff later more difficult. >> >> > >> >> > If something is seperable and needs to stay it is best >> >> > to revert the whole commit, and then commit with a proper >> >> > log exactly what it is that you did not want to revert. >> >> > >> >> >> >> >> >> Differential Revision: D14791 >> >> >> >> >> >> Modified: >> >> >> head/lib/libc/sys/jail.2 >> >> >> head/sys/compat/freebsd32/freebsd32_misc.c >> >> >> head/sys/compat/freebsd32/freebsd32_proto.h >> >> >> head/sys/compat/freebsd32/freebsd32_syscall.h >> >> >> head/sys/compat/freebsd32/freebsd32_syscalls.c >> >> >> head/sys/compat/freebsd32/freebsd32_sysent.c >> >> >> head/sys/compat/freebsd32/freebsd32_systrace_args.c >> >> >> head/sys/compat/freebsd32/syscalls.master >> >> >> head/sys/kern/init_sysent.c >> >> >> head/sys/kern/kern_jail.c >> >> >> head/sys/kern/syscalls.c >> >> >> head/sys/kern/syscalls.master >> >> >> head/sys/kern/systrace_args.c >> >> >> head/sys/sys/jail.h >> >> >> head/sys/sys/syscall.h >> >> >> head/sys/sys/syscall.mk >> >> >> head/sys/sys/syscallsubr.h >> >> >> head/sys/sys/sysproto.h >> >> >> >> >> >> Modified: head/lib/libc/sys/jail.2 >> >> >> ============================================================================== >> >> >> --- head/lib/libc/sys/jail.2 Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/lib/libc/sys/jail.2 Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -25,10 +25,11 @@ >> >> >> .\" >> >> >> .\" $FreeBSD$ >> >> >> .\" >> >> >> -.Dd August 16, 2018 >> >> >> +.Dd February 8, 2012 >> >> >> .Dt JAIL 2 >> >> >> .Os >> >> >> .Sh NAME >> >> >> +.Nm jail , >> >> >> .Nm jail_get , >> >> >> .Nm jail_set , >> >> >> .Nm jail_remove , >> >> >> @@ -40,6 +41,8 @@ >> >> >> .In sys/param.h >> >> >> .In sys/jail.h >> >> >> .Ft int >> >> >> +.Fn jail "struct jail *jail" >> >> >> +.Ft int >> >> >> .Fn jail_attach "int jid" >> >> >> .Ft int >> >> >> .Fn jail_remove "int jid" >> >> >> @@ -50,7 +53,74 @@ >> >> >> .Fn jail_set "struct iovec *iov" "u_int niov" "int flags" >> >> >> .Sh DESCRIPTION >> >> >> The >> >> >> +.Fn jail >> >> >> +system call sets up a jail and locks the current process in it. >> >> >> +.Pp >> >> >> +The argument is a pointer to a structure describing the prison: >> >> >> +.Bd -literal -offset indent >> >> >> +struct jail { >> >> >> + uint32_t version; >> >> >> + char *path; >> >> >> + char *hostname; >> >> >> + char *jailname; >> >> >> + unsigned int ip4s; >> >> >> + unsigned int ip6s; >> >> >> + struct in_addr *ip4; >> >> >> + struct in6_addr *ip6; >> >> >> +}; >> >> >> +.Ed >> >> >> +.Pp >> >> >> +.Dq Li version >> >> >> +defines the version of the API in use. >> >> >> +.Dv JAIL_API_VERSION >> >> >> +is defined for the current version. >> >> >> +.Pp >> >> >> +The >> >> >> +.Dq Li path >> >> >> +pointer should be set to the directory which is to be the root of the >> >> >> +prison. >> >> >> +.Pp >> >> >> +The >> >> >> +.Dq Li hostname >> >> >> +pointer can be set to the hostname of the prison. >> >> >> +This can be changed >> >> >> +from the inside of the prison. >> >> >> +.Pp >> >> >> +The >> >> >> +.Dq Li jailname >> >> >> +pointer is an optional name that can be assigned to the jail >> >> >> +for example for management purposes. >> >> >> +.Pp >> >> >> +The >> >> >> +.Dq Li ip4s >> >> >> +and >> >> >> +.Dq Li ip6s >> >> >> +give the numbers of IPv4 and IPv6 addresses that will be passed >> >> >> +via their respective pointers. >> >> >> +.Pp >> >> >> +The >> >> >> +.Dq Li ip4 >> >> >> +and >> >> >> +.Dq Li ip6 >> >> >> +pointers can be set to an arrays of IPv4 and IPv6 addresses to be >> >> >> assigned to >> >> >> +the prison, or NULL if none. >> >> >> +IPv4 addresses must be in network byte order. >> >> >> +.Pp >> >> >> +This is equivalent to, and deprecated in favor of, the >> >> >> .Fn jail_set >> >> >> +system call (see below), with the parameters >> >> >> +.Va path , >> >> >> +.Va host.hostname , >> >> >> +.Va name , >> >> >> +.Va ip4.addr , >> >> >> +and >> >> >> +.Va ip6.addr , >> >> >> +and with the >> >> >> +.Dv JAIL_ATTACH >> >> >> +flag. >> >> >> +.Pp >> >> >> +The >> >> >> +.Fn jail_set >> >> >> system call creates a new jail, or modifies an existing one, and >> >> >> optionally >> >> >> locks the current process in it. >> >> >> Jail parameters are passed as an array of name-value pairs in the >> >> >> array >> >> >> @@ -76,19 +146,13 @@ The current set of available parameters, and >> >> >> their for >> >> >> retrieved via the >> >> >> .Va security.jail.param >> >> >> sysctl MIB entry. >> >> >> -Notable parameters include >> >> >> +Notable parameters include those mentioned in the >> >> >> +.Fn jail >> >> >> +description above, as well as >> >> >> .Va jid >> >> >> and >> >> >> -.Va name >> >> >> -which identify the jail being created or modified, >> >> >> -.Va path >> >> >> -(the root directory of the jail), >> >> >> -.Va host.hostname >> >> >> -(the hostname of the jail), and >> >> >> -.Va ip4.addr >> >> >> -and >> >> >> -.Va ip6.addr >> >> >> -(IP addresses to assign to the jail). >> >> >> +.Va name , >> >> >> +which identify the jail being created or modified. >> >> >> See >> >> >> .Xr jail 8 >> >> >> for more information on the core jail parameters. >> >> >> @@ -173,7 +237,8 @@ It will kill all processes belonging to the jail, >> >> >> and >> >> >> of that jail. >> >> >> .Sh RETURN VALUES >> >> >> If successful, >> >> >> -.Fn jail_set >> >> >> +.Fn jail , >> >> >> +.Fn jail_set , >> >> >> and >> >> >> .Fn jail_get >> >> >> return a non-negative integer, termed the jail identifier (JID). >> >> >> @@ -184,6 +249,25 @@ to indicate the error. >> >> >> .Rv -std jail_attach jail_remove >> >> >> .Sh ERRORS >> >> >> The >> >> >> +.Fn jail >> >> >> +system call >> >> >> +will fail if: >> >> >> +.Bl -tag -width Er >> >> >> +.It Bq Er EPERM >> >> >> +This process is not allowed to create a jail, either because it is >> >> >> not >> >> >> +the super-user, or because it would exceed the jail's >> >> >> +.Va children.max >> >> >> +limit. >> >> >> +.It Bq Er EFAULT >> >> >> +.Fa jail >> >> >> +points to an address outside the allocated address space of the >> >> >> process. >> >> >> +.It Bq Er EINVAL >> >> >> +The version number of the argument is not correct. >> >> >> +.It Bq Er EAGAIN >> >> >> +No free JID could be found. >> >> >> +.El >> >> >> +.Pp >> >> >> +The >> >> >> .Fn jail_set >> >> >> system call >> >> >> will fail if: >> >> >> @@ -287,7 +371,8 @@ does not exist. >> >> >> .El >> >> >> .Pp >> >> >> Further >> >> >> -.Fn jail_set >> >> >> +.Fn jail , >> >> >> +.Fn jail_set , >> >> >> and >> >> >> .Fn jail_attach >> >> >> call >> >> >> @@ -301,7 +386,7 @@ manual page for details. >> >> >> .Xr chroot 2 , >> >> >> .Xr jail 8 >> >> >> .Sh HISTORY >> >> >> -The now-deprecated >> >> >> +The >> >> >> .Fn jail >> >> >> system call appeared in >> >> >> .Fx 4.0 . >> >> >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_misc.c >> >> >> ============================================================================== >> >> >> --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 18:58:34 >> >> >> 2018 (r337924) >> >> >> +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 16 19:09:43 >> >> >> 2018 (r337925) >> >> >> @@ -2289,10 +2289,8 @@ freebsd32_sysctl(struct thread *td, struct >> >> >> freebsd32_s >> >> >> return (0); >> >> >> } >> >> >> >> >> >> -#ifdef COMPAT_FREEBSD11 >> >> >> int >> >> >> -freebsd11_freebsd32_jail(struct thread *td, >> >> >> - struct freebsd11_freebsd32_jail_args *uap) >> >> >> +freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) >> >> >> { >> >> >> uint32_t version; >> >> >> int error; >> >> >> @@ -2349,9 +2347,8 @@ freebsd11_freebsd32_jail(struct thread *td, >> >> >> /* Sci-Fi jails are not supported, sorry. */ >> >> >> return (EINVAL); >> >> >> } >> >> >> - return (freebsd11_kern_jail(td, &j)); >> >> >> + return (kern_jail(td, &j)); >> >> >> } >> >> >> -#endif /* COMPAT_FREEBSD11 */ >> >> >> >> >> >> int >> >> >> freebsd32_jail_set(struct thread *td, struct freebsd32_jail_set_args >> >> >> *uap) >> >> >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_proto.h >> >> >> ============================================================================== >> >> >> --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 18:58:34 >> >> >> 2018 (r337924) >> >> >> +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 16 19:09:43 >> >> >> 2018 (r337925) >> >> >> @@ -283,6 +283,9 @@ struct freebsd32_sched_rr_get_interval_args { >> >> >> char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; >> >> >> char interval_l_[PADL_(struct timespec32 *)]; struct timespec32 * >> >> >> interval; char interval_r_[PADR_(struct timespec32 *)]; >> >> >> }; >> >> >> +struct freebsd32_jail_args { >> >> >> + char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char >> >> >> jail_r_[PADR_(struct jail32 *)]; >> >> >> +}; >> >> >> struct freebsd32_sigtimedwait_args { >> >> >> char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char >> >> >> set_r_[PADR_(const sigset_t *)]; >> >> >> char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char >> >> >> info_r_[PADR_(siginfo_t *)]; >> >> >> @@ -758,6 +761,7 @@ int freebsd32_aio_return(struct thread *, struct >> >> >> freeb >> >> >> int freebsd32_aio_suspend(struct thread *, struct >> >> >> freebsd32_aio_suspend_args *); >> >> >> int freebsd32_aio_error(struct thread *, struct >> >> >> freebsd32_aio_error_args *); >> >> >> int freebsd32_sched_rr_get_interval(struct thread *, struct >> >> >> freebsd32_sched_rr_get_interval_args *); >> >> >> +int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); >> >> >> int freebsd32_sigtimedwait(struct thread *, struct >> >> >> freebsd32_sigtimedwait_args *); >> >> >> int freebsd32_sigwaitinfo(struct thread *, struct >> >> >> freebsd32_sigwaitinfo_args *); >> >> >> int freebsd32_aio_waitcomplete(struct thread *, struct >> >> >> freebsd32_aio_waitcomplete_args *); >> >> >> @@ -1180,9 +1184,6 @@ struct freebsd11_freebsd32_fhstat_args { >> >> >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * >> >> >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; >> >> >> char sb_l_[PADL_(struct freebsd11_stat32 *)]; struct >> >> >> freebsd11_stat32 * sb; char sb_r_[PADR_(struct freebsd11_stat32 *)]; >> >> >> }; >> >> >> -struct freebsd11_freebsd32_jail_args { >> >> >> - char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char >> >> >> jail_r_[PADR_(struct jail32 *)]; >> >> >> -}; >> >> >> struct freebsd11_freebsd32_kevent_args { >> >> >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; >> >> >> char changelist_l_[PADL_(const struct kevent32_freebsd11 *)]; const >> >> >> struct kevent32_freebsd11 * changelist; char changelist_r_[PADR_(const >> >> >> struct kevent32_freebsd11 *)]; >> >> >> @@ -1222,7 +1223,6 @@ int freebsd11_freebsd32_lstat(struct thread *, >> >> >> struct >> >> >> int freebsd11_freebsd32_getdirentries(struct thread *, struct >> >> >> freebsd11_freebsd32_getdirentries_args *); >> >> >> int freebsd11_freebsd32_getdents(struct thread *, struct >> >> >> freebsd11_freebsd32_getdents_args *); >> >> >> int freebsd11_freebsd32_fhstat(struct thread *, struct >> >> >> freebsd11_freebsd32_fhstat_args *); >> >> >> -int freebsd11_freebsd32_jail(struct thread *, struct >> >> >> freebsd11_freebsd32_jail_args *); >> >> >> int freebsd11_freebsd32_kevent(struct thread *, struct >> >> >> freebsd11_freebsd32_kevent_args *); >> >> >> int freebsd11_freebsd32_fstatat(struct thread *, struct >> >> >> freebsd11_freebsd32_fstatat_args *); >> >> >> int freebsd11_freebsd32_mknodat(struct thread *, struct >> >> >> freebsd11_freebsd32_mknodat_args *); >> >> >> @@ -1317,7 +1317,7 @@ int freebsd11_freebsd32_mknodat(struct thread *, >> >> >> struc >> >> >> >> >> >> #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_LIO_LISTIO >> >> >> #define FREEBSD32_SYS_AUE_freebsd32_sched_rr_get_interval AUE_NULL >> >> >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE >> >> >> -#define FREEBSD32_SYS_AUE_freebsd11_freebsd32_jail AUE_JAIL >> >> >> +#define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL >> >> >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION >> >> >> #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN >> >> >> #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT >> >> >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_syscall.h >> >> >> ============================================================================== >> >> >> --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 18:58:34 >> >> >> 2018 (r337924) >> >> >> +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 16 19:09:43 >> >> >> 2018 (r337925) >> >> >> @@ -275,7 +275,7 @@ >> >> >> #define FREEBSD32_SYS_utrace 335 >> >> >> /* 336 is freebsd4 freebsd32_sendfile */ >> >> >> #define FREEBSD32_SYS_kldsym 337 >> >> >> -#define FREEBSD32_SYS_freebsd11_freebsd32_jail 338 >> >> >> +#define FREEBSD32_SYS_freebsd32_jail 338 >> >> >> #define FREEBSD32_SYS_sigprocmask 340 >> >> >> #define FREEBSD32_SYS_sigsuspend 341 >> >> >> /* 342 is freebsd4 freebsd32_sigaction */ >> >> >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c >> >> >> ============================================================================== >> >> >> --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 18:58:34 >> >> >> 2018 (r337924) >> >> >> +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 16 19:09:43 >> >> >> 2018 (r337925) >> >> >> @@ -347,7 +347,7 @@ const char *freebsd32_syscallnames[] = { >> >> >> "utrace", /* 335 = utrace */ >> >> >> "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile >> >> >> */ >> >> >> "kldsym", /* 337 = kldsym */ >> >> >> - "compat11.freebsd32_jail", /* 338 = freebsd11 freebsd32_jail */ >> >> >> + "freebsd32_jail", /* 338 = freebsd32_jail */ >> >> >> "#339", /* 339 = pioctl */ >> >> >> "sigprocmask", /* 340 = sigprocmask */ >> >> >> "sigsuspend", /* 341 = sigsuspend */ >> >> >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_sysent.c >> >> >> ============================================================================== >> >> >> --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 18:58:34 >> >> >> 2018 (r337924) >> >> >> +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 16 19:09:43 >> >> >> 2018 (r337925) >> >> >> @@ -394,7 +394,7 @@ struct sysent freebsd32_sysent[] = { >> >> >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, >> >> >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ >> >> >> { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), >> >> >> AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = >> >> >> freebsd4 freebsd32_sendfile */ >> >> >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, >> >> >> SY_THR_STATIC }, /* 337 = kldsym */ >> >> >> - { compat11(AS(freebsd11_freebsd32_jail_args),freebsd32_jail), >> >> >> AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd11 >> >> >> freebsd32_jail */ >> >> >> + { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, >> >> >> NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd32_jail */ >> >> >> { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT >> >> >> }, /* 339 = pioctl */ >> >> >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, >> >> >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = >> >> >> sigprocmask */ >> >> >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, >> >> >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ >> >> >> >> >> >> Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c >> >> >> ============================================================================== >> >> >> --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 >> >> >> 18:58:34 2018 (r337924) >> >> >> +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 16 >> >> >> 19:09:43 2018 (r337925) >> >> >> @@ -1559,6 +1559,13 @@ systrace_args(int sysnum, void *params, >> >> >> uint64_t *uarg >> >> >> *n_args = 3; >> >> >> break; >> >> >> } >> >> >> + /* freebsd32_jail */ >> >> >> + case 338: { >> >> >> + struct freebsd32_jail_args *p = params; >> >> >> + uarg[0] = (intptr_t) p->jail; /* struct jail32 * */ >> >> >> + *n_args = 1; >> >> >> + break; >> >> >> + } >> >> >> /* sigprocmask */ >> >> >> case 340: { >> >> >> struct sigprocmask_args *p = params; >> >> >> @@ -5704,6 +5711,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, >> >> >> char *d >> >> >> break; >> >> >> }; >> >> >> break; >> >> >> + /* freebsd32_jail */ >> >> >> + case 338: >> >> >> + switch(ndx) { >> >> >> + case 0: >> >> >> + p = "userland struct jail32 *"; >> >> >> + break; >> >> >> + default: >> >> >> + break; >> >> >> + }; >> >> >> + break; >> >> >> /* sigprocmask */ >> >> >> case 340: >> >> >> switch(ndx) { >> >> >> @@ -9653,6 +9670,11 @@ systrace_return_setargdesc(int sysnum, int ndx, >> >> >> char * >> >> >> break; >> >> >> /* kldsym */ >> >> >> case 337: >> >> >> + if (ndx == 0 || ndx == 1) >> >> >> + p = "int"; >> >> >> + break; >> >> >> + /* freebsd32_jail */ >> >> >> + case 338: >> >> >> if (ndx == 0 || ndx == 1) >> >> >> p = "int"; >> >> >> break; >> >> >> >> >> >> Modified: head/sys/compat/freebsd32/syscalls.master >> >> >> ============================================================================== >> >> >> --- head/sys/compat/freebsd32/syscalls.master Thu Aug 16 18:58:34 >> >> >> 2018 (r337924) >> >> >> +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 16 19:09:43 >> >> >> 2018 (r337925) >> >> >> @@ -601,7 +601,7 @@ >> >> >> off_t *sbytes, int flags); } >> >> >> 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ >> >> >> void *data); } >> >> >> -338 AUE_JAIL COMPAT11 { int freebsd32_jail(struct jail32 *jail); } >> >> >> +338 AUE_JAIL STD { int freebsd32_jail(struct jail32 *jail); } >> >> >> 339 AUE_NULL UNIMPL pioctl >> >> >> 340 AUE_SIGPROCMASK NOPROTO { int sigprocmask(int how, \ >> >> >> const sigset_t *set, sigset_t *oset); } >> >> >> >> >> >> Modified: head/sys/kern/init_sysent.c >> >> >> ============================================================================== >> >> >> --- head/sys/kern/init_sysent.c Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/kern/init_sysent.c Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -387,7 +387,7 @@ struct sysent sysent[] = { >> >> >> { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, >> >> >> SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ >> >> >> { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, >> >> >> 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ >> >> >> { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, >> >> >> SY_THR_STATIC }, /* 337 = kldsym */ >> >> >> - { compat11(AS(freebsd11_jail_args),jail), AUE_JAIL, NULL, 0, 0, 0, >> >> >> SY_THR_STATIC }, /* 338 = freebsd11 jail */ >> >> >> + { AS(jail_args), (sy_call_t *)sys_jail, AUE_JAIL, NULL, 0, 0, 0, >> >> >> SY_THR_STATIC }, /* 338 = jail */ >> >> >> { AS(nnpfs_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, >> >> >> 0, 0, SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ >> >> >> { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, >> >> >> AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = >> >> >> sigprocmask */ >> >> >> { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, >> >> >> NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ >> >> >> >> >> >> Modified: head/sys/kern/kern_jail.c >> >> >> ============================================================================== >> >> >> --- head/sys/kern/kern_jail.c Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/kern/kern_jail.c Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -74,14 +74,6 @@ __FBSDID("$FreeBSD$"); >> >> >> >> >> >> #include >> >> >> >> >> >> -/* >> >> >> - * The old jail(2) interface will exist under COMPAT_FREEBSD11, but >> >> >> the global >> >> >> - * permission sysctls are slated to go away sometime (even with >> >> >> COMPAT). >> >> >> - */ >> >> >> -#if defined(COMPAT_FREEBSD11) && !defined(BURN_BRIDGES) >> >> >> -#define PR_GLOBAL_ALLOW >> >> >> -#endif >> >> >> - >> >> >> #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" >> >> >> >> >> >> MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); >> >> >> @@ -207,11 +199,9 @@ const size_t pr_flag_allow_size = >> >> >> sizeof(pr_flag_allow >> >> >> #define JAIL_DEFAULT_ALLOW (PR_ALLOW_SET_HOSTNAME | >> >> >> PR_ALLOW_RESERVED_PORTS) >> >> >> #define JAIL_DEFAULT_ENFORCE_STATFS 2 >> >> >> #define JAIL_DEFAULT_DEVFS_RSNUM 0 >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; >> >> >> static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; >> >> >> static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; >> >> >> -#endif >> >> >> #if defined(INET) || defined(INET6) >> >> >> static unsigned jail_max_af_ips = 255; >> >> >> #endif >> >> >> @@ -229,14 +219,13 @@ prison0_init(void) >> >> >> strlcpy(prison0.pr_osrelease, osrelease, >> >> >> sizeof(prison0.pr_osrelease)); >> >> >> } >> >> >> >> >> >> -#ifdef COMPAT_FREEBSD11 >> >> >> /* >> >> >> * struct jail_args { >> >> >> * struct jail *jail; >> >> >> * }; >> >> >> */ >> >> >> int >> >> >> -freebsd11_jail(struct thread *td, struct freebsd11_jail_args *uap) >> >> >> +sys_jail(struct thread *td, struct jail_args *uap) >> >> >> { >> >> >> uint32_t version; >> >> >> int error; >> >> >> @@ -281,16 +270,13 @@ freebsd11_jail(struct thread *td, struct >> >> >> freebsd11_jai >> >> >> /* Sci-Fi jails are not supported, sorry. */ >> >> >> return (EINVAL); >> >> >> } >> >> >> - return (freebsd11_kern_jail(td, &j)); >> >> >> + return (kern_jail(td, &j)); >> >> >> } >> >> >> >> >> >> int >> >> >> -freebsd11_kern_jail(struct thread *td, struct jail *j) >> >> >> +kern_jail(struct thread *td, struct jail *j) >> >> >> { >> >> >> - struct iovec optiov[2 * (3 >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> - + 1 + nitems(pr_flag_allow) >> >> >> -#endif >> >> >> + struct iovec optiov[2 * (4 + nitems(pr_flag_allow) >> >> >> #ifdef INET >> >> >> + 1 >> >> >> #endif >> >> >> @@ -300,10 +286,7 @@ freebsd11_kern_jail(struct thread *td, struct >> >> >> jail *j) >> >> >> )]; >> >> >> struct uio opt; >> >> >> char *u_path, *u_hostname, *u_name; >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> struct bool_flags *bf; >> >> >> - int enforce_statfs; >> >> >> -#endif >> >> >> #ifdef INET >> >> >> uint32_t ip4s; >> >> >> struct in_addr *u_ip4; >> >> >> @@ -312,7 +295,7 @@ freebsd11_kern_jail(struct thread *td, struct jail >> >> >> *j) >> >> >> struct in6_addr *u_ip6; >> >> >> #endif >> >> >> size_t tmplen; >> >> >> - int error; >> >> >> + int error, enforce_statfs; >> >> >> >> >> >> bzero(&optiov, sizeof(optiov)); >> >> >> opt.uio_iov = optiov; >> >> >> @@ -323,7 +306,6 @@ freebsd11_kern_jail(struct thread *td, struct jail >> >> >> *j) >> >> >> opt.uio_rw = UIO_READ; >> >> >> opt.uio_td = td; >> >> >> >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> /* Set permissions for top-level jails from sysctls. */ >> >> >> if (!jailed(td->td_ucred)) { >> >> >> for (bf = pr_flag_allow; >> >> >> @@ -345,7 +327,6 @@ freebsd11_kern_jail(struct thread *td, struct jail >> >> >> *j) >> >> >> optiov[opt.uio_iovcnt].iov_len = sizeof(enforce_statfs); >> >> >> opt.uio_iovcnt++; >> >> >> } >> >> >> -#endif >> >> >> >> >> >> tmplen = MAXPATHLEN + MAXHOSTNAMELEN + MAXHOSTNAMELEN; >> >> >> #ifdef INET >> >> >> @@ -449,7 +430,6 @@ freebsd11_kern_jail(struct thread *td, struct jail >> >> >> *j) >> >> >> free(u_path, M_TEMP); >> >> >> return (error); >> >> >> } >> >> >> -#endif /* COMPAT_FREEBSD11 */ >> >> >> >> >> >> >> >> >> /* >> >> >> @@ -1267,11 +1247,7 @@ kern_jail_set(struct thread *td, struct uio >> >> >> *optuio, i >> >> >> >> >> >> pr->pr_securelevel = ppr->pr_securelevel; >> >> >> pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> pr->pr_enforce_statfs = jail_default_enforce_statfs; >> >> >> -#else >> >> >> - pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; >> >> >> -#endif >> >> >> pr->pr_devfs_rsnum = ppr->pr_devfs_rsnum; >> >> >> >> >> >> pr->pr_osreldate = osreldt ? osreldt : ppr->pr_osreldate; >> >> >> @@ -3439,7 +3415,6 @@ prison_path(struct prison *pr1, struct prison >> >> >> *pr2) >> >> >> static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW, 0, >> >> >> "Jails"); >> >> >> >> >> >> -#ifdef COMPAT_FREEBSD11 >> >> >> static int >> >> >> sysctl_jail_list(SYSCTL_HANDLER_ARGS) >> >> >> { >> >> >> @@ -3543,7 +3518,6 @@ sysctl_jail_list(SYSCTL_HANDLER_ARGS) >> >> >> SYSCTL_OID(_security_jail, OID_AUTO, list, >> >> >> CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, >> >> >> sysctl_jail_list, "S", "List of active jails"); >> >> >> -#endif /* COMPAT_FREEBSD11 */ >> >> >> >> >> >> static int >> >> >> sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) >> >> >> @@ -3583,14 +3557,13 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vnet, >> >> >> #if defined(INET) || defined(INET6) >> >> >> SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, >> >> >> &jail_max_af_ips, 0, >> >> >> - "Number of IP addresses a jail may have at most per address >> >> >> family"); >> >> >> + "Number of IP addresses a jail may have at most per address >> >> >> family (deprecated)"); >> >> >> #endif >> >> >> >> >> >> /* >> >> >> - * Jail permissions - jailed processes can read these to find out >> >> >> what they are >> >> >> - * allowed to do. A deprecated use is to set default permissions for >> >> >> prisons >> >> >> - * created via jail(2). For historical reasons, the sysctl names >> >> >> have varying >> >> >> - * similarity to the parameter names. >> >> >> + * Default parameters for jail(2) compatibility. For historical >> >> >> reasons, >> >> >> + * the sysctl names have varying similarity to the parameter names. >> >> >> Prisons >> >> >> + * just see their own parameters, and can't change them. >> >> >> */ >> >> >> static int >> >> >> sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) >> >> >> @@ -3599,68 +3572,52 @@ sysctl_jail_default_allow(SYSCTL_HANDLER_ARGS) >> >> >> int allow, error, i; >> >> >> >> >> >> pr = req->td->td_ucred->cr_prison; >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> allow = (pr == &prison0) ? jail_default_allow : pr->pr_allow; >> >> >> -#else >> >> >> - allow = pr->pr_allow; >> >> >> -#endif >> >> >> >> >> >> /* Get the current flag value, and convert it to a boolean. */ >> >> >> i = (allow & arg2) ? 1 : 0; >> >> >> if (arg1 != NULL) >> >> >> i = !i; >> >> >> error = sysctl_handle_int(oidp, &i, 0, req); >> >> >> - if (error) >> >> >> + if (error || !req->newptr) >> >> >> return (error); >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> - if (req->newptr) { >> >> >> - i = i ? arg2 : 0; >> >> >> - if (arg1 != NULL) >> >> >> - i ^= arg2; >> >> >> - /* >> >> >> - * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 >> >> >> - * for writing. >> >> >> - */ >> >> >> - mtx_lock(&prison0.pr_mtx); >> >> >> - jail_default_allow = (jail_default_allow & ~arg2) | i; >> >> >> - mtx_unlock(&prison0.pr_mtx); >> >> >> - } >> >> >> -#endif >> >> >> + i = i ? arg2 : 0; >> >> >> + if (arg1 != NULL) >> >> >> + i ^= arg2; >> >> >> + /* >> >> >> + * The sysctls don't have CTLFLAGS_PRISON, so assume prison0 >> >> >> + * for writing. >> >> >> + */ >> >> >> + mtx_lock(&prison0.pr_mtx); >> >> >> + jail_default_allow = (jail_default_allow & ~arg2) | i; >> >> >> + mtx_unlock(&prison0.pr_mtx); >> >> >> return (0); >> >> >> } >> >> >> >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RW | CTLFLAG_MPSAFE) >> >> >> -#define ADDR_GLOBAL_ALLOW(i) &i >> >> >> -#else >> >> >> -#define CTLFLAG_GLOBAL_ALLOW (CTLFLAG_RD | CTLFLAG_MPSAFE) >> >> >> -#define ADDR_GLOBAL_ALLOW(i) NULL >> >> >> -#endif >> >> >> - >> >> >> SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, >> >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> >> NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", >> >> >> - "Processes in jail can set their hostnames"); >> >> >> + "Processes in jail can set their hostnames (deprecated)"); >> >> >> SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, >> >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> >> (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", >> >> >> - "Processes in jail are limited to creating UNIX/IP/route sockets >> >> >> only"); >> >> >> + "Processes in jail are limited to creating UNIX/IP/route sockets >> >> >> only (deprecated)"); >> >> >> SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, >> >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> >> NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", >> >> >> - "Processes in jail can use System V IPC primitives"); >> >> >> + "Processes in jail can use System V IPC primitives >> >> >> (deprecated)"); >> >> >> SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, >> >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> >> NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", >> >> >> - "Prison root can create raw sockets"); >> >> >> + "Prison root can create raw sockets (deprecated)"); >> >> >> SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, >> >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> >> NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", >> >> >> - "Processes in jail can alter system file flags"); >> >> >> + "Processes in jail can alter system file flags (deprecated)"); >> >> >> SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, >> >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> >> NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", >> >> >> - "Processes in jail can mount/unmount jail-friendly file >> >> >> systems"); >> >> >> + "Processes in jail can mount/unmount jail-friendly file systems >> >> >> (deprecated)"); >> >> >> >> >> >> static int >> >> >> sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) >> >> >> @@ -3669,33 +3626,25 @@ sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) >> >> >> int level, error; >> >> >> >> >> >> pr = req->td->td_ucred->cr_prison; >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> level = (pr == &prison0) ? *(int *)arg1 : *(int *)((char *)pr + >> >> >> arg2); >> >> >> -#else >> >> >> - level = *(int *)((char *)pr + arg2); >> >> >> -#endif >> >> >> error = sysctl_handle_int(oidp, &level, 0, req); >> >> >> - if (error) >> >> >> + if (error || !req->newptr) >> >> >> return (error); >> >> >> -#ifdef PR_GLOBAL_ALLOW >> >> >> - if (req->newptr) >> >> >> - *(int *)arg1 = level; >> >> >> -#endif >> >> >> + *(int *)arg1 = level; >> >> >> return (0); >> >> >> } >> >> >> >> >> >> SYSCTL_PROC(_security_jail, OID_AUTO, enforce_statfs, >> >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> >> - ADDR_GLOBAL_ALLOW(jail_default_enforce_statfs), >> >> >> - offsetof(struct prison, pr_enforce_statfs), >> >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, >> >> >> + &jail_default_enforce_statfs, offsetof(struct prison, >> >> >> pr_enforce_statfs), >> >> >> sysctl_jail_default_level, "I", >> >> >> - "Processes in jail cannot see all mounted file systems"); >> >> >> + "Processes in jail cannot see all mounted file systems >> >> >> (deprecated)"); >> >> >> + >> >> >> SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, >> >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, >> >> >> - ADDR_GLOBAL_ALLOW(jail_default_devfs_rsnum), >> >> >> - offsetof(struct prison, pr_devfs_rsnum), >> >> >> + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, >> >> >> + &jail_default_devfs_rsnum, offsetof(struct prison, >> >> >> pr_devfs_rsnum), >> >> >> sysctl_jail_default_level, "I", >> >> >> - "Ruleset for the devfs filesystem in jail"); >> >> >> + "Ruleset for the devfs filesystem in jail (deprecated)"); >> >> >> >> >> >> /* >> >> >> * Nodes to describe jail parameters. Maximum length of string >> >> >> parameters >> >> >> @@ -3836,6 +3785,9 @@ prison_add_allow(const char *prefix, const char >> >> >> *name, >> >> >> struct bool_flags *bf; >> >> >> struct sysctl_oid *parent; >> >> >> char *allow_name, *allow_noname, *allowed; >> >> >> +#ifndef NO_SYSCTL_DESCR >> >> >> + char *descr_deprecated; >> >> >> +#endif >> >> >> unsigned allow_flag; >> >> >> >> >> >> if (prefix >> >> >> @@ -3892,7 +3844,10 @@ prison_add_allow(const char *prefix, const char >> >> >> *name, >> >> >> bf->flag = allow_flag; >> >> >> mtx_unlock(&prison0.pr_mtx); >> >> >> >> >> >> - /* Create sysctls for the paramter, and the current permission. */ >> >> >> + /* >> >> >> + * Create sysctls for the paramter, and the back-compat global >> >> >> + * permission. >> >> >> + */ >> >> >> parent = prefix >> >> >> ? SYSCTL_ADD_NODE(NULL, >> >> >> SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), >> >> >> @@ -3904,10 +3859,17 @@ prison_add_allow(const char *prefix, const >> >> >> char *name, >> >> >> if ((prefix >> >> >> ? asprintf(&allowed, M_TEMP, "%s_%s_allowed", prefix, name) >> >> >> : asprintf(&allowed, M_TEMP, "%s_allowed", name)) >= 0) { >> >> >> +#ifndef NO_SYSCTL_DESCR >> >> >> + (void)asprintf(&descr_deprecated, M_TEMP, "%s (deprecated)", >> >> >> + descr); >> >> >> +#endif >> >> >> (void)SYSCTL_ADD_PROC(NULL, >> >> >> SYSCTL_CHILDREN(&sysctl___security_jail), OID_AUTO, allowed, >> >> >> - CTLTYPE_INT | CTLFLAG_GLOBAL_ALLOW, NULL, allow_flag, >> >> >> - sysctl_jail_default_allow, "I", descr); >> >> >> + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, allow_flag, >> >> >> + sysctl_jail_default_allow, "I", descr_deprecated); >> >> >> +#ifndef NO_SYSCTL_DESCR >> >> >> + free(descr_deprecated, M_TEMP); >> >> >> +#endif >> >> >> free(allowed, M_TEMP); >> >> >> } >> >> >> return allow_flag; >> >> >> >> >> >> Modified: head/sys/kern/syscalls.c >> >> >> ============================================================================== >> >> >> --- head/sys/kern/syscalls.c Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/kern/syscalls.c Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -344,7 +344,7 @@ const char *syscallnames[] = { >> >> >> "utrace", /* 335 = utrace */ >> >> >> "compat4.sendfile", /* 336 = freebsd4 sendfile */ >> >> >> "kldsym", /* 337 = kldsym */ >> >> >> - "compat11.jail", /* 338 = freebsd11 jail */ >> >> >> + "jail", /* 338 = jail */ >> >> >> "nnpfs_syscall", /* 339 = nnpfs_syscall */ >> >> >> "sigprocmask", /* 340 = sigprocmask */ >> >> >> "sigsuspend", /* 341 = sigsuspend */ >> >> >> >> >> >> Modified: head/sys/kern/syscalls.master >> >> >> ============================================================================== >> >> >> --- head/sys/kern/syscalls.master Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/kern/syscalls.master Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -738,7 +738,7 @@ >> >> >> _Out_opt_ off_t *sbytes, int flags); } >> >> >> 337 AUE_NULL STD { int kldsym(int fileid, int cmd, \ >> >> >> _In_ void *data); } >> >> >> -338 AUE_JAIL COMPAT11 { int jail( \ >> >> >> +338 AUE_JAIL STD { int jail( \ >> >> >> _In_ struct jail *jail); } >> >> >> >> >> >> 339 AUE_NULL NOSTD|NOTSTATIC { int nnpfs_syscall(int operation, \ >> >> >> >> >> >> Modified: head/sys/kern/systrace_args.c >> >> >> ============================================================================== >> >> >> --- head/sys/kern/systrace_args.c Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/kern/systrace_args.c Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -1593,6 +1593,13 @@ systrace_args(int sysnum, void *params, >> >> >> uint64_t *uarg >> >> >> *n_args = 3; >> >> >> break; >> >> >> } >> >> >> + /* jail */ >> >> >> + case 338: { >> >> >> + struct jail_args *p = params; >> >> >> + uarg[0] = (intptr_t) p->jail; /* struct jail * */ >> >> >> + *n_args = 1; >> >> >> + break; >> >> >> + } >> >> >> /* nnpfs_syscall */ >> >> >> case 339: { >> >> >> struct nnpfs_syscall_args *p = params; >> >> >> @@ -5765,6 +5772,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, >> >> >> char *d >> >> >> break; >> >> >> }; >> >> >> break; >> >> >> + /* jail */ >> >> >> + case 338: >> >> >> + switch(ndx) { >> >> >> + case 0: >> >> >> + p = "userland struct jail *"; >> >> >> + break; >> >> >> + default: >> >> >> + break; >> >> >> + }; >> >> >> + break; >> >> >> /* nnpfs_syscall */ >> >> >> case 339: >> >> >> switch(ndx) { >> >> >> @@ -9627,6 +9644,11 @@ systrace_return_setargdesc(int sysnum, int ndx, >> >> >> char * >> >> >> break; >> >> >> /* kldsym */ >> >> >> case 337: >> >> >> + if (ndx == 0 || ndx == 1) >> >> >> + p = "int"; >> >> >> + break; >> >> >> + /* jail */ >> >> >> + case 338: >> >> >> if (ndx == 0 || ndx == 1) >> >> >> p = "int"; >> >> >> break; >> >> >> >> >> >> Modified: head/sys/sys/jail.h >> >> >> ============================================================================== >> >> >> --- head/sys/sys/jail.h Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/sys/jail.h Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -32,7 +32,6 @@ >> >> >> #ifndef _SYS_JAIL_H_ >> >> >> #define _SYS_JAIL_H_ >> >> >> >> >> >> -#ifdef COMPAT_FREEBSD11 >> >> >> #ifdef _KERNEL >> >> >> struct jail_v0 { >> >> >> u_int32_t version; >> >> >> @@ -58,6 +57,16 @@ struct jail { >> >> >> * For all xprison structs, always keep the pr_version an int and >> >> >> * the first variable so userspace can easily distinguish them. >> >> >> */ >> >> >> +#ifndef _KERNEL >> >> >> +struct xprison_v1 { >> >> >> + int pr_version; >> >> >> + int pr_id; >> >> >> + char pr_path[MAXPATHLEN]; >> >> >> + char pr_host[MAXHOSTNAMELEN]; >> >> >> + u_int32_t pr_ip; >> >> >> +}; >> >> >> +#endif >> >> >> + >> >> >> struct xprison { >> >> >> int pr_version; >> >> >> int pr_id; >> >> >> @@ -82,7 +91,6 @@ struct xprison { >> >> >> #define PRISON_STATE_INVALID 0 >> >> >> #define PRISON_STATE_ALIVE 1 >> >> >> #define PRISON_STATE_DYING 2 >> >> >> -#endif /* COMPAT_FREEBSD11 */ >> >> >> >> >> >> /* >> >> >> * Flags for jail_set and jail_get. >> >> >> @@ -102,6 +110,7 @@ struct xprison { >> >> >> >> >> >> struct iovec; >> >> >> >> >> >> +int jail(struct jail *); >> >> >> int jail_set(struct iovec *, unsigned int, int); >> >> >> int jail_get(struct iovec *, unsigned int, int); >> >> >> int jail_attach(int); >> >> >> >> >> >> Modified: head/sys/sys/syscall.h >> >> >> ============================================================================== >> >> >> --- head/sys/sys/syscall.h Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/sys/syscall.h Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -280,7 +280,7 @@ >> >> >> #define SYS_utrace 335 >> >> >> /* 336 is freebsd4 sendfile */ >> >> >> #define SYS_kldsym 337 >> >> >> -#define SYS_freebsd11_jail 338 >> >> >> +#define SYS_jail 338 >> >> >> #define SYS_nnpfs_syscall 339 >> >> >> #define SYS_sigprocmask 340 >> >> >> #define SYS_sigsuspend 341 >> >> >> >> >> >> Modified: head/sys/sys/syscall.mk >> >> >> ============================================================================== >> >> >> --- head/sys/sys/syscall.mk Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/sys/syscall.mk Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -209,7 +209,7 @@ MIASM = \ >> >> >> sched_rr_get_interval.o \ >> >> >> utrace.o \ >> >> >> kldsym.o \ >> >> >> - freebsd11_jail.o \ >> >> >> + jail.o \ >> >> >> nnpfs_syscall.o \ >> >> >> sigprocmask.o \ >> >> >> sigsuspend.o \ >> >> >> >> >> >> Modified: head/sys/sys/syscallsubr.h >> >> >> ============================================================================== >> >> >> --- head/sys/sys/syscallsubr.h Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/sys/syscallsubr.h Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -143,6 +143,7 @@ int kern_getsockname(struct thread *td, int fd, >> >> >> struct >> >> >> int kern_getsockopt(struct thread *td, int s, int level, int name, >> >> >> void *optval, enum uio_seg valseg, socklen_t *valsize); >> >> >> int kern_ioctl(struct thread *td, int fd, u_long com, caddr_t data); >> >> >> +int kern_jail(struct thread *td, struct jail *j); >> >> >> int kern_jail_get(struct thread *td, struct uio *options, int flags); >> >> >> int kern_jail_set(struct thread *td, struct uio *options, int flags); >> >> >> int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, >> >> >> @@ -307,6 +308,5 @@ struct freebsd11_dirent; >> >> >> >> >> >> int freebsd11_kern_getdirentries(struct thread *td, int fd, char >> >> >> *ubuf, u_int >> >> >> count, long *basep, void (*func)(struct freebsd11_dirent *)); >> >> >> -int freebsd11_kern_jail(struct thread *td, struct jail *j); >> >> >> >> >> >> #endif /* !_SYS_SYSCALLSUBR_H_ */ >> >> >> >> >> >> Modified: head/sys/sys/sysproto.h >> >> >> ============================================================================== >> >> >> --- head/sys/sys/sysproto.h Thu Aug 16 18:58:34 2018 (r337924) >> >> >> +++ head/sys/sys/sysproto.h Thu Aug 16 19:09:43 2018 (r337925) >> >> >> @@ -849,6 +849,9 @@ struct kldsym_args { >> >> >> char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; >> >> >> char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void >> >> >> *)]; >> >> >> }; >> >> >> +struct jail_args { >> >> >> + char jail_l_[PADL_(struct jail *)]; struct jail * jail; char >> >> >> jail_r_[PADR_(struct jail *)]; >> >> >> +}; >> >> >> struct nnpfs_syscall_args { >> >> >> char operation_l_[PADL_(int)]; int operation; char >> >> >> operation_r_[PADR_(int)]; >> >> >> char a_pathP_l_[PADL_(char *)]; char * a_pathP; char >> >> >> a_pathP_r_[PADR_(char *)]; >> >> >> @@ -1958,6 +1961,7 @@ int sys_sched_get_priority_min(struct thread *, >> >> >> struct >> >> >> int sys_sched_rr_get_interval(struct thread *, struct >> >> >> sched_rr_get_interval_args *); >> >> >> int sys_utrace(struct thread *, struct utrace_args *); >> >> >> int sys_kldsym(struct thread *, struct kldsym_args *); >> >> >> +int sys_jail(struct thread *, struct jail_args *); >> >> >> int sys_nnpfs_syscall(struct thread *, struct nnpfs_syscall_args *); >> >> >> int sys_sigprocmask(struct thread *, struct sigprocmask_args *); >> >> >> int sys_sigsuspend(struct thread *, struct sigsuspend_args *); >> >> >> @@ -2527,9 +2531,6 @@ struct freebsd11_fhstat_args { >> >> >> char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * >> >> >> u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; >> >> >> char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * >> >> >> sb; char sb_r_[PADR_(struct freebsd11_stat *)]; >> >> >> }; >> >> >> -struct freebsd11_jail_args { >> >> >> - char jail_l_[PADL_(struct jail *)]; struct jail * jail; char >> >> >> jail_r_[PADR_(struct jail *)]; >> >> >> -}; >> >> >> struct freebsd11_kevent_args { >> >> >> char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; >> >> >> char changelist_l_[PADL_(struct kevent_freebsd11 *)]; struct >> >> >> kevent_freebsd11 * changelist; char changelist_r_[PADR_(struct >> >> >> kevent_freebsd11 *)]; >> >> >> @@ -2578,7 +2579,6 @@ int freebsd11_nstat(struct thread *, struct >> >> >> freebsd11_ >> >> >> int freebsd11_nfstat(struct thread *, struct freebsd11_nfstat_args >> >> >> *); >> >> >> int freebsd11_nlstat(struct thread *, struct freebsd11_nlstat_args >> >> >> *); >> >> >> int freebsd11_fhstat(struct thread *, struct freebsd11_fhstat_args >> >> >> *); >> >> >> -int freebsd11_jail(struct thread *, struct freebsd11_jail_args *); >> >> >> int freebsd11_kevent(struct thread *, struct freebsd11_kevent_args >> >> >> *); >> >> >> int freebsd11_getfsstat(struct thread *, struct >> >> >> freebsd11_getfsstat_args *); >> >> >> int freebsd11_statfs(struct thread *, struct freebsd11_statfs_args >> >> >> *); >> >> >> @@ -2849,7 +2849,7 @@ int freebsd11_mknodat(struct thread *, struct >> >> >> freebsd1 >> >> >> #define SYS_AUE_utrace AUE_NULL >> >> >> #define SYS_AUE_freebsd4_sendfile AUE_SENDFILE >> >> >> #define SYS_AUE_kldsym AUE_NULL >> >> >> -#define SYS_AUE_freebsd11_jail AUE_JAIL >> >> >> +#define SYS_AUE_jail AUE_JAIL >> >> >> #define SYS_AUE_nnpfs_syscall AUE_NULL >> >> >> #define SYS_AUE_sigprocmask AUE_SIGPROCMASK >> >> >> #define SYS_AUE_sigsuspend AUE_SIGSUSPEND >> >> >> >> >> >> >> >> >> From owner-svn-src-all@freebsd.org Thu Aug 16 20:04:28 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 678011075686; Thu, 16 Aug 2018 20:04:28 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FAD2772B0; Thu, 16 Aug 2018 20:04:28 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.133.74] (unknown [12.202.168.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 865D020371; Thu, 16 Aug 2018 20:04:27 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.10.0.180812 Date: Thu, 16 Aug 2018 13:04:24 -0700 Subject: Re: svn commit: r337928 - head/secure/usr.sbin/sshd From: Ravi Pokala To: Bryan Drewery , , , Message-ID: Thread-Topic: svn commit: r337928 - head/secure/usr.sbin/sshd References: <201808161948.w7GJm7ZM081006@repo.freebsd.org> In-Reply-To: <201808161948.w7GJm7ZM081006@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 20:04:28 -0000 My amd64 buildworld with this change just completed. Thanks Bryan! -Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Bryan Drewery Date: 2018-08-16, Thursday at 12:48 To: , , Subject: svn commit: r337928 - head/secure/usr.sbin/sshd Author: bdrewery Date: Thu Aug 16 19:48:07 2018 New Revision: 337928 URL: https://svnweb.freebsd.org/changeset/base/337928 Log: Fix build after r337852: Don't rebuild moduli based on unrelated moduli.c =20 Reported by: many, delphij (moduli.c issue) Modified: head/secure/usr.sbin/sshd/Makefile Modified: head/secure/usr.sbin/sshd/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/secure/usr.sbin/sshd/Makefile Thu Aug 16 19:39:02 2018 (r337927) +++ head/secure/usr.sbin/sshd/Makefile Thu Aug 16 19:48:07 2018 (r337928) @@ -28,6 +28,9 @@ MAN=3D sshd.8 sshd_config.5 CFLAGS+=3D-I${SSHDIR} -include ssh_namespace.h SRCS+=3D ssh_namespace.h =20 +# Don't rebuild based on moduli.c +moduli: .MADE + # pam should always happen before ssh here for static linking LIBADD=3D pam ssh util =20 From owner-svn-src-all@freebsd.org Thu Aug 16 20:24: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 8828F1075DB1; Thu, 16 Aug 2018 20:24:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27EAA77E07; Thu, 16 Aug 2018 20:24:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id EC486A93B; Thu, 16 Aug 2018 20:24:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id C1D7114B6; Thu, 16 Aug 2018 20:24:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id emnePfT5JowW; Thu, 16 Aug 2018 20:24:49 +0000 (UTC) Subject: Re: svn commit: r336640 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 5A32914AB To: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807231611.w6NGB3gh074167@repo.freebsd.org> From: Bryan Drewery Openpgp: preference=signencrypt Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8FAlJp hmsCGwwFCQlmAYAACgkQNddxu25Gl89UPggA2mGQp28yCUKsJ6KHFVy/lpHfoQrKF+s7HfKT U2ObVeVNX4I8ZdW1UO48mRqxEOwY8r5YSH6X06OmiqCX2aSMXg3N06/l+ztlB0+UGGlkXBjv l9/nii+bC6b8XWuu0X7Qpb9oYBK9YtoaoyuVplAmjdj/cPou65meKIaS1yDTjHh450DrW8Qg he6l0bFX4BHKTSm99U90ML7EY19B6iI2BZSqWutVsyD71oAREY6NGgDpCOIO6FS41+WeYCDR j8vsa/BiaoX2d2SBDsCwsEwe9fg5PYMi2uVIhvL6OrxnwOdB+TkgvOy5zZSNO29UG/JilZKo Ndz2wpEaUzChGGqLvcLAZQQYAQoADwIbDAUCWujOKAUJCmB7PQAKCRA113G7bkaXz6bkB/9H dUR3E0wBwMh6z0AOFDKh+PbRI9Xd4IncdhE55tNK410650a3gADIDwqz3i72GIinkgaxzpEO xP1bs7a+BeF3p5Xd6Jjk6J/nEshisgNW7VjUbJHFGs8Sf9A6oM3q4VkI/ArVo5qkZxgKs72U HSAy5NV+AdqdTrWuAL20xfQ6gA7JF35Xf8zyUM2GMl0X8ik7dJ1jMp+TB27LipqbDgamFzH9 F9hC9gur94OQ/x3nQ+mFZ1uipYHA1EdrKuhb/Ts4bN/Ezl8nmYGxc9Bw7ZBxGOTId/rEIzoe LWpAvg6dcw0T9lNfSWc6PX+kf3dOXNIdkw9NqKID8wEPe8axcGYG Organization: FreeBSD Message-ID: Date: Thu, 16 Aug 2018 13:24:47 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201807231611.w6NGB3gh074167@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KduTnJGRCWEwr7hH5nfo84qwG8dx6VjbZ" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 20:24:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KduTnJGRCWEwr7hH5nfo84qwG8dx6VjbZ Content-Type: multipart/mixed; boundary="IVYJyTY8k4llANE66BtufUmZ92wWFXMfA"; protected-headers="v1" From: Bryan Drewery To: Brad Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r336640 - head/share/mk References: <201807231611.w6NGB3gh074167@repo.freebsd.org> In-Reply-To: <201807231611.w6NGB3gh074167@repo.freebsd.org> --IVYJyTY8k4llANE66BtufUmZ92wWFXMfA Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/23/18 9:11 AM, Brad Davis wrote: > Author: brd > Date: Mon Jul 23 16:11:03 2018 > New Revision: 336640 > URL: https://svnweb.freebsd.org/changeset/base/336640 >=20 > Log: > Add the initial DIRS infrastructure for creating directories with the= > necessary owner, group, mode and flags. > =20 > Approved by: bapt (mentor) > Differential Revision: https://reviews.freebsd.org/D16405 >=20 > Added: > head/share/mk/bsd.dirs.mk (contents, props changed) > Modified: > head/share/mk/bsd.README >=20 > Modified: head/share/mk/bsd.README > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/mk/bsd.README Mon Jul 23 15:36:55 2018 (r336639) > +++ head/share/mk/bsd.README Mon Jul 23 16:11:03 2018 (r336640) > @@ -22,6 +22,7 @@ bsd.confs.mk - install of configuration files > bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) > bsd.crunchgen.mk - building crunched binaries using crunchgen(1) > bsd.dep.mk - handle Makefile dependencies > +bsd.dirs.mk - handle directory creation > bsd.doc.mk - building troff system documents > bsd.endian.mk - TARGET_ENDIAN=3D1234(little) or 4321 (big) for target= > bsd.files.mk - install of general purpose files > @@ -291,6 +292,18 @@ CFLAGS Flags to the compiler when creating C obje= cts. > CLEANDIRS Additional files (CLEANFILES) and directories (CLEANDIRS) to= > CLEANFILES remove during clean and cleandir targets. "rm -rf" and > "rm -f" are used, respectively. > + > +DIRS A list of variables referring to directories. For example: > + > + DIRS+=3D FOO > + FOO=3D /usr/share/foo > + > + Owner, Group, Mode and Flags are handled by FOO_OWN, > + FOO_GRP, FOO_MODE and FOO_FLAGS, respectively. > + > + This allows FILESDIR to be set to FOO, and the directory > + will be created before the files are installed and the > + dependencies will be set correctly. > =20 > DPADD Additional dependencies for the program. Usually used for > libraries. For example, to depend on the compatibility and >=20 > Added: head/share/mk/bsd.dirs.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/mk/bsd.dirs.mk Mon Jul 23 16:11:03 2018 (r336640) > @@ -0,0 +1,42 @@ > +# $FreeBSD$ > +# > +# Directory permissions management. > + > +.if !target(____) > +____: > +# List of directory variable names to install. Each variable name's v= alue > +# must be a full path. If non-default permissions are desired, _= MODE, > +# _OWN, and _GRP may be specified. > +DIRS?=3D > + > +. for dir in ${DIRS:O:u} > +. if defined(${dir}) && !empty(${dir}) > +# Set default permissions for a directory > +${dir}_MODE?=3D 0755 > +${dir}_OWN?=3D root > +${dir}_GRP?=3D wheel > +. if defined(${dir}_FLAGS) && !empty(${dir}_FLAGS) > +${dir}_FLAG=3D -f ${${dir}_FLAGS} > +. endif > + > +. if defined(NO_ROOT) > +. if !defined(${dir}TAGS) || ! ${${dir}TAGS:Mpackage=3D*} > +${dir}TAGS+=3D package=3D${${dir}PACKAGE:Uruntime} > +. endif > +${dir}TAG_ARGS=3D -T ${${dir}TAGS:[*]:S/ /,/g} > +. endif > + > +installdirs: installdirs-${dir} > + > +installdirs-${dir}: ${DESTDIR}${${dir}} > + > +${DESTDIR}${${dir}}: > + @${ECHO} installing DIRS ${dir} This echo is funky. Seems like it wanted to display the actual dirname rather than the internal variable name for it, but it's also just not needed since there's an INSTALL on the next line that shows. > ~/git/freebsd/secure/usr.sbin/sshd # make install DESTDIR=3D/tmp/blah > install -s -o root -g wheel -m 555 sshd /tmp/blah/usr/sbin/sshd > install -o root -g wheel -m 444 sshd.debug /tmp/blah/usr/lib/debug/us= r/sbin/sshd.debug > installing DIRS CONFSDIR > install -d -m 0755 -o root -g wheel /tmp/blah/etc/ssh > install -o root -g wheel -m 444 sshd.8.gz /tmp/blah/usr/share/man/man= 8/ > install -o root -g wheel -m 444 sshd_config.5.gz /tmp/blah/usr/share/= man/man5/ =2E.. > + ${INSTALL} ${${dir}TAG_ARGS} -d -m ${${dir}_MODE} -o ${${dir}_OWN} \ > + -g ${${dir}_GRP} ${${dir}_FLAG} ${DESTDIR}${${dir}} > +. endif > + > +realinstall: installdirs-${dir} > +. endfor > + > +.endif >=20 --=20 Regards, Bryan Drewery --IVYJyTY8k4llANE66BtufUmZ92wWFXMfA-- --KduTnJGRCWEwr7hH5nfo84qwG8dx6VjbZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlt13ZAACgkQNddxu25G l8+DJQgAqirYnH6fP2E9P32S/kmCEI+c/LgroaUcYKL132K7uiD5Te+2ECCSY37c Jc7MHy2IIc3HT9BOIEYRVpihuz1BVgYd4SQdqB5BYIjkiK8EMMIqbLKSkH9tQuxQ L7qFNKsAcbTf25cfFKbs/7FGtZn0TGtM0vrj/VAJAteNYYgHQ4grlqPQmRukF2Mj 0KDg69TBZ4Chzp1M4EckRZ7kJ/Xyp+I/KGtf4KQlBVL6ZPCmhvhMuu8yRLb5vCxD IXRvlvC0J0yTetT8AjPw5p4q62+JAmMzBHzmtuOtRID8e+EUCwXr2YdbjwPOvJSy wVLiTEbzJT2mr+UIDzagQNhIO77Bmw== =JA/6 -----END PGP SIGNATURE----- --KduTnJGRCWEwr7hH5nfo84qwG8dx6VjbZ-- From owner-svn-src-all@freebsd.org Thu Aug 16 20:58: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 59F6B1076B4B for ; Thu, 16 Aug 2018 20:58:51 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE713795BC for ; Thu, 16 Aug 2018 20:58:50 +0000 (UTC) (envelope-from joerg@bec.de) X-Originating-IP: 93.205.160.47 Received: from britannica.bec.de (p5DCDA02F.dip0.t-ipconnect.de [93.205.160.47]) (Authenticated sender: joerg@bec.de) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id B79D8240005 for ; Thu, 16 Aug 2018 20:58:42 +0000 (UTC) Date: Thu, 16 Aug 2018 22:58:41 +0200 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Subject: Re: svn commit: r337921 - head/lib/libbe Message-ID: <20180816205840.GA20821@britannica.bec.de> References: <201808161837.w7GIbmLi044921@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201808161837.w7GIbmLi044921@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 20:58:51 -0000 On Thu, Aug 16, 2018 at 06:37:48PM +0000, Kyle Evans wrote: > Author: kevans > Date: Thu Aug 16 18:37:47 2018 > New Revision: 337921 > URL: https://svnweb.freebsd.org/changeset/base/337921 > > Log: > libbe(3): Prefer safer versions of strcat/strcpy Why not use snprintf in both cases? Joerg From owner-svn-src-all@freebsd.org Thu Aug 16 21:36:22 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 4254510776AD; Thu, 16 Aug 2018 21:36:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBAAC7A6D2; Thu, 16 Aug 2018 21:36:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6CFD1F1EB; Thu, 16 Aug 2018 21:36:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GLaLob038126; Thu, 16 Aug 2018 21:36:21 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GLaJ51038118; Thu, 16 Aug 2018 21:36:19 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808162136.w7GLaJ51038118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 16 Aug 2018 21:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337929 - in head/tests/sys: aio file kern kern/pipe posixshm X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/tests/sys: aio file kern kern/pipe posixshm X-SVN-Commit-Revision: 337929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 21:36:22 -0000 Author: asomers Date: Thu Aug 16 21:36:19 2018 New Revision: 337929 URL: https://svnweb.freebsd.org/changeset/base/337929 Log: Fix Coverity warnings about mkstemp in tests umask(2) should always be used prior to mkstemp(3) so the temporary file won't be created with insecure permissions. Reported by: Coverity CID: 1331605 1347173 1375366 1339800 1331604 1296056 1296060 CID: 1296057 1296062 MFC after: 2 weeks Modified: head/tests/sys/aio/aio_kqueue_test.c head/tests/sys/aio/lio_kqueue_test.c head/tests/sys/file/dup_test.c head/tests/sys/file/flock_helper.c head/tests/sys/kern/kern_copyin.c head/tests/sys/kern/pipe/pipe_overcommit2_test.c head/tests/sys/kern/ptrace_test.c head/tests/sys/kern/unix_passfd_test.c head/tests/sys/posixshm/posixshm_test.c Modified: head/tests/sys/aio/aio_kqueue_test.c ============================================================================== --- head/tests/sys/aio/aio_kqueue_test.c Thu Aug 16 19:48:07 2018 (r337928) +++ head/tests/sys/aio/aio_kqueue_test.c Thu Aug 16 21:36:19 2018 (r337929) @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -90,6 +91,7 @@ main (int argc, char *argv[]) if (argc == 1) { strcpy(pathname, PATH_TEMPLATE); + umask(0077); fd = mkstemp(pathname); file = pathname; tmp_file = 1; Modified: head/tests/sys/aio/lio_kqueue_test.c ============================================================================== --- head/tests/sys/aio/lio_kqueue_test.c Thu Aug 16 19:48:07 2018 (r337928) +++ head/tests/sys/aio/lio_kqueue_test.c Thu Aug 16 21:36:19 2018 (r337929) @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -86,6 +87,7 @@ main(int argc, char *argv[]) if (argc == 1) { strcpy(pathname, PATH_TEMPLATE); + umask(0077); fd = mkstemp(pathname); file = pathname; tmp_file = 1; Modified: head/tests/sys/file/dup_test.c ============================================================================== --- head/tests/sys/file/dup_test.c Thu Aug 16 19:48:07 2018 (r337928) +++ head/tests/sys/file/dup_test.c Thu Aug 16 21:36:19 2018 (r337929) @@ -50,6 +50,7 @@ * open files limit work. */ +#include #include #include #include @@ -68,6 +69,7 @@ getafile(void) int fd; char temp[] = "/tmp/dup2XXXXXXXXX"; + umask(0077); if ((fd = mkstemp(temp)) < 0) err(1, "mkstemp"); remove(temp); Modified: head/tests/sys/file/flock_helper.c ============================================================================== --- head/tests/sys/file/flock_helper.c Thu Aug 16 19:48:07 2018 (r337928) +++ head/tests/sys/file/flock_helper.c Thu Aug 16 21:36:19 2018 (r337929) @@ -92,6 +92,7 @@ make_file(const char *pathname, off_t sz) filename = malloc(len); strcpy(filename, pathname); strcat(filename, template); + umask(0077); fd = mkstemp(filename); if (fd < 0) err(1, "mkstemp"); Modified: head/tests/sys/kern/kern_copyin.c ============================================================================== --- head/tests/sys/kern/kern_copyin.c Thu Aug 16 19:48:07 2018 (r337928) +++ head/tests/sys/kern/kern_copyin.c Thu Aug 16 21:36:19 2018 (r337929) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -69,6 +70,7 @@ ATF_TC_BODY(kern_copyin, tc) atf_tc_skip("Platform is not supported."); #endif + umask(0077); scratch_file = mkstemp(template); ATF_REQUIRE(scratch_file != -1); unlink(template); Modified: head/tests/sys/kern/pipe/pipe_overcommit2_test.c ============================================================================== --- head/tests/sys/kern/pipe/pipe_overcommit2_test.c Thu Aug 16 19:48:07 2018 (r337928) +++ head/tests/sys/kern/pipe/pipe_overcommit2_test.c Thu Aug 16 21:36:19 2018 (r337929) @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -50,6 +51,7 @@ main(void) lastfd = -1; + umask(0077); if (mkstemp(template) == -1) err(1, "mkstemp failed"); Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Thu Aug 16 19:48:07 2018 (r337928) +++ head/tests/sys/kern/ptrace_test.c Thu Aug 16 21:36:19 2018 (r337929) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3347,6 +3348,7 @@ ATF_TC_BODY(ptrace__PT_ATTACH_with_SBDRY_thread, tc) ATF_REQUIRE(pthread_barrier_init(&barrier, &battr, 2) == 0); (void)snprintf(tmpfile, sizeof(tmpfile), "./ptrace.XXXXXX"); + umask(0077); fd = mkstemp(tmpfile); ATF_REQUIRE(fd >= 0); Modified: head/tests/sys/kern/unix_passfd_test.c ============================================================================== --- head/tests/sys/kern/unix_passfd_test.c Thu Aug 16 19:48:07 2018 (r337928) +++ head/tests/sys/kern/unix_passfd_test.c Thu Aug 16 21:36:19 2018 (r337929) @@ -87,6 +87,7 @@ tempfile(int *fdp) snprintf(path, PATH_MAX, "%s/unix_passfd.XXXXXXXXXXXXXXX", getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); + umask(0077); fd = mkstemp(path); ATF_REQUIRE_MSG(fd != -1, "mkstemp(%s) failed", path); (void)unlink(path); Modified: head/tests/sys/posixshm/posixshm_test.c ============================================================================== --- head/tests/sys/posixshm/posixshm_test.c Thu Aug 16 19:48:07 2018 (r337928) +++ head/tests/sys/posixshm/posixshm_test.c Thu Aug 16 21:36:19 2018 (r337929) @@ -54,6 +54,7 @@ gen_test_path(void) snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); test_path[sizeof(test_path) - 1] = '\0'; + umask(0077); ATF_REQUIRE_MSG(mkstemp(test_path) != -1, "mkstemp failed; errno=%d", errno); ATF_REQUIRE_MSG(unlink(test_path) == 0, From owner-svn-src-all@freebsd.org Thu Aug 16 22:04: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 711F11078190; Thu, 16 Aug 2018 22:04:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 070BE7B3DC; Thu, 16 Aug 2018 22:04:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D54581F6CE; Thu, 16 Aug 2018 22:04:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GM42px053393; Thu, 16 Aug 2018 22:04:02 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GM40mQ053384; Thu, 16 Aug 2018 22:04:00 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808162204.w7GM40mQ053384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 16 Aug 2018 22:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337930 - in head/tests/sys: aio file kern kern/pipe posixshm X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/tests/sys: aio file kern kern/pipe posixshm X-SVN-Commit-Revision: 337930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 22:04:03 -0000 Author: asomers Date: Thu Aug 16 22:04:00 2018 New Revision: 337930 URL: https://svnweb.freebsd.org/changeset/base/337930 Log: Revert r337929 FreeBSD's mkstemp sets the temporary file's permissions to 600, and has ever since mkstemp was added in 1987. Coverity's warning is still relevant for portable programs since OpenGroup does not require that behavior, and POSIX didn't until 2008. But none of these programs are portable. Modified: head/tests/sys/aio/aio_kqueue_test.c head/tests/sys/aio/lio_kqueue_test.c head/tests/sys/file/dup_test.c head/tests/sys/file/flock_helper.c head/tests/sys/kern/kern_copyin.c head/tests/sys/kern/pipe/pipe_overcommit2_test.c head/tests/sys/kern/ptrace_test.c head/tests/sys/kern/unix_passfd_test.c head/tests/sys/posixshm/posixshm_test.c Modified: head/tests/sys/aio/aio_kqueue_test.c ============================================================================== --- head/tests/sys/aio/aio_kqueue_test.c Thu Aug 16 21:36:19 2018 (r337929) +++ head/tests/sys/aio/aio_kqueue_test.c Thu Aug 16 22:04:00 2018 (r337930) @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -91,7 +90,6 @@ main (int argc, char *argv[]) if (argc == 1) { strcpy(pathname, PATH_TEMPLATE); - umask(0077); fd = mkstemp(pathname); file = pathname; tmp_file = 1; Modified: head/tests/sys/aio/lio_kqueue_test.c ============================================================================== --- head/tests/sys/aio/lio_kqueue_test.c Thu Aug 16 21:36:19 2018 (r337929) +++ head/tests/sys/aio/lio_kqueue_test.c Thu Aug 16 22:04:00 2018 (r337930) @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -87,7 +86,6 @@ main(int argc, char *argv[]) if (argc == 1) { strcpy(pathname, PATH_TEMPLATE); - umask(0077); fd = mkstemp(pathname); file = pathname; tmp_file = 1; Modified: head/tests/sys/file/dup_test.c ============================================================================== --- head/tests/sys/file/dup_test.c Thu Aug 16 21:36:19 2018 (r337929) +++ head/tests/sys/file/dup_test.c Thu Aug 16 22:04:00 2018 (r337930) @@ -50,7 +50,6 @@ * open files limit work. */ -#include #include #include #include @@ -69,7 +68,6 @@ getafile(void) int fd; char temp[] = "/tmp/dup2XXXXXXXXX"; - umask(0077); if ((fd = mkstemp(temp)) < 0) err(1, "mkstemp"); remove(temp); Modified: head/tests/sys/file/flock_helper.c ============================================================================== --- head/tests/sys/file/flock_helper.c Thu Aug 16 21:36:19 2018 (r337929) +++ head/tests/sys/file/flock_helper.c Thu Aug 16 22:04:00 2018 (r337930) @@ -92,7 +92,6 @@ make_file(const char *pathname, off_t sz) filename = malloc(len); strcpy(filename, pathname); strcat(filename, template); - umask(0077); fd = mkstemp(filename); if (fd < 0) err(1, "mkstemp"); Modified: head/tests/sys/kern/kern_copyin.c ============================================================================== --- head/tests/sys/kern/kern_copyin.c Thu Aug 16 21:36:19 2018 (r337929) +++ head/tests/sys/kern/kern_copyin.c Thu Aug 16 22:04:00 2018 (r337930) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -70,7 +69,6 @@ ATF_TC_BODY(kern_copyin, tc) atf_tc_skip("Platform is not supported."); #endif - umask(0077); scratch_file = mkstemp(template); ATF_REQUIRE(scratch_file != -1); unlink(template); Modified: head/tests/sys/kern/pipe/pipe_overcommit2_test.c ============================================================================== --- head/tests/sys/kern/pipe/pipe_overcommit2_test.c Thu Aug 16 21:36:19 2018 (r337929) +++ head/tests/sys/kern/pipe/pipe_overcommit2_test.c Thu Aug 16 22:04:00 2018 (r337930) @@ -27,7 +27,6 @@ */ #include -#include #include #include #include @@ -51,7 +50,6 @@ main(void) lastfd = -1; - umask(0077); if (mkstemp(template) == -1) err(1, "mkstemp failed"); Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Thu Aug 16 21:36:19 2018 (r337929) +++ head/tests/sys/kern/ptrace_test.c Thu Aug 16 22:04:00 2018 (r337930) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -3348,7 +3347,6 @@ ATF_TC_BODY(ptrace__PT_ATTACH_with_SBDRY_thread, tc) ATF_REQUIRE(pthread_barrier_init(&barrier, &battr, 2) == 0); (void)snprintf(tmpfile, sizeof(tmpfile), "./ptrace.XXXXXX"); - umask(0077); fd = mkstemp(tmpfile); ATF_REQUIRE(fd >= 0); Modified: head/tests/sys/kern/unix_passfd_test.c ============================================================================== --- head/tests/sys/kern/unix_passfd_test.c Thu Aug 16 21:36:19 2018 (r337929) +++ head/tests/sys/kern/unix_passfd_test.c Thu Aug 16 22:04:00 2018 (r337930) @@ -87,7 +87,6 @@ tempfile(int *fdp) snprintf(path, PATH_MAX, "%s/unix_passfd.XXXXXXXXXXXXXXX", getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); - umask(0077); fd = mkstemp(path); ATF_REQUIRE_MSG(fd != -1, "mkstemp(%s) failed", path); (void)unlink(path); Modified: head/tests/sys/posixshm/posixshm_test.c ============================================================================== --- head/tests/sys/posixshm/posixshm_test.c Thu Aug 16 21:36:19 2018 (r337929) +++ head/tests/sys/posixshm/posixshm_test.c Thu Aug 16 22:04:00 2018 (r337930) @@ -54,7 +54,6 @@ gen_test_path(void) snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); test_path[sizeof(test_path) - 1] = '\0'; - umask(0077); ATF_REQUIRE_MSG(mkstemp(test_path) != -1, "mkstemp failed; errno=%d", errno); ATF_REQUIRE_MSG(unlink(test_path) == 0, From owner-svn-src-all@freebsd.org Thu Aug 16 22:13: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 9CE8B1078727; Thu, 16 Aug 2018 22:13:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 538FA7BAC4; Thu, 16 Aug 2018 22:13:44 +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 34C661F8BC; Thu, 16 Aug 2018 22:13:44 +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 w7GMDi7e058441; Thu, 16 Aug 2018 22:13:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GMDiYC058440; Thu, 16 Aug 2018 22:13:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808162213.w7GMDiYC058440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Aug 2018 22:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337931 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 337931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 22:13:44 -0000 Author: imp Date: Thu Aug 16 22:13:43 2018 New Revision: 337931 URL: https://svnweb.freebsd.org/changeset/base/337931 Log: Specify DB_FROM_SRC=yes when doing any installation target. We want to use the UIDs from the installed system, not the host system, when installing things. Sponsored by: Netflix Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Thu Aug 16 22:04:00 2018 (r337930) +++ head/tools/tools/nanobsd/defaults.sh Thu Aug 16 22:13:43 2018 (r337931) @@ -388,7 +388,7 @@ install_world ( ) ( nano_make_install_env set -o xtrace cd "${NANO_SRC}" - ${NANO_MAKE} installworld DESTDIR="${NANO_WORLDDIR}" + ${NANO_MAKE} installworld DESTDIR="${NANO_WORLDDIR}" DB_FROM_SRC=yes chflags -R noschg "${NANO_WORLDDIR}" ) > ${NANO_LOG}/_.iw 2>&1 ) @@ -401,7 +401,7 @@ install_etc ( ) ( nano_make_install_env set -o xtrace cd "${NANO_SRC}" - ${NANO_MAKE} distribution DESTDIR="${NANO_WORLDDIR}" + ${NANO_MAKE} distribution DESTDIR="${NANO_WORLDDIR}" DB_FROM_SRC=yes # make.conf doesn't get created by default, but some ports need it # so they can spam it. cp /dev/null "${NANO_WORLDDIR}"/etc/make.conf @@ -424,7 +424,7 @@ install_kernel ( ) ( set -o xtrace cd "${NANO_SRC}" - ${NANO_MAKE} installkernel DESTDIR="${NANO_WORLDDIR}" + ${NANO_MAKE} installkernel DESTDIR="${NANO_WORLDDIR}" DB_FROM_SRC=yes ) > ${NANO_LOG}/_.ik 2>&1 ) From owner-svn-src-all@freebsd.org Thu Aug 16 23:04: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 EA3E6107970E; Thu, 16 Aug 2018 23:04:07 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (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 546477D3C3; Thu, 16 Aug 2018 23:04:07 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x132.google.com with SMTP id b22-v6so4596791lfa.3; Thu, 16 Aug 2018 16:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=coxXcZkR2y5AZbXSv5WQymsQzrAZmI5iDjlOfIM7shY=; b=Gb1+NZbisNIgTpEqgRR5Y+13v+yP23X1p/bFpTCXTDyQ53Ru0Hszc2rde1VOl66HKk MWt0iBgBRfTBL6nGmVMFDXd2Xs1A7cJvzr9hlTewqKbORUsxfn3ixn39FG32gpaX/1Y9 W9r9w/19rCldlxqPA4AGr1FjqlImFjyIT7dJzRSKyRFuZ73YO8ZHow5mHgjZpx/gVnFL GVc+ahwbWMgaFRx+oIxRa/suDgNLZKr5ijW5apQGtjuKoxVSyvXnP4OQKt2Q0XjUzcWc 0Ayzm3rn9m5brKzAu+WyhXoPjS7aYB4fGpqWULnr9bQwA/m9dueNNC2Y3QIGzCw8hnwT fs5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=coxXcZkR2y5AZbXSv5WQymsQzrAZmI5iDjlOfIM7shY=; b=kjUSU6IrsbgXj2xIkN6IkMAvmsbl88Z+oNJIioSzTnHYETuf1cx3GUBe6EdXLmsj5s WemOLDEex/tcSXc3vXiGe31oCZHPAsuS//WIt34dzlrVilIppegM4S9jBtIKt+GFV95l VEtOqgK4iJBfjiXJ/0ueiL18qWAJ0++sMMLnnVC0qLceoOMgb3K+UqPwFptFpF6yu3G1 EJobDE4UXoUC3nKPhfIXwD9uiZPQ8FdTH2JXQEUab1vItHlpBlugYt9Z0t1RtvnGntBa 0o3bKYQcACSMBi/RPzIJKv+Eu7Anw8iqlY3Xr36YW5ANTrb/4joPjCibnuTk4Qvs9RF6 xh3A== X-Gm-Message-State: AOUpUlFjWbqlsAYasAYkRYQkQ6T5vOhmGjdk9QixYGcHh/qqxeWEsxQ9 tkiLU/VgT28Rj5gS6sR6oD/08mliC9nRd1xEMPOg0RgH X-Google-Smtp-Source: AA+uWPybVqB4/ImFUMyFYOwWDzrBFDCZxChjSgs3R02CA4w+J/BtQXKF+3sATfz5mmG3+ttmYwtEhwzyDrNL0prqNkg= X-Received: by 2002:a19:9710:: with SMTP id z16-v6mr21593562lfd.17.1534460645798; Thu, 16 Aug 2018 16:04:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:1f4c:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 16:04:05 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <201808161929.w7GJTWfS055411@pdx.rh.CN85.dnsmgr.net> References: <201808161929.w7GJTWfS055411@pdx.rh.CN85.dnsmgr.net> From: Marcelo Araujo Date: Fri, 17 Aug 2018 07:04:05 +0800 Message-ID: Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve To: "Rodney W. Grimes" Cc: Warner Losh , John-Mark Gurney , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 23:04:08 -0000 2018-08-17 3:29 GMT+08:00 Rodney W. Grimes : > > On Thu, Aug 16, 2018 at 11:06 AM, John-Mark Gurney > wrote: > > > > > Marcelo Araujo wrote this message on Thu, Aug 16, 2018 at 06:31 +0000: > > > > Author: araujo > > > > Date: Thu Aug 16 06:31:54 2018 > > > > New Revision: 337887 > > > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > > > > > Log: > > > > Add a comment explaining how the PSN works and why there is no > need for > > > > a null terminator. Also mark CID 1394825 as intentional. > > > > > > > > Reported by: Coverity > > > > CID: 1394825 > > > > MFC after: 1 week > > > > Sponsored by: iXsystems Inc. > > > > > > > > Modified: > > > > head/usr.sbin/bhyve/pci_nvme.c > > > > > > > > Modified: head/usr.sbin/bhyve/pci_nvme.c > > > > ============================================================ > > > ================== > > > > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > > > (r337886) > > > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > > > (r337887) > > > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, > > > char *o > > > > > > [...] > > > > > > > memset(sc->ctrldata.sn, 0, sizeof(sc-> > ctrldata.sn > > > )); > > > > strncpy(sc->ctrldata.sn, config, > > > > sizeof(sc->ctrldata.sn)); > > > > > > This memset is unneeded, as strncpy will write NUL bytes to fill out > > > the buffer: > > > If src is less than len characters long, the remainder of > > > dst is filled with `\0' characters. > > > > > > > It also looks like the comment was wrong. The newest NVMe standards say > > these fields should be 7-bit and space-padded. > > lol, which is what the vendor that caused me grief with > ata serial numbers did decades ago. > > -- > Rod Grimes > rgrimes@freebsd.org > I have discussed a bit with imp@, but I will drop the patch here to get other peoples opinion too. So, name space and firmware number also need to be padded with spaces. I couldn't think in any other better way to do that. Does this patch looks reasonable? https://people.freebsd.org/~araujo/pci_nvme.diff Best, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Thu Aug 16 23:16: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 0DC091079A2A; Thu, 16 Aug 2018 23:16:38 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B06A67D8A0; Thu, 16 Aug 2018 23:16:37 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id AB0105A9F12; Thu, 16 Aug 2018 23:16:30 +0000 (UTC) Date: Thu, 16 Aug 2018 23:16:30 +0000 From: Brooks Davis To: araujo@freebsd.org Cc: "Rodney W. Grimes" , Warner Losh , John-Mark Gurney , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve Message-ID: <20180816231630.GA10866@spindle.one-eyed-alien.net> References: <201808161929.w7GJTWfS055411@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 23:16:38 -0000 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 17, 2018 at 07:04:05AM +0800, Marcelo Araujo wrote: > 2018-08-17 3:29 GMT+08:00 Rodney W. Grimes : >=20 > > > On Thu, Aug 16, 2018 at 11:06 AM, John-Mark Gurney > > wrote: > > > > > > > Marcelo Araujo wrote this message on Thu, Aug 16, 2018 at 06:31 +00= 00: > > > > > Author: araujo > > > > > Date: Thu Aug 16 06:31:54 2018 > > > > > New Revision: 337887 > > > > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > > > > > > > Log: > > > > > Add a comment explaining how the PSN works and why there is no > > need for > > > > > a null terminator. Also mark CID 1394825 as intentional. > > > > > > > > > > Reported by: Coverity > > > > > CID: 1394825 > > > > > MFC after: 1 week > > > > > Sponsored by: iXsystems Inc. > > > > > > > > > > Modified: > > > > > head/usr.sbin/bhyve/pci_nvme.c > > > > > > > > > > Modified: head/usr.sbin/bhyve/pci_nvme.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/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > > > > (r337886) > > > > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > > > > (r337887) > > > > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc = *sc, > > > > char *o > > > > > > > > [...] > > > > > > > > > memset(sc->ctrldata.sn, 0, sizeof(sc-> > > ctrldata.sn > > > > )); > > > > > strncpy(sc->ctrldata.sn, config, > > > > > sizeof(sc->ctrldata.sn)); > > > > > > > > This memset is unneeded, as strncpy will write NUL bytes to fill out > > > > the buffer: > > > > If src is less than len characters long, the remainder of > > > > dst is filled with `\0' characters. > > > > > > > > > > It also looks like the comment was wrong. The newest NVMe standards s= ay > > > these fields should be 7-bit and space-padded. > > > > lol, which is what the vendor that caused me grief with > > ata serial numbers did decades ago. > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > >=20 > I have discussed a bit with imp@, but I will drop the patch here to get > other peoples opinion too. > So, name space and firmware number also need to be padded with spaces. >=20 > I couldn't think in any other better way to do that. >=20 > Does this patch looks reasonable? > https://people.freebsd.org/~araujo/pci_nvme.diff You should check that len<=3Ddst_size and at least truncate rather than overflowing. If the strings from userspace you need to return or log an error, if they come from the kernel, you can panic. -- Brooks --azLHFNyN32YCQGCU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbdgXOAAoJEKzQXbSebgfAND0H/RrNL+PKlxzh62SnGqwDphjE IsS4YFIxDyYeDEhE0FeWZe9DS749jXxDbFiVT/8TL1FLb3v1RbJ2oAuRQwqRbFiG NJfo0/s3wGL2e9ebsmkGJKmFXvOI0p8AG3MARgmDSe7vAkOWty6mYzfos/OgODht mDE0BOOUc4Obz+nUU+4LAGVHR5TOcEP30HI9rcC1SXl96hZ0Im6pQ04FuYM75ydW mETJn1rXThSFmDP/ie87uxEA5ZU7DQIIy4sa+Om3w1nkQuzl19cO3farOf/If141 I6ESIXz8C58fWEHkVD8SoXjTzDqVvrfy6Yhm/odCMJbyXFQIdM5BqGNPUUYWD3g= =0qyg -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU-- From owner-svn-src-all@freebsd.org Thu Aug 16 23:23:28 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 E70ED1079D86 for ; Thu, 16 Aug 2018 23:23:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (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 747597DDFB for ; Thu, 16 Aug 2018 23:23:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id v71-v6so9195380itb.3 for ; Thu, 16 Aug 2018 16:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=xWlSBvuhuYVbERPhigAxUXseugL1Gy8t1I9A/IqZChc=; b=Ig5FQp4nm12MN6Hk509QSgKN72fFLDcHC25C3LodiJn88GUeXI11AgTlCgI4Ow196J +EgKL+UvhjhyurMb5w+V0IXRIufPXNKhO6qsZRH5Omq8r97eBn9GNgMuozJPsVYeqRKT +Y0MuOjNxUP7M0r2/2HuOgc6tlO7UNKCx9HNK1IpMig9hrHZ12RVd7vpu9EwFV/v7asI sPKt2OI8mPQRN/nMRMujEpLUmKlK3B1pxvxDwwPXIctiwYYhBmuN7UtdM7KGlmknYdSP rfnHGLcIV1U9dcub1Yj1jpz29fPO5mljpSuTwLJVl2DWB9AEQWl9UFO5etPRPf6ZX4c1 jBxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=xWlSBvuhuYVbERPhigAxUXseugL1Gy8t1I9A/IqZChc=; b=e5Jp0UuhFuUJmBmCijan3RdoaSRzt6XO6WM9S5dQFuWla8Uvzdm5KYKWVponvQdoj3 6CY+uZUIyu+aYXLUIX9ExjxQTvyyzAD7lONh/CcE9O4ptzTQrD4oWPYLTB8+/sueZt4j pvqDbFRF8Zte+VrWGH8VrUKZ15uh7ZwvNsJ4p2ucTvQmk+b/UWIeTa0+p0rUZ75/jjfO 5eOfiP5V/l5GgFm570NxCLTIkErUlxduf8qHKGR74ABpihdZz+j7Uj8aOxwDDEAZUBWL OEVTi8tzxAAWU/zn1YySMIseZU4DP798vXOlyMdT9RcWjPXipAvsna//zEG+y7/lOa3D vM1Q== X-Gm-Message-State: AOUpUlGSEhxpGOWIrvqzbL3+cDJz6whTFOR34xL7xU9GbQ7ROkdYXIej rCOhUjAqpuFel44tQomRBFsAPyDawT2zjizbqv0Byg== X-Google-Smtp-Source: AA+uWPwiEZd5jhebxBXiEeY5zUfAJG4QusB/mvgDkIFanrgZGGA55OSW5XpGP8n1QJfMIGjZ4O+QMhjRayYu6QeoNII= X-Received: by 2002:a02:bb04:: with SMTP id y4-v6mr29359414jan.5.1534461806685; Thu, 16 Aug 2018 16:23:26 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 16:23:26 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180816231630.GA10866@spindle.one-eyed-alien.net> References: <201808161929.w7GJTWfS055411@pdx.rh.CN85.dnsmgr.net> <20180816231630.GA10866@spindle.one-eyed-alien.net> From: Warner Losh Date: Thu, 16 Aug 2018 17:23:26 -0600 X-Google-Sender-Auth: olueA3Rb9hxvz_rUaErv-qwi-Tk Message-ID: Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve To: Brooks Davis Cc: Marcelo Araujo , "Rodney W. Grimes" , John-Mark Gurney , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 23:23:28 -0000 On Thu, Aug 16, 2018 at 5:16 PM, Brooks Davis wrote: > On Fri, Aug 17, 2018 at 07:04:05AM +0800, Marcelo Araujo wrote: > > 2018-08-17 3:29 GMT+08:00 Rodney W. Grimes net>: > > > > > > On Thu, Aug 16, 2018 at 11:06 AM, John-Mark Gurney > > > > wrote: > > > > > > > > > Marcelo Araujo wrote this message on Thu, Aug 16, 2018 at 06:31 > +0000: > > > > > > Author: araujo > > > > > > Date: Thu Aug 16 06:31:54 2018 > > > > > > New Revision: 337887 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > > > > > > > > > Log: > > > > > > Add a comment explaining how the PSN works and why there is no > > > need for > > > > > > a null terminator. Also mark CID 1394825 as intentional. > > > > > > > > > > > > Reported by: Coverity > > > > > > CID: 1394825 > > > > > > MFC after: 1 week > > > > > > Sponsored by: iXsystems Inc. > > > > > > > > > > > > Modified: > > > > > > head/usr.sbin/bhyve/pci_nvme.c > > > > > > > > > > > > Modified: head/usr.sbin/bhyve/pci_nvme.c > > > > > > ============================================================ > > > > > ================== > > > > > > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > > > > > (r337886) > > > > > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > > > > > (r337887) > > > > > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_softc > *sc, > > > > > char *o > > > > > > > > > > [...] > > > > > > > > > > > memset(sc->ctrldata.sn, 0, sizeof(sc-> > > > ctrldata.sn > > > > > )); > > > > > > strncpy(sc->ctrldata.sn, config, > > > > > > sizeof(sc->ctrldata.sn)); > > > > > > > > > > This memset is unneeded, as strncpy will write NUL bytes to fill > out > > > > > the buffer: > > > > > If src is less than len characters long, the remainder of > > > > > dst is filled with `\0' characters. > > > > > > > > > > > > > It also looks like the comment was wrong. The newest NVMe standards > say > > > > these fields should be 7-bit and space-padded. > > > > > > lol, which is what the vendor that caused me grief with > > > ata serial numbers did decades ago. > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > > > I have discussed a bit with imp@, but I will drop the patch here to get > > other peoples opinion too. > > So, name space and firmware number also need to be padded with spaces. > > > > I couldn't think in any other better way to do that. > > > > Does this patch looks reasonable? > > https://people.freebsd.org/~araujo/pci_nvme.diff > > You should check that len<=dst_size and at least truncate rather than > overflowing. If the strings from userspace you need to return or log an > error, if they come from the kernel, you can panic. > Help me understand, I thought that the strnlen bounded what was copied. Warner From owner-svn-src-all@freebsd.org Thu Aug 16 23:33:16 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 36364107A15A; Thu, 16 Aug 2018 23:33:16 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C58207E34B; Thu, 16 Aug 2018 23:33:15 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 0D0B35A9F12; Thu, 16 Aug 2018 23:33:15 +0000 (UTC) Date: Thu, 16 Aug 2018 23:33:15 +0000 From: Brooks Davis To: Warner Losh Cc: Brooks Davis , Marcelo Araujo , "Rodney W. Grimes" , John-Mark Gurney , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve Message-ID: <20180816233314.GA11357@spindle.one-eyed-alien.net> References: <201808161929.w7GJTWfS055411@pdx.rh.CN85.dnsmgr.net> <20180816231630.GA10866@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 23:33:16 -0000 --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 16, 2018 at 05:23:26PM -0600, Warner Losh wrote: > On Thu, Aug 16, 2018 at 5:16 PM, Brooks Davis wrote: >=20 > > On Fri, Aug 17, 2018 at 07:04:05AM +0800, Marcelo Araujo wrote: > > > 2018-08-17 3:29 GMT+08:00 Rodney W. Grimes > net>: > > > > > > > > On Thu, Aug 16, 2018 at 11:06 AM, John-Mark Gurney > > > > > > wrote: > > > > > > > > > > > Marcelo Araujo wrote this message on Thu, Aug 16, 2018 at 06:31 > > +0000: > > > > > > > Author: araujo > > > > > > > Date: Thu Aug 16 06:31:54 2018 > > > > > > > New Revision: 337887 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > > > > > > > > > > > Log: > > > > > > > Add a comment explaining how the PSN works and why there is= no > > > > need for > > > > > > > a null terminator. Also mark CID 1394825 as intentional. > > > > > > > > > > > > > > Reported by: Coverity > > > > > > > CID: 1394825 > > > > > > > MFC after: 1 week > > > > > > > Sponsored by: iXsystems Inc. > > > > > > > > > > > > > > Modified: > > > > > > > head/usr.sbin/bhyve/pci_nvme.c > > > > > > > > > > > > > > Modified: head/usr.sbin/bhyve/pci_nvme.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/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 2018 > > > > > > (r337886) > > > > > > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 2018 > > > > > > (r337887) > > > > > > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct pci_nvme_so= ftc > > *sc, > > > > > > char *o > > > > > > > > > > > > [...] > > > > > > > > > > > > > memset(sc->ctrldata.sn, 0, sizeof(sc-> > > > > ctrldata.sn > > > > > > )); > > > > > > > strncpy(sc->ctrldata.sn, config, > > > > > > > sizeof(sc->ctrldata.sn)); > > > > > > > > > > > > This memset is unneeded, as strncpy will write NUL bytes to fill > > out > > > > > > the buffer: > > > > > > If src is less than len characters long, the remainder of > > > > > > dst is filled with `\0' characters. > > > > > > > > > > > > > > > > It also looks like the comment was wrong. The newest NVMe standar= ds > > say > > > > > these fields should be 7-bit and space-padded. > > > > > > > > lol, which is what the vendor that caused me grief with > > > > ata serial numbers did decades ago. > > > > > > > > -- > > > > Rod Grimes > > > > rgrimes@freebsd.org > > > > > > > > > > I have discussed a bit with imp@, but I will drop the patch here to g= et > > > other peoples opinion too. > > > So, name space and firmware number also need to be padded with spaces. > > > > > > I couldn't think in any other better way to do that. > > > > > > Does this patch looks reasonable? > > > https://people.freebsd.org/~araujo/pci_nvme.diff > > > > You should check that len<=3Ddst_size and at least truncate rather than > > overflowing. If the strings from userspace you need to return or log an > > error, if they come from the kernel, you can panic. >=20 > Help me understand, I thought that the strnlen bounded what was copied. Apparently the standard calls for ' ' rather than '\0' padding. The prop memcpy+memset does the job, but contains potential overflows. -- Brooks --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbdgm6AAoJEKzQXbSebgfA8lQH/2AcD3Embk6TBtQI1fZ+IJA8 hF71ikzD2eibAYrsZEYhtyws1lzxYwvml/X1oQRJyN/jj0b44UgonBNheQl197NS /GkwRvHunnQGkPhsWVOqlEby2fNi7F6YJ/WTe8Rz1fc8YdxLcvGRiosO0wVL3vO2 haNpeiC7GTy6RCfNccugU1NW8WbUd1tLIlvDCmrroPUrOfSKn7hSbd9BOyjzyYGt PV5Gcr2bL2wg//Yp4gpnrPxGE0yUCGtfPDhGGUheVaEM3uRCf4jBDcfmDgCHnFmR GpHTY75a2BbKfE+gpeiQurWvnl2dKX3KmE6Z2AjTMSzEOk9XyPevBfxlZ/n60Ao= =bAEp -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR-- From owner-svn-src-all@freebsd.org Thu Aug 16 23:46: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 C392D107A8B1; Thu, 16 Aug 2018 23:46:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A7587FD26; Thu, 16 Aug 2018 23:46:39 +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 5AF8A20804; Thu, 16 Aug 2018 23:46:39 +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 w7GNkds8006826; Thu, 16 Aug 2018 23:46:39 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GNkc2p006822; Thu, 16 Aug 2018 23:46:38 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808162346.w7GNkc2p006822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 16 Aug 2018 23:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337932 - in head/sys: net netinet X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys: net netinet X-SVN-Commit-Revision: 337932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 23:46:40 -0000 Author: np Date: Thu Aug 16 23:46:38 2018 New Revision: 337932 URL: https://svnweb.freebsd.org/changeset/base/337932 Log: Add the ability to look up the 3b PCP of a VLAN interface. Use it in toe_l2_resolve to fill up the complete vtag and not just the vid. Reviewed by: kib@ MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D16752 Modified: head/sys/net/if.c head/sys/net/if_vlan.c head/sys/net/if_vlan_var.h head/sys/netinet/toecore.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Aug 16 22:13:43 2018 (r337931) +++ head/sys/net/if.c Thu Aug 16 23:46:38 2018 (r337932) @@ -2298,6 +2298,7 @@ void (*vlan_trunk_cap_p)(struct ifnet *); /* XXX: pri struct ifnet *(*vlan_trunkdev_p)(struct ifnet *); struct ifnet *(*vlan_devat_p)(struct ifnet *, uint16_t); int (*vlan_tag_p)(struct ifnet *, uint16_t *); +int (*vlan_pcp_p)(struct ifnet *, uint16_t *); int (*vlan_setcookie_p)(struct ifnet *, void *); void *(*vlan_cookie_p)(struct ifnet *); Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Aug 16 22:13:43 2018 (r337931) +++ head/sys/net/if_vlan.c Thu Aug 16 23:46:38 2018 (r337932) @@ -758,6 +758,18 @@ vlan_tag(struct ifnet *ifp, uint16_t *vidp) return (0); } +static int +vlan_pcp(struct ifnet *ifp, uint16_t *pcpp) +{ + struct ifvlan *ifv; + + if (ifp->if_type != IFT_L2VLAN) + return (EINVAL); + ifv = ifp->if_softc; + *pcpp = ifv->ifv_pcp; + return (0); +} + /* * Return a driver specific cookie for this interface. Synchronization * with setcookie must be provided by the driver. @@ -861,6 +873,7 @@ vlan_modevent(module_t mod, int type, void *data) vlan_cookie_p = vlan_cookie; vlan_setcookie_p = vlan_setcookie; vlan_tag_p = vlan_tag; + vlan_pcp_p = vlan_pcp; vlan_devat_p = vlan_devat; #ifndef VIMAGE vlan_cloner = if_clone_advanced(vlanname, 0, vlan_clone_match, Modified: head/sys/net/if_vlan_var.h ============================================================================== --- head/sys/net/if_vlan_var.h Thu Aug 16 22:13:43 2018 (r337931) +++ head/sys/net/if_vlan_var.h Thu Aug 16 23:46:38 2018 (r337932) @@ -132,6 +132,8 @@ struct vlanreq { ((_ifp)->if_type == IFT_L2VLAN ? (*vlan_trunkdev_p)((_ifp)) : NULL) #define VLAN_TAG(_ifp, _vid) \ ((_ifp)->if_type == IFT_L2VLAN ? (*vlan_tag_p)((_ifp), (_vid)) : EINVAL) +#define VLAN_PCP(_ifp, _pcp) \ + ((_ifp)->if_type == IFT_L2VLAN ? (*vlan_pcp_p)((_ifp), (_pcp)) : EINVAL) #define VLAN_COOKIE(_ifp) \ ((_ifp)->if_type == IFT_L2VLAN ? (*vlan_cookie_p)((_ifp)) : NULL) #define VLAN_SETCOOKIE(_ifp, _cookie) \ @@ -144,6 +146,7 @@ extern void (*vlan_trunk_cap_p)(struct ifnet *); extern struct ifnet *(*vlan_trunkdev_p)(struct ifnet *); extern struct ifnet *(*vlan_devat_p)(struct ifnet *, uint16_t); extern int (*vlan_tag_p)(struct ifnet *, uint16_t *); +extern int (*vlan_pcp_p)(struct ifnet *, uint16_t *); extern int (*vlan_setcookie_p)(struct ifnet *, void *); extern void *(*vlan_cookie_p)(struct ifnet *); Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Thu Aug 16 22:13:43 2018 (r337931) +++ head/sys/netinet/toecore.c Thu Aug 16 23:46:38 2018 (r337932) @@ -400,7 +400,7 @@ toe_lle_event(void *arg __unused, struct llentry *lle, struct ifnet *ifp; struct sockaddr *sa; uint8_t *lladdr; - uint16_t vtag; + uint16_t vid, pcp; int family; struct sockaddr_in6 sin6; @@ -425,7 +425,8 @@ toe_lle_event(void *arg __unused, struct llentry *lle, sa = (struct sockaddr *)&sin6; lltable_fill_sa_entry(lle, sa); - vtag = 0xfff; + vid = 0xfff; + pcp = 0; if (evt != LLENTRY_RESOLVED) { /* @@ -440,12 +441,11 @@ toe_lle_event(void *arg __unused, struct llentry *lle, ("%s: %p resolved but not valid?", __func__, lle)); lladdr = (uint8_t *)lle->ll_addr; -#ifdef VLAN_TAG - VLAN_TAG(ifp, &vtag); -#endif + VLAN_TAG(ifp, &vid); + VLAN_PCP(ifp, &pcp); } - tod->tod_l2_update(tod, ifp, sa, lladdr, vtag); + tod->tod_l2_update(tod, ifp, sa, lladdr, EVL_MAKETAG(vid, pcp, 0)); } /* @@ -458,6 +458,7 @@ toe_l2_resolve(struct toedev *tod, struct ifnet *ifp, uint8_t *lladdr, uint16_t *vtag) { int rc; + uint16_t vid, pcp; switch (sa->sa_family) { #ifdef INET @@ -475,10 +476,16 @@ toe_l2_resolve(struct toedev *tod, struct ifnet *ifp, } if (rc == 0) { -#ifdef VLAN_TAG - if (VLAN_TAG(ifp, vtag) != 0) -#endif - *vtag = 0xfff; + vid = 0xfff; + pcp = 0; + if (ifp->if_type == IFT_L2VLAN) { + VLAN_TAG(ifp, &vid); + VLAN_PCP(ifp, &pcp); + } else if (ifp->if_pcp != IFNET_PCP_NONE) { + vid = 0; + pcp = ifp->if_pcp; + } + *vtag = EVL_MAKETAG(vid, pcp, 0); } return (rc); From owner-svn-src-all@freebsd.org Thu Aug 16 23:49: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 34B30107AA64; Thu, 16 Aug 2018 23:49:57 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D64908000A; Thu, 16 Aug 2018 23:49:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B61F920831; Thu, 16 Aug 2018 23:49:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GNnuGs007295; Thu, 16 Aug 2018 23:49:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GNnuVN007292; Thu, 16 Aug 2018 23:49:56 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808162349.w7GNnuVN007292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 16 Aug 2018 23:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337933 - in head/tests: freebsd_test_suite sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/tests: freebsd_test_suite sys/opencrypto X-SVN-Commit-Revision: 337933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 23:49:57 -0000 Author: asomers Date: Thu Aug 16 23:49:56 2018 New Revision: 337933 URL: https://svnweb.freebsd.org/changeset/base/337933 Log: Fix sys/opencrypto/blake2_test when kern.cryptodevallowsoft=0 Two of these testcases require software crypto to be enabled. Curiously, it isn't by default. PR: 230671 Reported by: Jenkins Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16755 Modified: head/tests/freebsd_test_suite/macros.h head/tests/sys/opencrypto/blake2_test.c Modified: head/tests/freebsd_test_suite/macros.h ============================================================================== --- head/tests/freebsd_test_suite/macros.h Thu Aug 16 23:46:38 2018 (r337932) +++ head/tests/freebsd_test_suite/macros.h Thu Aug 16 23:49:56 2018 (r337933) @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -50,6 +51,17 @@ atf_tc_skip("module %s could not be resolved: %s", \ _mod_name, strerror(errno)); \ } \ +} while(0) + +#define ATF_REQUIRE_SYSCTL_INT(_mib_name, _required_value) do { \ + int value; \ + size_t size = sizeof(value); \ + if (sysctlbyname(_mib_name, &value, &size, NULL, 0) == -1) { \ + atf_tc_skip("sysctl for %s failed: %s", _mib_name, \ + strerror(errno)); \ + } \ + if (value != _required_value) \ + atf_tc_skip("requires %s=%d", _mib_name, _required_value); \ } while(0) #define PLAIN_REQUIRE_FEATURE(_feature_name, _exit_code) do { \ Modified: head/tests/sys/opencrypto/blake2_test.c ============================================================================== --- head/tests/sys/opencrypto/blake2_test.c Thu Aug 16 23:46:38 2018 (r337932) +++ head/tests/sys/opencrypto/blake2_test.c Thu Aug 16 23:49:56 2018 (r337933) @@ -172,12 +172,14 @@ test_blake2s_vectors(int crid, const char *modname) ATF_TC_WITHOUT_HEAD(blake2b_vectors); ATF_TC_BODY(blake2b_vectors, tc) { + ATF_REQUIRE_SYSCTL_INT("kern.cryptodevallowsoft", 1); test_blake2b_vectors(CRYPTO_FLAG_SOFTWARE, "nexus/cryptosoft"); } ATF_TC_WITHOUT_HEAD(blake2s_vectors); ATF_TC_BODY(blake2s_vectors, tc) { + ATF_REQUIRE_SYSCTL_INT("kern.cryptodevallowsoft", 1); test_blake2s_vectors(CRYPTO_FLAG_SOFTWARE, "nexus/cryptosoft"); } From owner-svn-src-all@freebsd.org Thu Aug 16 23:58: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 CEC9A107AED6; Thu, 16 Aug 2018 23:58:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 855FE8052B; Thu, 16 Aug 2018 23:58:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6285C209C5; Thu, 16 Aug 2018 23:58:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7GNwNcE012591; Thu, 16 Aug 2018 23:58:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7GNwNFk012590; Thu, 16 Aug 2018 23:58:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808162358.w7GNwNFk012590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Aug 2018 23:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337934 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 337934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2018 23:58:24 -0000 Author: gjb Date: Thu Aug 16 23:58:22 2018 New Revision: 337934 URL: https://svnweb.freebsd.org/changeset/base/337934 Log: Rename head from ALPHA1 to ALPHA2 in preparation for the next set of snapshot builds. Hashtag: MaximumEffort Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Aug 16 23:49:56 2018 (r337933) +++ head/sys/conf/newvers.sh Thu Aug 16 23:58:22 2018 (r337934) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="ALPHA1" +BRANCH="ALPHA2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Aug 17 00:00: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 02337107AFCD; Fri, 17 Aug 2018 00:00:29 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com [209.85.214.49]) (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 8EFF1806E6; Fri, 17 Aug 2018 00:00:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f49.google.com with SMTP id 139-v6so9357462itf.0; Thu, 16 Aug 2018 17:00:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=eHI2Kb9uhmLgtKarT00l7in7RVKnnRDDxUvmPyzEOVo=; b=H8LHviI6IHtrSRtly0DE4NWXRRi8vWpDXiY5F7qkFpHp4w2FRdBAHEbvgVADRHHaDB c/mNcpO6QoCk1r3EWbSthSzW09xh5t4VsowSsPj5RN4nClv0583IlIZ433bQryUczL7v WTNvFtD0HyjNEn5P5qqVpFsOzmyixIDI2U8hkV/+zl4MCkorUH4AW6nLMfDsO9cU19Vd Z9TYFGTPodH1JuK5yLsNM6WROh+mfdfcOLM15EjBBk5w8HTaNMsSH4EMinlwCLSnkf6o RZiyniHgVWYznqznSx/eTYE8zMCy/FjSXgfMSRcpfGNYplA2Kb7k/iUpe2SGwSXXUVuy XDmw== X-Gm-Message-State: AOUpUlFhQ8b5IpQ2JBWC6xyWzunDDlGeBPopVhjfoVEnBw+kloRNjiVh rbCW4sx1SMs4wFFY/P65l43WtjCC X-Google-Smtp-Source: AA+uWPwS0uhetp/jcm+TzdDhE/TK0ugrudRWXhaZpzzJU03AwOQo0xRkCMNQ3UVtKdHf6AQRBw9tnw== X-Received: by 2002:a02:2505:: with SMTP id g5-v6mr28882037jag.112.1534464022507; Thu, 16 Aug 2018 17:00:22 -0700 (PDT) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com. [209.85.214.54]) by smtp.gmail.com with ESMTPSA id v13-v6sm1092118ita.38.2018.08.16.17.00.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 17:00:22 -0700 (PDT) Received: by mail-it0-f54.google.com with SMTP id e14-v6so8897450itf.1; Thu, 16 Aug 2018 17:00:22 -0700 (PDT) X-Received: by 2002:a24:715:: with SMTP id f21-v6mr22713725itf.92.1534464022002; Thu, 16 Aug 2018 17:00:22 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:b472:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 17:00:21 -0700 (PDT) In-Reply-To: <201808162349.w7GNnuVN007292@repo.freebsd.org> References: <201808162349.w7GNnuVN007292@repo.freebsd.org> From: Conrad Meyer Date: Thu, 16 Aug 2018 17:00:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337933 - in head/tests: freebsd_test_suite sys/opencrypto To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:00:29 -0000 On Thu, Aug 16, 2018 at 4:49 PM, Alan Somers wrote: > Author: asomers > Date: Thu Aug 16 23:49:56 2018 > New Revision: 337933 > URL: https://svnweb.freebsd.org/changeset/base/337933 > > Log: > Fix sys/opencrypto/blake2_test when kern.cryptodevallowsoft=0 Thanks! From owner-svn-src-all@freebsd.org Fri Aug 17 00:23: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 3D305107B882; Fri, 17 Aug 2018 00:23:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0F9A811D6; Fri, 17 Aug 2018 00:23:07 +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 C193A20E98; Fri, 17 Aug 2018 00:23:07 +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 w7H0N7Vb027229; Fri, 17 Aug 2018 00:23:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H0N7lR027228; Fri, 17 Aug 2018 00:23:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170023.w7H0N7lR027228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 00:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r337935 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: cem X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 337935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:23:08 -0000 Author: cem Date: Fri Aug 17 00:23:07 2018 New Revision: 337935 URL: https://svnweb.freebsd.org/changeset/base/337935 Log: Bump my limit for libsodium import Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Thu Aug 16 23:58:22 2018 (r337934) +++ svnadmin/conf/sizelimit.conf Fri Aug 17 00:23:07 2018 (r337935) @@ -16,6 +16,7 @@ # First field is username, second field is the raised limit required. achim bapt +cem davidcs dim 20480000 imp From owner-svn-src-all@freebsd.org Fri Aug 17 00:23: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 1099A107B8FF; Fri, 17 Aug 2018 00:23:53 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B91AF8131B; Fri, 17 Aug 2018 00:23:52 +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 9AD4E20E9B; Fri, 17 Aug 2018 00:23:52 +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 w7H0Nq67027305; Fri, 17 Aug 2018 00:23:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H0Np0H027296; Fri, 17 Aug 2018 00:23:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170023.w7H0Np0H027296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 00:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2012/libsodium builds/msvc... X-SVN-Commit-Revision: 337936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:23:53 -0000 Author: cem Date: Fri Aug 17 00:23:50 2018 New Revision: 337936 URL: https://svnweb.freebsd.org/changeset/base/337936 Log: Bring in libsodium to sys/contrib Bring in https://github.com/jedisct1/libsodium at 461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified. libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl ("Networking and Cryptography Library," pronounced "salt") software library. At the risk of oversimplifying, libsodium primarily exists to make it easier to use NaCl. NaCl and libsodium provide high quality implementations of a number of useful cryptographic concepts (as well as the underlying primitics) seeing some adoption in newer network protocols. I considered but dismissed cleaning up the directory hierarchy and discarding artifacts of other build systems in favor of remaining close to upstream (and easing future updates). Nothing is integrated into the build system yet, so in that sense, no functional change. Added: head/sys/contrib/libsodium/ head/sys/contrib/libsodium/.gitignore head/sys/contrib/libsodium/.travis.yml head/sys/contrib/libsodium/AUTHORS head/sys/contrib/libsodium/ChangeLog head/sys/contrib/libsodium/LICENSE head/sys/contrib/libsodium/Makefile.am (contents, props changed) head/sys/contrib/libsodium/README.markdown head/sys/contrib/libsodium/THANKS head/sys/contrib/libsodium/appveyor.yml head/sys/contrib/libsodium/autogen.sh (contents, props changed) head/sys/contrib/libsodium/builds/ head/sys/contrib/libsodium/builds/.gitignore head/sys/contrib/libsodium/builds/Makefile.am (contents, props changed) head/sys/contrib/libsodium/builds/msvc/ head/sys/contrib/libsodium/builds/msvc/build/ head/sys/contrib/libsodium/builds/msvc/build/buildall.bat head/sys/contrib/libsodium/builds/msvc/build/buildbase.bat head/sys/contrib/libsodium/builds/msvc/properties/ head/sys/contrib/libsodium/builds/msvc/properties/Common.props head/sys/contrib/libsodium/builds/msvc/properties/DLL.props head/sys/contrib/libsodium/builds/msvc/properties/Debug.props head/sys/contrib/libsodium/builds/msvc/properties/DebugDEXE.props head/sys/contrib/libsodium/builds/msvc/properties/DebugDLL.props head/sys/contrib/libsodium/builds/msvc/properties/DebugLEXE.props head/sys/contrib/libsodium/builds/msvc/properties/DebugLIB.props head/sys/contrib/libsodium/builds/msvc/properties/DebugLTCG.props head/sys/contrib/libsodium/builds/msvc/properties/DebugSEXE.props head/sys/contrib/libsodium/builds/msvc/properties/EXE.props head/sys/contrib/libsodium/builds/msvc/properties/LIB.props head/sys/contrib/libsodium/builds/msvc/properties/LTCG.props head/sys/contrib/libsodium/builds/msvc/properties/Link.props head/sys/contrib/libsodium/builds/msvc/properties/Messages.props head/sys/contrib/libsodium/builds/msvc/properties/Output.props head/sys/contrib/libsodium/builds/msvc/properties/Release.props head/sys/contrib/libsodium/builds/msvc/properties/ReleaseDEXE.props head/sys/contrib/libsodium/builds/msvc/properties/ReleaseDLL.props head/sys/contrib/libsodium/builds/msvc/properties/ReleaseLEXE.props head/sys/contrib/libsodium/builds/msvc/properties/ReleaseLIB.props head/sys/contrib/libsodium/builds/msvc/properties/ReleaseLTCG.props head/sys/contrib/libsodium/builds/msvc/properties/ReleaseSEXE.props head/sys/contrib/libsodium/builds/msvc/properties/Win32.props head/sys/contrib/libsodium/builds/msvc/properties/x64.props head/sys/contrib/libsodium/builds/msvc/resource.h (contents, props changed) head/sys/contrib/libsodium/builds/msvc/resource.rc head/sys/contrib/libsodium/builds/msvc/version.h (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2010/ head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/ head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium.import.props head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium.import.xml (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium.sln head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/libsodium.props head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/libsodium.xml (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2012/ head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/ head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium.import.props head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium.import.xml (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium.sln head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/libsodium.props head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/libsodium.xml (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2013/ head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/ head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium.import.props head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium.import.xml (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium.sln head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/libsodium.props head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/libsodium.xml (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2015/ head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/ head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium.import.props head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium.import.xml (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium.sln head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/libsodium.props head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/libsodium.xml (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2017/ head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/ head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium.import.props head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium.import.xml (contents, props changed) head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium.sln head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/libsodium.props head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/libsodium.xml (contents, props changed) head/sys/contrib/libsodium/configure.ac head/sys/contrib/libsodium/contrib/ head/sys/contrib/libsodium/contrib/Findsodium.cmake head/sys/contrib/libsodium/contrib/Makefile.am (contents, props changed) head/sys/contrib/libsodium/dist-build/ head/sys/contrib/libsodium/dist-build/Makefile.am (contents, props changed) head/sys/contrib/libsodium/dist-build/android-arm.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/android-armv7-a.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/android-armv8-a.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/android-build.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/android-mips32.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/android-mips64.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/android-x86.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/android-x86_64.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/emscripten-symbols.def head/sys/contrib/libsodium/dist-build/emscripten.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/generate-emscripten-symbols.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/ios.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/msys2-win32.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/msys2-win64.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/nativeclient-pnacl.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/nativeclient-x86.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/nativeclient-x86_64.sh (contents, props changed) head/sys/contrib/libsodium/dist-build/osx.sh (contents, props changed) head/sys/contrib/libsodium/lgtm.yml head/sys/contrib/libsodium/libsodium-uninstalled.pc.in (contents, props changed) head/sys/contrib/libsodium/libsodium.pc.in (contents, props changed) head/sys/contrib/libsodium/libsodium.sln head/sys/contrib/libsodium/libsodium.vcxproj head/sys/contrib/libsodium/libsodium.vcxproj.filters head/sys/contrib/libsodium/m4/ head/sys/contrib/libsodium/m4/ax_check_catchable_abrt.m4 head/sys/contrib/libsodium/m4/ax_check_catchable_segv.m4 head/sys/contrib/libsodium/m4/ax_check_compile_flag.m4 head/sys/contrib/libsodium/m4/ax_check_define.m4 head/sys/contrib/libsodium/m4/ax_check_gnu_make.m4 head/sys/contrib/libsodium/m4/ax_check_link_flag.m4 head/sys/contrib/libsodium/m4/ax_pthread.m4 head/sys/contrib/libsodium/m4/ax_tls.m4 head/sys/contrib/libsodium/m4/ax_valgrind_check.m4 head/sys/contrib/libsodium/m4/ld-output-def.m4 head/sys/contrib/libsodium/msvc-scripts/ head/sys/contrib/libsodium/msvc-scripts/Makefile.am (contents, props changed) head/sys/contrib/libsodium/msvc-scripts/process.bat head/sys/contrib/libsodium/msvc-scripts/rep.vbs head/sys/contrib/libsodium/msvc-scripts/sodium.props head/sys/contrib/libsodium/packaging/ head/sys/contrib/libsodium/packaging/dotnet-core/ head/sys/contrib/libsodium/packaging/dotnet-core/.gitignore head/sys/contrib/libsodium/packaging/dotnet-core/README.md head/sys/contrib/libsodium/packaging/dotnet-core/libsodium.props head/sys/contrib/libsodium/packaging/dotnet-core/prepare.py (contents, props changed) head/sys/contrib/libsodium/packaging/dotnet-core/recipes/ head/sys/contrib/libsodium/packaging/dotnet-core/recipes/alpine-x64 head/sys/contrib/libsodium/packaging/dotnet-core/recipes/build head/sys/contrib/libsodium/packaging/dotnet-core/recipes/centos-x64 head/sys/contrib/libsodium/packaging/dotnet-core/recipes/debian-x64 head/sys/contrib/libsodium/packaging/dotnet-core/recipes/fedora-x64 head/sys/contrib/libsodium/packaging/dotnet-core/recipes/linux-x64 head/sys/contrib/libsodium/packaging/dotnet-core/recipes/opensuse-x64 head/sys/contrib/libsodium/packaging/dotnet-core/recipes/pack head/sys/contrib/libsodium/packaging/dotnet-core/recipes/test head/sys/contrib/libsodium/packaging/dotnet-core/recipes/ubuntu-x64 head/sys/contrib/libsodium/packaging/nuget/ head/sys/contrib/libsodium/packaging/nuget/.gitignore head/sys/contrib/libsodium/packaging/nuget/package.bat head/sys/contrib/libsodium/packaging/nuget/package.config head/sys/contrib/libsodium/packaging/nuget/package.gsl head/sys/contrib/libsodium/regen-msvc/ head/sys/contrib/libsodium/regen-msvc/libsodium.vcxproj head/sys/contrib/libsodium/regen-msvc/libsodium.vcxproj.filters head/sys/contrib/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl head/sys/contrib/libsodium/regen-msvc/libsodium.vcxproj.tpl head/sys/contrib/libsodium/regen-msvc/regen-msvc.py (contents, props changed) head/sys/contrib/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl head/sys/contrib/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl head/sys/contrib/libsodium/src/ head/sys/contrib/libsodium/src/Makefile.am (contents, props changed) head/sys/contrib/libsodium/src/libsodium/ head/sys/contrib/libsodium/src/libsodium/Makefile.am (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_aead/ head/sys/contrib/libsodium/src/libsodium/crypto_aead/aes256gcm/ head/sys/contrib/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/ head/sys/contrib/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_aead/chacha20poly1305/ head/sys/contrib/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/ head/sys/contrib/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/ head/sys/contrib/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/ head/sys/contrib/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_auth/ head/sys/contrib/libsodium/src/libsodium/crypto_auth/crypto_auth.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha256/ head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha512/ head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha512256/ head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_box/ head/sys/contrib/libsodium/src/libsodium/crypto_box/crypto_box.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_box/crypto_box_easy.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_box/crypto_box_seal.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/ head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/ head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/ head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/ head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/base.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/base2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/hchacha20/ head/sys/contrib/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha20.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/hsalsa20/ head/sys/contrib/libsodium/src/libsodium/crypto_core/hsalsa20/core_hsalsa20.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/ head/sys/contrib/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_core/salsa/ head/sys/contrib/libsodium/src/libsodium/crypto_core/salsa/ref/ head/sys/contrib/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/ head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/generichash_blake2.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/ head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-avx2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse41.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_hash/ head/sys/contrib/libsodium/src/libsodium/crypto_hash/crypto_hash.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha256/ head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha256/cp/ head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha512/ head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha512/cp/ head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha512/hash_sha512.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_kdf/ head/sys/contrib/libsodium/src/libsodium/crypto_kdf/blake2b/ head/sys/contrib/libsodium/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_kdf/crypto_kdf.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_kx/ head/sys/contrib/libsodium/src/libsodium/crypto_kx/crypto_kx.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/ head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/ head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/ head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/ head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/ head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/ head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-avx2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-avx512f.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/ head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/ head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/ head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/ head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/ head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/ head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts.S (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/ed25519/ head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10/ head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/ head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/ head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_secretstream/ head/sys/contrib/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1305/ head/sys/contrib/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/ head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/crypto_shorthash.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/ head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash_ref.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphashx24.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_sign/ head/sys/contrib/libsodium/src/libsodium/crypto_sign/crypto_sign.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign_ed25519_ref10.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u0.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u1.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u4.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/ref/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/crypto_stream.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/ref/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u1.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u4.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u8.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa2012/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa2012/ref/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa208/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa208/ref/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208_ref.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/xchacha20/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/xchacha20/stream_xchacha20.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_stream/xsalsa20/ head/sys/contrib/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/crypto_verify/ head/sys/contrib/libsodium/src/libsodium/crypto_verify/sodium/ head/sys/contrib/libsodium/src/libsodium/crypto_verify/sodium/verify.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/ head/sys/contrib/libsodium/src/libsodium/include/Makefile.am (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/ head/sys/contrib/libsodium/src/libsodium/include/sodium.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/core.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_aead_aes256gcm.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_auth.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha256.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_box.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_ed25519.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_hchacha20.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_hsalsa20.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_salsa20.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_salsa2012.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_salsa208.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_generichash.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_hash.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_kdf.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_kdf_blake2b.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_kx.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_onetimeauth.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_pwhash.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2id.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_secretbox.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_shorthash.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_shorthash_siphash24.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_sign.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_salsa20.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_salsa2012.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_salsa208.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_xchacha20.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_xsalsa20.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_verify_16.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_verify_32.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_verify_64.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/export.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/private/ head/sys/contrib/libsodium/src/libsodium/include/sodium/private/common.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/private/ed25519_ref10.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/private/implementations.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/private/mutex.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/randombytes.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/randombytes_nativeclient.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/randombytes_salsa20_random.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/randombytes_sysrandom.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/runtime.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/utils.h (contents, props changed) head/sys/contrib/libsodium/src/libsodium/include/sodium/version.h.in (contents, props changed) head/sys/contrib/libsodium/src/libsodium/randombytes/ head/sys/contrib/libsodium/src/libsodium/randombytes/nativeclient/ head/sys/contrib/libsodium/src/libsodium/randombytes/nativeclient/randombytes_nativeclient.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/randombytes/randombytes.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/randombytes/salsa20/ head/sys/contrib/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/randombytes/sysrandom/ head/sys/contrib/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/sodium/ head/sys/contrib/libsodium/src/libsodium/sodium/codecs.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/sodium/core.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/sodium/runtime.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/sodium/utils.c (contents, props changed) head/sys/contrib/libsodium/src/libsodium/sodium/version.c (contents, props changed) head/sys/contrib/libsodium/test/ head/sys/contrib/libsodium/test/Makefile.am (contents, props changed) head/sys/contrib/libsodium/test/constcheck.sh (contents, props changed) head/sys/contrib/libsodium/test/default/ head/sys/contrib/libsodium/test/default/Makefile.am (contents, props changed) head/sys/contrib/libsodium/test/default/aead_aes256gcm.c (contents, props changed) head/sys/contrib/libsodium/test/default/aead_aes256gcm.exp head/sys/contrib/libsodium/test/default/aead_chacha20poly1305.c (contents, props changed) head/sys/contrib/libsodium/test/default/aead_chacha20poly1305.exp head/sys/contrib/libsodium/test/default/aead_xchacha20poly1305.c (contents, props changed) head/sys/contrib/libsodium/test/default/aead_xchacha20poly1305.exp head/sys/contrib/libsodium/test/default/auth.c (contents, props changed) head/sys/contrib/libsodium/test/default/auth.exp head/sys/contrib/libsodium/test/default/auth2.c (contents, props changed) head/sys/contrib/libsodium/test/default/auth2.exp head/sys/contrib/libsodium/test/default/auth3.c (contents, props changed) head/sys/contrib/libsodium/test/default/auth3.exp head/sys/contrib/libsodium/test/default/auth5.c (contents, props changed) head/sys/contrib/libsodium/test/default/auth6.c (contents, props changed) head/sys/contrib/libsodium/test/default/auth6.exp head/sys/contrib/libsodium/test/default/auth7.c (contents, props changed) head/sys/contrib/libsodium/test/default/box.c (contents, props changed) head/sys/contrib/libsodium/test/default/box.exp head/sys/contrib/libsodium/test/default/box2.c (contents, props changed) head/sys/contrib/libsodium/test/default/box2.exp head/sys/contrib/libsodium/test/default/box7.c (contents, props changed) head/sys/contrib/libsodium/test/default/box8.c (contents, props changed) head/sys/contrib/libsodium/test/default/box_easy.c (contents, props changed) head/sys/contrib/libsodium/test/default/box_easy.exp head/sys/contrib/libsodium/test/default/box_easy2.c (contents, props changed) head/sys/contrib/libsodium/test/default/box_easy2.exp head/sys/contrib/libsodium/test/default/box_seal.c (contents, props changed) head/sys/contrib/libsodium/test/default/box_seal.exp head/sys/contrib/libsodium/test/default/box_seed.c (contents, props changed) head/sys/contrib/libsodium/test/default/box_seed.exp head/sys/contrib/libsodium/test/default/chacha20.c (contents, props changed) head/sys/contrib/libsodium/test/default/chacha20.exp head/sys/contrib/libsodium/test/default/cmptest.h (contents, props changed) head/sys/contrib/libsodium/test/default/codecs.c (contents, props changed) head/sys/contrib/libsodium/test/default/codecs.exp head/sys/contrib/libsodium/test/default/core1.c (contents, props changed) head/sys/contrib/libsodium/test/default/core1.exp head/sys/contrib/libsodium/test/default/core2.c (contents, props changed) head/sys/contrib/libsodium/test/default/core2.exp head/sys/contrib/libsodium/test/default/core3.c (contents, props changed) head/sys/contrib/libsodium/test/default/core3.exp head/sys/contrib/libsodium/test/default/core4.c (contents, props changed) head/sys/contrib/libsodium/test/default/core4.exp head/sys/contrib/libsodium/test/default/core5.c (contents, props changed) head/sys/contrib/libsodium/test/default/core5.exp head/sys/contrib/libsodium/test/default/core6.c (contents, props changed) head/sys/contrib/libsodium/test/default/core6.exp head/sys/contrib/libsodium/test/default/core_ed25519.c (contents, props changed) head/sys/contrib/libsodium/test/default/core_ed25519.exp head/sys/contrib/libsodium/test/default/ed25519_convert.c (contents, props changed) head/sys/contrib/libsodium/test/default/ed25519_convert.exp head/sys/contrib/libsodium/test/default/generichash.c (contents, props changed) head/sys/contrib/libsodium/test/default/generichash.exp head/sys/contrib/libsodium/test/default/generichash2.c (contents, props changed) head/sys/contrib/libsodium/test/default/generichash2.exp head/sys/contrib/libsodium/test/default/generichash3.c (contents, props changed) head/sys/contrib/libsodium/test/default/generichash3.exp head/sys/contrib/libsodium/test/default/hash.c (contents, props changed) head/sys/contrib/libsodium/test/default/hash.exp head/sys/contrib/libsodium/test/default/hash2.exp head/sys/contrib/libsodium/test/default/hash3.c (contents, props changed) head/sys/contrib/libsodium/test/default/hash3.exp head/sys/contrib/libsodium/test/default/index.html.tpl head/sys/contrib/libsodium/test/default/kdf.c (contents, props changed) head/sys/contrib/libsodium/test/default/kdf.exp head/sys/contrib/libsodium/test/default/keygen.c (contents, props changed) head/sys/contrib/libsodium/test/default/keygen.exp head/sys/contrib/libsodium/test/default/kx.c (contents, props changed) head/sys/contrib/libsodium/test/default/kx.exp head/sys/contrib/libsodium/test/default/metamorphic.c (contents, props changed) head/sys/contrib/libsodium/test/default/metamorphic.exp head/sys/contrib/libsodium/test/default/misuse.c (contents, props changed) head/sys/contrib/libsodium/test/default/nacl-test-wrapper.sh (contents, props changed) head/sys/contrib/libsodium/test/default/onetimeauth.c (contents, props changed) head/sys/contrib/libsodium/test/default/onetimeauth.exp head/sys/contrib/libsodium/test/default/onetimeauth2.c (contents, props changed) head/sys/contrib/libsodium/test/default/onetimeauth2.exp head/sys/contrib/libsodium/test/default/onetimeauth7.c (contents, props changed) head/sys/contrib/libsodium/test/default/pre.js.inc (contents, props changed) head/sys/contrib/libsodium/test/default/pwhash_argon2i.c (contents, props changed) head/sys/contrib/libsodium/test/default/pwhash_argon2i.exp head/sys/contrib/libsodium/test/default/pwhash_argon2id.c (contents, props changed) head/sys/contrib/libsodium/test/default/pwhash_argon2id.exp head/sys/contrib/libsodium/test/default/pwhash_scrypt.c (contents, props changed) head/sys/contrib/libsodium/test/default/pwhash_scrypt.exp head/sys/contrib/libsodium/test/default/pwhash_scrypt_ll.c (contents, props changed) head/sys/contrib/libsodium/test/default/pwhash_scrypt_ll.exp head/sys/contrib/libsodium/test/default/randombytes.c (contents, props changed) head/sys/contrib/libsodium/test/default/randombytes.exp head/sys/contrib/libsodium/test/default/scalarmult.c (contents, props changed) head/sys/contrib/libsodium/test/default/scalarmult.exp head/sys/contrib/libsodium/test/default/scalarmult2.c (contents, props changed) head/sys/contrib/libsodium/test/default/scalarmult2.exp head/sys/contrib/libsodium/test/default/scalarmult5.c (contents, props changed) head/sys/contrib/libsodium/test/default/scalarmult5.exp head/sys/contrib/libsodium/test/default/scalarmult6.c (contents, props changed) head/sys/contrib/libsodium/test/default/scalarmult6.exp head/sys/contrib/libsodium/test/default/scalarmult7.c (contents, props changed) head/sys/contrib/libsodium/test/default/scalarmult7.exp head/sys/contrib/libsodium/test/default/scalarmult_ed25519.c (contents, props changed) head/sys/contrib/libsodium/test/default/scalarmult_ed25519.exp head/sys/contrib/libsodium/test/default/secretbox.c (contents, props changed) head/sys/contrib/libsodium/test/default/secretbox.exp head/sys/contrib/libsodium/test/default/secretbox2.c (contents, props changed) head/sys/contrib/libsodium/test/default/secretbox2.exp head/sys/contrib/libsodium/test/default/secretbox7.c (contents, props changed) head/sys/contrib/libsodium/test/default/secretbox8.c (contents, props changed) head/sys/contrib/libsodium/test/default/secretbox_easy.c (contents, props changed) head/sys/contrib/libsodium/test/default/secretbox_easy.exp head/sys/contrib/libsodium/test/default/secretbox_easy2.c (contents, props changed) head/sys/contrib/libsodium/test/default/secretbox_easy2.exp head/sys/contrib/libsodium/test/default/secretstream.c (contents, props changed) head/sys/contrib/libsodium/test/default/secretstream.exp head/sys/contrib/libsodium/test/default/shorthash.c (contents, props changed) head/sys/contrib/libsodium/test/default/shorthash.exp head/sys/contrib/libsodium/test/default/sign.c (contents, props changed) head/sys/contrib/libsodium/test/default/sign.exp head/sys/contrib/libsodium/test/default/siphashx24.c (contents, props changed) head/sys/contrib/libsodium/test/default/siphashx24.exp head/sys/contrib/libsodium/test/default/sodium_core.c (contents, props changed) head/sys/contrib/libsodium/test/default/sodium_core.exp head/sys/contrib/libsodium/test/default/sodium_utils.c (contents, props changed) head/sys/contrib/libsodium/test/default/sodium_utils.exp head/sys/contrib/libsodium/test/default/sodium_utils2.c (contents, props changed) head/sys/contrib/libsodium/test/default/sodium_utils2.exp head/sys/contrib/libsodium/test/default/sodium_utils3.c (contents, props changed) head/sys/contrib/libsodium/test/default/sodium_utils3.exp head/sys/contrib/libsodium/test/default/sodium_version.c (contents, props changed) head/sys/contrib/libsodium/test/default/sodium_version.exp head/sys/contrib/libsodium/test/default/stream.c (contents, props changed) head/sys/contrib/libsodium/test/default/stream.exp head/sys/contrib/libsodium/test/default/stream2.c (contents, props changed) head/sys/contrib/libsodium/test/default/stream2.exp head/sys/contrib/libsodium/test/default/stream3.c (contents, props changed) head/sys/contrib/libsodium/test/default/stream3.exp head/sys/contrib/libsodium/test/default/stream4.c (contents, props changed) head/sys/contrib/libsodium/test/default/stream4.exp head/sys/contrib/libsodium/test/default/verify1.c (contents, props changed) head/sys/contrib/libsodium/test/default/verify1.exp head/sys/contrib/libsodium/test/default/wintest.bat head/sys/contrib/libsodium/test/default/xchacha20.c (contents, props changed) head/sys/contrib/libsodium/test/default/xchacha20.exp head/sys/contrib/libsodium/test/quirks/ head/sys/contrib/libsodium/test/quirks/quirks.h (contents, props changed) Added: head/sys/contrib/libsodium/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libsodium/.gitignore Fri Aug 17 00:23:50 2018 (r337936) @@ -0,0 +1,156 @@ +*.bc +*.dSYM +*.done +*.final +*.gcda +*.gcno +*.i +*.la +*.lo +*.log +*.mem +*.nexe +*.o +*.plist +*.scan +*.sdf +*.status +*.tar.* +*.wasm +*.wast +*~ +.DS_Store +.deps +.dirstamp +.done +.libs +/bin/ +/obj/ +Build +INSTALL +Makefile +Makefile.in +Vagrantfile +aclocal.m4 +android-toolchain +android-toolchain-* +autom4te.cache +build +compile +confdefs.h +config.* +configure +configure.lineno +coverage.info +depcomp +install-sh +libsodium-*.tar.bz2 +libsodium-*.tar.gz +libsodium-*.vcproj +libsodium-*.vcproj.filters +libsodium-*.vcxproj +libsodium-*.vcxproj.filters +libsodium-android-* +libsodium-ios +libsodium-js +libsodium-js-* +libsodium-nativeclient +libsodium-nativeclient-* +libsodium-osx +libsodium-uninstalled.pc +libsodium-win32 +libsodium-win64 +libsodium.pc +libtool +ltmain.sh +m4/argz.m4 +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 +man/*.html +man/Makefile.in +missing +src/libsodium/*.def +src/libsodium/include/sodium/version.h +stamp-* +test-driver +test/default/browser +test/default/*.asm.js +test/default/*.res +test/default/*.trs +test/default/aead_aes256gcm +test/default/aead_chacha20poly1305 +test/default/aead_xchacha20poly1305 +test/default/auth +test/default/auth2 +test/default/auth3 +test/default/auth5 +test/default/auth6 +test/default/auth7 +test/default/box +test/default/box2 +test/default/box7 +test/default/box8 +test/default/box_easy +test/default/box_easy2 +test/default/box_seal +test/default/box_seed +test/default/chacha20 +test/default/codecs +test/default/core_ed25519 +test/default/core1 +test/default/core2 +test/default/core3 +test/default/core4 +test/default/core5 +test/default/core6 +test/default/ed25519_convert +test/default/generichash +test/default/generichash2 +test/default/generichash3 +test/default/hash +test/default/hash3 +test/default/kdf +test/default/keygen +test/default/kx +test/default/metamorphic +test/default/misuse +test/default/onetimeauth +test/default/onetimeauth2 +test/default/onetimeauth7 +test/default/pwhash_argon2i +test/default/pwhash_argon2id +test/default/pwhash_scrypt +test/default/pwhash_scrypt_ll +test/default/randombytes +test/default/scalarmult +test/default/scalarmult_ed25519 +test/default/scalarmult2 +test/default/scalarmult5 +test/default/scalarmult6 +test/default/scalarmult7 +test/default/secretbox +test/default/secretbox2 +test/default/secretbox7 +test/default/secretbox8 +test/default/secretbox_easy +test/default/secretbox_easy2 +test/default/secretstream +test/default/shorthash +test/default/sign +test/default/siphashx24 +test/default/sodium_core +test/default/sodium_utils +test/default/sodium_utils2 +test/default/sodium_utils3 +test/default/sodium_version +test/default/stream +test/default/stream2 +test/default/stream3 +test/default/stream4 +test/default/verify1 +test/default/xchacha20 +test/js.done +testing Added: head/sys/contrib/libsodium/.travis.yml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libsodium/.travis.yml Fri Aug 17 00:23:50 2018 (r337936) @@ -0,0 +1,33 @@ +sudo: false + +language: c + +os: + - linux + +compiler: + - clang + - gcc + - g++ + +install: + - ./autogen.sh + - env CC=tcc CFLAGS='-w' ./configure --prefix=/tmp --disable-dependency-tracking --disable-shared || cat config.log + - make -j $(nproc) && make check && make install + - env CC=tcc CPPFLAGS='-I/tmp/include' LDFLAGS='-L/tmp/lib' LD_LIBRARY_PATH='/tmp/lib' ./test/constcheck.sh + - make uninstall + - make distclean + +script: + - ./configure --disable-dependency-tracking + - if [ "$TRAVIS_OS_NAME" = 'linux' -a "$CC" = 'gcc' ]; then make -j $(nproc) CFLAGS='-g0' > /dev/null && cp src/libsodium/.libs/libsodium.so lib.so && make clean > /dev/null && make CFLAGS='-g0' CPPFLAGS='-DSODIUM_C99\(X\)=' > /dev/null && cp src/libsodium/.libs/libsodium.so lib-oldc.so && cmp lib.so lib-oldc.so && echo No binary changes && make clean > /dev/null ; fi + - make distcheck + - make distclean > /dev/null + - ./configure --disable-dependency-tracking --enable-minimal + - make check + - ( echo '#include ' ; echo 'int main(void) { return sodium_init(); }' ) > /tmp/main.c && gcc -Isrc/libsodium/include -Isrc/libsodium/include/sodium $(find src -name '*.c' -o -name '*.S') /tmp/main.c + +addons: + apt: + packages: + - tcc Added: head/sys/contrib/libsodium/AUTHORS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libsodium/AUTHORS Fri Aug 17 00:23:50 2018 (r337936) @@ -0,0 +1,135 @@ + +Designers +========= + +argon2 Alex Biryukov + Daniel Dinu + Dmitry Khovratovich + +blake2 Jean-Philippe Aumasson + Christian Winnerlein + Samuel Neves + Zooko Wilcox-O'Hearn + +chacha20 Daniel J. Bernstein + +chacha20poly1305 Adam Langley + Yoav Nir + +curve25519 Daniel J. Bernstein + +curve25519xsalsa20poly1305 Daniel J. Bernstein + +ed25519 Daniel J. Bernstein + Bo-Yin Yang + Niels Duif + Peter Schwabe + Tanja Lange + +poly1305 Daniel J. Bernstein + +salsa20 Daniel J. Bernstein + +scrypt Colin Percival + +siphash Jean-Philippe Aumasson + Daniel J. Bernstein + +Implementors +============ + +crypto_aead/aes256gcm/aesni Romain Dolbeau + Frank Denis + +crypto_aead/chacha20poly1305 Frank Denis + +crypto_aead/xchacha20poly1305 Frank Denis + Jason A. Donenfeld + +crypto_auth/hmacsha256 Colin Percival +crypto_auth/hmacsha512 +crypto_auth/hmacsha512256 + +crypto_box/curve25519xsalsa20poly1305 Daniel J. Bernstein + +crypto_box/curve25519xchacha20poly1305 Frank Denis + +crypto_core/ed25519 Daniel J. Bernstein + Adam Langley + +crypto_core/hchacha20 Frank Denis + +crypto_core/hsalsa20 Daniel J. Bernstein +crypto_core/salsa + +crypto_generichash/blake2b Jean-Philippe Aumasson + Christian Winnerlein + Samuel Neves + Zooko Wilcox-O'Hearn + +crypto_hash/sha256 Colin Percival +crypto_hash/sha512 +crypto_hash/sha512256 + +crypto_kdf Frank Denis + +crypto_kx Frank Denis + +crypto_onetimeauth/poly1305/donna Andrew "floodyberry" Moon +crypto_onetimeauth/poly1305/sse2 + +crypto_pwhash/argon2 Samuel Neves + Dmitry Khovratovich + Jean-Philippe Aumasson + Daniel Dinu + Thomas Pornin + +crypto_pwhash/scryptsalsa208sha256 Colin Percival + Alexander Peslyak + +crypto_scalarmult/curve25519/ref10 Daniel J. Bernstein + +crypto_scalarmult/curve25519/sandy2x Tung Chou + +crypto_scalarmult/ed25519 Frank Denis + +crypto_secretbox/xsalsa20poly1305 Daniel J. Bernstein + +crypto_secretbox/xchacha20poly1305 Frank Denis + +crypto_secretstream/xchacha20poly1305 Frank Denis + +crypto_shorthash/siphash24 Jean-Philippe Aumasson + Daniel J. Bernstein + +crypto_sign/ed25519 Peter Schwabe + Daniel J. Bernstein + Niels Duif + Tanja Lange + Bo-Yin Yang + +crypto_stream/chacha20/ref Daniel J. Bernstein + +crypto_stream/chacha20/dolbeau Romain Dolbeau + Daniel J. Bernstein + +crypto_stream/salsa20/ref Daniel J. Bernstein +crypto_stream/salsa20/xmm6 + +crypto_stream/salsa20/xmm6int Romain Dolbeau + Daniel J. Bernstein + +crypto_stream/salsa2012/ref Daniel J. Bernstein +crypto_stream/salsa2008/ref + +crypto_stream/xchacha20 Frank Denis + +crypto_verify Frank Denis + +sodium/codecs.c Frank Denis + Thomas Pornin + Christian Winnerlein + +sodium/core.c Frank Denis +sodium/runtime.h +sodium/utils.c Added: head/sys/contrib/libsodium/ChangeLog ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libsodium/ChangeLog Fri Aug 17 00:23:50 2018 (r337936) @@ -0,0 +1,505 @@ + +* Version 1.0.16 + - Signatures computations and verifications are now way faster on +64-bit platforms with compilers supporting 128-bit arithmetic (gcc, +clang, icc). This includes the WebAssembly target. + - New low-level APIs for computations over edwards25519: +`crypto_scalarmult_ed25519()`, `crypto_scalarmult_ed25519_base()`, +`crypto_core_ed25519_is_valid_point()`, `crypto_core_ed25519_add()`, +`crypto_core_ed25519_sub()` and `crypto_core_ed25519_from_uniform()` +(elligator representative to point). + - `crypto_sign_open()`, `crypto_sign_verify_detached() and +`crypto_sign_edwards25519sha512batch_open` now reject public keys in +non-canonical form in addition to low-order points. + - The library can be built with `ED25519_NONDETERMINISTIC` defined in +order to use synthetic nonces for EdDSA. This is disabled by default. + - Webassembly: `crypto_pwhash_*()` functions are now included in +non-sumo builds. + - `sodium_stackzero()` was added to wipe content off the stack. + - Android: support new SDKs where unified headers have become the +default. + - The Salsa20-based PRNG example is now thread-safe on platforms with +support for thread-local storage, optionally mixes bits from RDRAND. + - CMAKE: static library detection on Unix systems has been improved +(thanks to @BurningEnlightenment, @nibua-r, @mellery451) + - Argon2 and scrypt are slightly faster on Linux. + +* Version 1.0.15 + - The default password hashing algorithm is now Argon2id. The +`pwhash_str_verify()` function can still verify Argon2i hashes +without any changes, and `pwhash()` can still compute Argon2i hashes +as well. + - The aes128ctr primitive was removed. It was slow, non-standard, not +authenticated, and didn't seem to be used by any opensource project. + - Argon2id required at least 3 passes like Argon2i, despite a minimum +of `1` as defined by the `OPSLIMIT_MIN` constant. This has been fixed. + - The secretstream construction was slightly changed to be consistent +with forthcoming variants. + - The Javascript and Webassembly versions have been merged, and the +module now returns a `.ready` promise that will resolve after the +Webassembly code is loaded and compiled. + - Note that due to these incompatible changes, the library version +major was bumped up. + +* Version 1.0.14 + - iOS binaries should now be compatible with WatchOS and TVOS. + - WebAssembly is now officially supported. Special thanks to +@facekapow and @pepyakin who helped to make it happen. + - Internal consistency checks failing and primitives used with +dangerous/out-of-bounds/invalid parameters used to call abort(3). +Now, a custom handler *that doesn't return* can be set with the +`set_sodium_misuse()` function. It still aborts by default or if the +handler ever returns. This is not a replacement for non-fatal, +expected runtime errors. This handler will be only called in +unexpected situations due to potential bugs in the library or in +language bindings. + - `*_MESSAGEBYTES_MAX` macros (and the corresponding +`_messagebytes_max()` symbols) have been added to represent the +maximum message size that can be safely handled by a primitive. +Language bindings are encouraged to check user inputs against these +maximum lengths. + - The test suite has been extended to cover more edge cases. + - crypto_sign_ed25519_pk_to_curve25519() now rejects points that are +not on the curve, or not in the main subgroup. + - Further changes have been made to ensure that smart compilers will +not optimize out code that we don't want to be optimized. + - Visual Studio solutions are now included in distribution tarballs. + - The `sodium_runtime_has_*` symbols for CPU features detection are +now defined as weak symbols, i.e. they can be replaced with an +application-defined implementation. This can be useful to disable +AVX* when temperature/power consumption is a concern. + - `crypto_kx_*()` now aborts if called with no non-NULL pointers to +store keys to. + - SSE2 implementations of `crypto_verify_*()` have been added. + - Passwords can be hashed using a specific algorithm with the new +`crypto_pwhash_str_alg()` function. + - Due to popular demand, base64 encoding (`sodium_bin2base64()`) and +decoding (`sodium_base642bin()`) have been implemented. + - A new `crypto_secretstream_*()` API was added to safely encrypt files +and multi-part messages. + - The `sodium_pad()` and `sodium_unpad()` helper functions have been +added in order to add & remove padding. + - An AVX512 optimized implementation of Argon2 has been added (written +by Ondrej MosnáÄek, thanks!) + - The `crypto_pwhash_str_needs_rehash()` function was added to check if +a password hash string matches the given parameters, or if it needs an +update. + - The library can now be compiled with recent versions of +emscripten/binaryen that don't allow multiple variables declarations +using a single `var` statement. + +* Version 1.0.13 + - Javascript: the sumo builds now include all symbols. They were +previously limited to symbols defined in minimal builds. + - The public `crypto_pwhash_argon2i_MEMLIMIT_MAX` constant was +incorrectly defined on 32-bit platforms. This has been fixed. + - Version 1.0.12 didn't compile on OpenBSD/i386 using the base gcc +compiler. This has been fixed. + - The Android compilation scripts have been updated for NDK r14b. + - armv7s-optimized code was re-added to iOS builds. + - An AVX2 optimized implementation of the Argon2 round function was +added. + - The Argon2id variant of Argon2 has been implemented. The +high-level `crypto_pwhash_str_verify()` function automatically detects +the algorithm and can verify both Argon2i and Argon2id hashed passwords. +The default algorithm for newly hashed passwords remains Argon2i in +this version to avoid breaking compatibility with verifiers running +libsodium <= 1.0.12. + - A `crypto_box_curve25519xchacha20poly1305_seal*()` function set was +implemented. + - scrypt was removed from minimal builds. + - libsodium is now available on NuGet. + +* Version 1.0.12 + - Ed25519ph was implemented, adding a multi-part signature API +(`crypto_sign_init()`, `crypto_sign_update()`, `crypto_sign_final_*()`). + - New constants and related accessors have been added for Scrypt and +Argon2. + - XChaCha20 has been implemented. Like XSalsa20, this construction +extends the ChaCha20 cipher to accept a 192-bit nonce. This makes it safe +to use ChaCha20 with random nonces. + - `crypto_secretbox`, `crypto_box` and `crypto_aead` now offer +variants leveraging XChaCha20. + - SHA-2 is about 20% faster, which also gives a speed boost to +signature and signature verification. + - AVX2 implementations of Salsa20 and ChaCha20 have been added. They +are twice as fast as the SSE2 implementations. The speed gain is +even more significant on Windows, that previously didn't use +vectorized implementations. + - New high-level API: `crypto_kdf`, to easily derive one or more +subkeys from a master key. + - Siphash with a 128-bit output has been implemented, and is +available as `crypto_shorthash_siphashx_*`. + - New `*_keygen()` helpers functions have been added to create secret +keys for all constructions. This improves code clarity and can prevent keys +from being partially initialized. + - A new `randombytes_buf_deterministic()` function was added to +deterministically fill a memory region with pseudorandom data. This +function can especially be useful to write reproducible tests. + - A preliminary `crypto_kx_*()` API was added to compute shared session +keys. + - AVX2 detection is more reliable. + - The pthreads library is not required any more when using MingW. + - `contrib/Findsodium.cmake` was added as an example to include +libsodium in a project using cmake. + - Compatibility with gcc 2.x has been restored. + - Minimal builds can be checked using `sodium_library_minimal()`. + - The `--enable-opt` compilation switch has become compatible with more +platforms. + - Android builds are now using clang on platforms where it is +available. + +* Version 1.0.11 + - `sodium_init()` is now thread-safe, and can be safely called multiple +times. + - Android binaries now properly support 64-bit Android, targeting +platform 24, but without breaking compatibility with platforms 16 and +21. + - Better support for old gcc versions. + - On FreeBSD, core dumps are disabled on regions allocated with +sodium allocation functions. + - AVX2 detection was fixed, resulting in faster Blake2b hashing on +platforms where it was not properly detected. + - The Sandy2x Curve25519 implementation was not as fast as expected +on some platforms. This has been fixed. + - The NativeClient target was improved. Most notably, it now supports +optimized implementations, and uses pepper_49 by default. + - The library can be compiled with recent Emscripten versions. +Changes have been made to produce smaller code, and the default heap +size was reduced in the standard version. + - The code can now be compiled on SLES11 service pack 4. + - Decryption functions can now accept a NULL pointer for the output. +This checks the MAC without writing the decrypted message. + - crypto_generichash_final() now returns -1 if called twice. + - Support for Visual Studio 2008 was improved. + +* Version 1.0.10 + - This release only fixes a compilation issue reported with some older +gcc versions. There are no functional changes over the previous release. + +* Version 1.0.9 + - The Javascript target now includes a `--sumo` option to include all +the symbols of the original C library. + - A detached API was added to the ChaCha20-Poly1305 and AES256-GCM +implementations. + - The Argon2i password hashing function was added, and is accessible +directly and through a new, high-level `crypto_pwhash` API. The scrypt +function remains available as well. + - A speed-record AVX2 implementation of BLAKE2b was added (thanks to +Samuel Neves). + - The library can now be compiled using C++Builder (thanks to @jcolli44) + - Countermeasures for Ed25519 signatures malleability have been added +to match the irtf-cfrg-eddsa draft (note that malleability is irrelevant to +the standard definition of signature security). Signatures with a small-order +`R` point are now also rejected. + - Some implementations are now slightly faster when using the Clang +compiler. + - The HChaCha20 core function was implemented (`crypto_core_hchacha20()`). + - No-op stubs were added for all AES256-GCM public functions even when +compiled on non-Intel platforms. + - `crypt_generichash_blake2b_statebytes()` was added. + - New macros were added for the IETF variant of the ChaCha20-Poly1305 +construction. + - The library can now be compiled on Minix. + - HEASLR is now enabled on MinGW builds. + +* Version 1.0.8 + - Handle the case where the CPU supports AVX, but we are running +on an hypervisor with AVX disabled/not supported. + - Faster (2x) scalarmult_base() when using the ref10 implementation. + +* Version 1.0.7 + - More functions whose return value should be checked have been +tagged with `__attribute__ ((warn_unused_result))`: `crypto_box_easy()`, +`crypto_box_detached()`, `crypto_box_beforenm()`, `crypto_box()`, and +`crypto_scalarmult()`. + - Sandy2x, the fastest Curve25519 implementation ever, has been +merged in, and is automatically used on CPUs supporting the AVX +instructions set. + - An SSE2 optimized implementation of Poly1305 was added, and is +twice as fast as the portable one. + - An SSSE3 optimized implementation of ChaCha20 was added, and is +twice as fast as the portable one. + - Faster `sodium_increment()` for common nonce sizes. + - New helper functions have been added: `sodium_is_zero()` and + `sodium_add()`. + - `sodium_runtime_has_aesni()` now properly detects the CPU flag when + compiled using Visual Studio. + +* Version 1.0.6 + - Optimized implementations of Blake2 have been added for modern +Intel platforms. `crypto_generichash()` is now faster than MD5 and SHA1 +implementations while being far more secure. + - Functions for which the return value should be checked have been +tagged with `__attribute__ ((warn_unused_result))`. This will +intentionally break code compiled with `-Werror` that didn't bother +checking critical return values. + - The `crypto_sign_edwards25519sha512batch_*()` functions have been +tagged as deprecated. + - Undocumented symbols that were exported, but were only useful for +internal purposes have been removed or made private: +`sodium_runtime_get_cpu_features()`, the implementation-specific +`crypto_onetimeauth_poly1305_donna()` symbols, +`crypto_onetimeauth_poly1305_set_implementation()`, +`crypto_onetimeauth_poly1305_implementation_name()` and +`crypto_onetimeauth_pick_best_implementation()`. + - `sodium_compare()` now works as documented, and compares numbers +in little-endian format instead of behaving like `memcmp()`. + - The previous changes should not break actual applications, but to be +safe, the library version major was incremented. + - `sodium_runtime_has_ssse3()` and `sodium_runtime_has_sse41()` have +been added. + - The library can now be compiled with the CompCert compiler. + +* Version 1.0.5 + - Compilation issues on some platforms were fixed: missing alignment +directives were added (required at least on RHEL-6/i386), a workaround +for a VRP bug on gcc/armv7 was added, and the library can now be compiled +with the SunPro compiler. + - Javascript target: io.js is not supported any more. Use nodejs. + +* Version 1.0.4 + - Support for AES256-GCM has been added. This requires +a CPU with the aesni and pclmul extensions, and is accessible via the +crypto_aead_aes256gcm_*() functions. + - The Javascript target doesn't use eval() any more, so that the +library can be used in Chrome packaged applications. + - QNX and CloudABI are now supported. + - Support for NaCl has finally been added. + - ChaCha20 with an extended (96 bit) nonce and a 32-bit counter has +been implemented as crypto_stream_chacha20_ietf(), +crypto_stream_chacha20_ietf_xor() and crypto_stream_chacha20_ietf_xor_ic(). +An IETF-compatible version of ChaCha20Poly1305 is available as +crypto_aead_chacha20poly1305_ietf_npubbytes(), +crypto_aead_chacha20poly1305_ietf_encrypt() and +crypto_aead_chacha20poly1305_ietf_decrypt(). + - The sodium_increment() helper function has been added, to increment +an arbitrary large number (such as a nonce). + - The sodium_compare() helper function has been added, to compare +arbitrary large numbers (such as nonces, in order to prevent replay +attacks). + +* Version 1.0.3 + - In addition to sodium_bin2hex(), sodium_hex2bin() is now a +constant-time function. + - crypto_stream_xsalsa20_ic() has been added. + - crypto_generichash_statebytes(), crypto_auth_*_statebytes() and +crypto_hash_*_statebytes() have been added in order to retrieve the +size of structures keeping states from foreign languages. + - The JavaScript target doesn't require /dev/urandom or an external +randombytes() implementation any more. Other minor Emscripten-related +improvements have been made in order to support libsodium.js + - Custom randombytes implementations do not need to provide their own +implementation of randombytes_uniform() any more. randombytes_stir() +and randombytes_close() can also be NULL pointers if they are not +required. + - On Linux, getrandom(2) is being used instead of directly accessing +/dev/urandom, if the kernel supports this system call. + - crypto_box_seal() and crypto_box_seal_open() have been added. + - Visual Studio 2015 is now supported. + +* Version 1.0.2 + - The _easy and _detached APIs now support precalculated keys; +crypto_box_easy_afternm(), crypto_box_open_easy_afternm(), +crypto_box_detached_afternm() and crypto_box_open_detached_afternm() +have been added as an alternative to the NaCl interface. + - Memory allocation functions can now be used on operating systems with +no memory protection. + - crypto_sign_open() and crypto_sign_edwards25519sha512batch_open() +now accept a NULL pointer instead of a pointer to the message size, if +storing this information is not required. + - The close-on-exec flag is now set on the descriptor returned when +opening /dev/urandom. + - A libsodium-uninstalled.pc file to use pkg-config even when +libsodium is not installed, has been added. + - The iOS target now includes armv7s and arm64 optimized code, as well +as i386 and x86_64 code for the iOS simulator. + - sodium_free() can now be called on regions with PROT_NONE protection. + - The Javascript tests can run on Ubuntu, where the node binary was +renamed nodejs. io.js can also be used instead of node. + +* Version 1.0.1 + - DLL_EXPORT was renamed SODIUM_DLL_EXPORT in order to avoid +collisions with similar macros defined by other libraries. + - sodium_bin2hex() is now constant-time. + - crypto_secretbox_detached() now supports overlapping input and output +regions. + - NaCl's donna_c64 implementation of curve25519 was reading an extra byte +past the end of the buffer containing the base point. This has been +fixed. + +* Version 1.0.0 + - The API and ABI are now stable. New features will be added, but +backward-compatibility is guaranteed through all the 1.x.y releases. + - crypto_sign() properly works with overlapping regions again. Thanks +to @pysiak for reporting this regression introduced in version 0.6.1. + - The test suite has been extended. + +* Version 0.7.1 (1.0 RC2) + - This is the second release candidate of Sodium 1.0. Minor +compilation, readability and portability changes have been made and the +test suite was improved, but the API is the same as the previous release +candidate. + +* Version 0.7.0 (1.0 RC1) + - Allocating memory to store sensitive data can now be done using +sodium_malloc() and sodium_allocarray(). These functions add guard +pages around the protected data to make it less likely to be +accessible in a heartbleed-like scenario. In addition, the protection +for memory regions allocated that way can be changed using +sodium_mprotect_noaccess(), sodium_mprotect_readonly() and +sodium_mprotect_readwrite(). + - ed25519 keys can be converted to curve25519 keys with +crypto_sign_ed25519_pk_to_curve25519() and +crypto_sign_ed25519_sk_to_curve25519(). This allows using the same +keys for signature and encryption. + - The seed and the public key can be extracted from an ed25519 key +using crypto_sign_ed25519_sk_to_seed() and crypto_sign_ed25519_sk_to_pk(). + - aes256 was removed. A timing-attack resistant implementation might +be added later, but not before version 1.0 is tagged. + - The crypto_pwhash_scryptxsalsa208sha256_* compatibility layer was +removed. Use crypto_pwhash_scryptsalsa208sha256_*. + - The compatibility layer for implementation-specific functions was +removed. + - Compilation issues with Mingw64 on MSYS (not MSYS2) were fixed. + - crypto_pwhash_scryptsalsa208sha256_STRPREFIX was added: it contains +the prefix produced by crypto_pwhash_scryptsalsa208sha256_str() + +* Version 0.6.1 + - Important bug fix: when crypto_sign_open() was given a signed +message too short to even contain a signature, it was putting an +unlimited amount of zeros into the target buffer instead of +immediately returning -1. The bug was introduced in version 0.5.0. + - New API: crypto_sign_detached() and crypto_sign_verify_detached() +to produce and verify ed25519 signatures without having to duplicate +the message. + - New ./configure switch: --enable-minimal, to create a smaller +library, with only the functions required for the high-level API. +Mainly useful for the JavaScript target and embedded systems. + - All the symbols are now exported by the Emscripten build script. + - The pkg-config .pc file is now always installed even if the +pkg-config tool is not available during the installation. + +* Version 0.6.0 + - The ChaCha20 stream cipher has been added, as crypto_stream_chacha20_* + - The ChaCha20Poly1305 AEAD construction has been implemented, as +crypto_aead_chacha20poly1305_* + - The _easy API does not require any heap allocations any more and +does not have any overhead over the NaCl API. With the password +hashing function being an obvious exception, the library doesn't +allocate and will not allocate heap memory ever. + - crypto_box and crypto_secretbox have a new _detached API to store +the authentication tag and the encrypted message separately. + - crypto_pwhash_scryptxsalsa208sha256*() functions have been renamed +crypto_pwhash_scryptsalsa208sha256*(). + - The low-level crypto_pwhash_scryptsalsa208sha256_ll() function +allows setting individual parameters of the scrypt function. + - New macros and functions for recommended crypto_pwhash_* parameters +have been added. + - Similarly to crypto_sign_seed_keypair(), crypto_box_seed_keypair() +has been introduced to deterministically generate a key pair from a seed. + - crypto_onetimeauth() now provides a streaming interface. + - crypto_stream_chacha20_xor_ic() and crypto_stream_salsa20_xor_ic() +have been added to use a non-zero initial block counter. + - On Windows, CryptGenRandom() was replaced by RtlGenRandom(), which +doesn't require the Crypt API. + - The high bit in curve25519 is masked instead of processing the key as +a 256-bit value. + - The curve25519 ref implementation was replaced by the latest ref10 +implementation from Supercop. + - sodium_mlock() now prevents memory from being included in coredumps +on Linux 3.4+ + +* Version 0.5.0 + - sodium_mlock()/sodium_munlock() have been introduced to lock pages +in memory before storing sensitive data, and to zero them before +unlocking them. + - High-level wrappers for crypto_box and crypto_secretbox +(crypto_box_easy and crypto_secretbox_easy) can be used to avoid +dealing with the specific memory layout regular functions depend on. + - crypto_pwhash_scryptsalsa208sha256* functions have been added +to derive a key from a password, and for password storage. + - Salsa20 and ed25519 implementations now support overlapping +inputs/keys/outputs (changes imported from supercop-20140505). + - New build scripts for Visual Studio, Emscripten, different Android +architectures and msys2 are available. + - The poly1305-53 implementation has been replaced with Floodyberry's +poly1305-donna32 and poly1305-donna64 implementations. + - sodium_hex2bin() has been added to complement sodium_bin2hex(). + - On OpenBSD and Bitrig, arc4random() is used instead of reading +/dev/urandom. + - crypto_auth_hmac_sha512() has been implemented. + - sha256 and sha512 now have a streaming interface. + - hmacsha256, hmacsha512 and hmacsha512256 now support keys of +arbitrary length, and have a streaming interface. + - crypto_verify_64() has been implemented. + - first-class Visual Studio build system, thanks to @evoskuil + - CPU features are now detected at runtime. + +* Version 0.4.5 + - Restore compatibility with OSX <= 10.6 + +* Version 0.4.4 + - Visual Studio is officially supported (VC 2010 & VC 2013) + - mingw64 is now supported + - big-endian architectures are now supported as well + - The donna_c64 implementation of curve25519_donna_c64 now handles +non-canonical points like the ref implementation + - Missing scalarmult_curve25519 and stream_salsa20 constants are now exported + - A crypto_onetimeauth_poly1305_ref() wrapper has been added + +* Version 0.4.3 + - crypto_sign_seedbytes() and crypto_sign_SEEDBYTES were added. + - crypto_onetimeauth_poly1305_implementation_name() was added. + - poly1305-ref has been replaced by a faster implementation, +Floodyberry's poly1305-donna-unrolled. + - Stackmarkings have been added to assembly code, for Hardened Gentoo. + - pkg-config can now be used in order to retrieve compilations flags for +using libsodium. + - crypto_stream_aes256estream_*() can now deal with unaligned input +on platforms that require word alignment. + - portability improvements. + +* Version 0.4.2 + - All NaCl constants are now also exposed as functions. + - The Android and iOS cross-compilation script have been improved. + - libsodium can now be cross-compiled to Windows from Linux. + - libsodium can now be compiled with emscripten. + - New convenience function (prototyped in utils.h): sodium_bin2hex(). + +* Version 0.4.1 + - sodium_version_*() functions were not exported in version 0.4. They +are now visible as intended. + - sodium_init() now calls randombytes_stir(). + - optimized assembly version of salsa20 is now used on amd64. + - further cleanups and enhanced compatibility with non-C99 compilers. + +* Version 0.4 + - Most constants and operations are now available as actual functions +instead of macros, making it easier to use from other languages. + - New operation: crypto_generichash, featuring a variable key size, a +variable output size, and a streaming API. Currently implemented using +Blake2b. + - The package can be compiled in a separate directory. + - aes128ctr functions are exported. + - Optimized versions of curve25519 (curve25519_donna_c64), poly1305 +(poly1305_53) and ed25519 (ed25519_ref10) are available. Optionally calling +sodium_init() once before using the library makes it pick the fastest +implementation. + - New convenience function: sodium_memzero() in order to securely +wipe a memory area. + - A whole bunch of cleanups and portability enhancements. + - On Windows, a .REF file is generated along with the shared library, +for use with Visual Studio. The installation path for these has become +$prefix/bin as expected by MingW. + +* Version 0.3 + - The crypto_shorthash operation has been added, implemented using +SipHash-2-4. + +* Version 0.2 + - crypto_sign_seed_keypair() has been added + +* Version 0.1 + - Initial release. + Added: head/sys/contrib/libsodium/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libsodium/LICENSE Fri Aug 17 00:23:50 2018 (r337936) @@ -0,0 +1,18 @@ +/* + * ISC License + * + * Copyright (c) 2013-2018 + * Frank Denis + * + * Permission to use, copy, modify, and/or 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. + */ Added: head/sys/contrib/libsodium/Makefile.am ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libsodium/Makefile.am Fri Aug 17 00:23:50 2018 (r337936) @@ -0,0 +1,24 @@ +ACLOCAL_AMFLAGS = -I m4 + +EXTRA_DIST = \ + autogen.sh \ + libsodium.sln \ + libsodium.vcxproj \ + libsodium.vcxproj.filters \ + LICENSE \ + README.markdown \ + THANKS + +SUBDIRS = \ + builds \ + contrib \ + dist-build \ + msvc-scripts \ + src \ + test + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = @PACKAGE_NAME@.pc + +DISTCLEANFILES = $(pkgconfig_DATA) + Added: head/sys/contrib/libsodium/README.markdown ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libsodium/README.markdown Fri Aug 17 00:23:50 2018 (r337936) @@ -0,0 +1,46 @@ +[![Build Status](https://travis-ci.org/jedisct1/libsodium.svg?branch=master)](https://travis-ci.org/jedisct1/libsodium?branch=master) +[![Windows build status](https://ci.appveyor.com/api/projects/status/fu8s2elx25il98hj?svg=true)](https://ci.appveyor.com/project/jedisct1/libsodium) +[![Coverity Scan Build Status](https://scan.coverity.com/projects/2397/badge.svg)](https://scan.coverity.com/projects/2397) + +![libsodium](https://raw.github.com/jedisct1/libsodium/master/logo.png) +============ + +Sodium is a new, easy-to-use software library for encryption, +decryption, signatures, password hashing and more. + +It is a portable, cross-compilable, installable, packageable +fork of [NaCl](http://nacl.cr.yp.to/), with a compatible API, and an +extended API to improve usability even further. + +Its goal is to provide all of the core operations needed to build +higher-level cryptographic tools. + +Sodium supports a variety of compilers and operating systems, +including Windows (with MingW or Visual Studio, x86 and x64), iOS, Android, +as well as Javascript and Webassembly. + +## Documentation + +The documentation is available on Gitbook and built from the [libsodium-doc](https://github.com/jedisct1/libsodium-doc) repository: + +* [libsodium documentation](https://download.libsodium.org/doc/) - +online, requires Javascript. +* [offline documentation](https://www.gitbook.com/book/jedisct1/libsodium/details) +in PDF, MOBI and ePUB formats. + +## Integrity Checking + +The integrity checking instructions (including the signing key for libsodium) +are available in the [installation](https://download.libsodium.org/doc/installation/index.html#integrity-checking) +section of the documentation. + +## Community + +A mailing-list is available to discuss libsodium. + +In order to join, just send a random mail to `sodium-subscribe` {at} +`pureftpd` {dot} `org`. + +## License + +[ISC license](https://en.wikipedia.org/wiki/ISC_license). Added: head/sys/contrib/libsodium/THANKS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/libsodium/THANKS Fri Aug 17 00:23:50 2018 (r337936) @@ -0,0 +1,91 @@ +Special thanks to people, companies and organizations having written +libsodium bindings for their favorite programming languages: + +@alethia7 +@artemisc +@carblue +@dnaq +@ektrah +@graxrabble +@harleqin +@joshjdevl +@jrmarino +@jshahbazi +@lvh +@neheb + +Adam Caudill (@adamcaudill) +Alexander Morris (@alexpmorris) +Amit Murthy (@amitmurthy) +Andrew Bennett (@potatosalad) +Andrew Lambert (@charonn0) +Bruce Mitchener (@waywardmonkeys) +Bruno Oliveira (@abstractj) +Caolan McMahon (@caolan) +Chris Rebert (@cvrebert) +Christian Hermann (@bitbeans) +Christian Wiese (@morfoh) +Christian Wiese (@morfoh) +Colm MacCárthaigh (@colmmacc) +David Parrish (@dmp1ce) +Donald Stufft (@dstufft) +Douglas Campos (@qmx) +Drew Crawford (@drewcrawford) +Emil Bay (@emilbayes) +Eric Dong (@quantum1423) +Eric Voskuil (@evoskuil) +Farid Hajji (@fhajji) +Frank Siebenlist (@franks42) +Gabriel Handford (@gabriel) +Geo Carncross (@geocar) +Henrik Gassmann (BurningEnlightenment) +Jachym Holecek (@freza) +Jack Wink (@jackwink) +James Ruan (@jamesruan) +Jan de Muijnck-Hughes (@jfdm) +Jason McCampbell (@jasonmccampbell) +Jeroen Habraken (@VeXocide) +Jeroen Ooms (@jeroen) +Jesper Louis Andersen (@jlouis) +Joe Eli McIlvain (@jemc) +Jonathan Stowe (@jonathanstowe) +Joseph Abrahamson (@tel) +Julien Kauffmann (@ereOn) +Kenneth Ballenegger (@kballenegger) +Loic Maury (@loicmaury) +Michael Gorlick (@mgorlick) +Michael Gregorowicz (@mgregoro) +MichaÅ‚ ZieliÅ„ski (@zielmicha) +Omar Ayub (@electricFeel) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Aug 17 00:24: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 3B764107B94B; Fri, 17 Aug 2018 00:24:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7BDD81459; Fri, 17 Aug 2018 00:24:20 +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 C906620E9C; Fri, 17 Aug 2018 00:24:20 +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 w7H0OKPF027368; Fri, 17 Aug 2018 00:24:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H0OKmY027367; Fri, 17 Aug 2018 00:24:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170024.w7H0OKmY027367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 00:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r337937 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: cem X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 337937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:24:21 -0000 Author: cem Date: Fri Aug 17 00:24:20 2018 New Revision: 337937 URL: https://svnweb.freebsd.org/changeset/base/337937 Log: Drop size bump Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Fri Aug 17 00:23:50 2018 (r337936) +++ svnadmin/conf/sizelimit.conf Fri Aug 17 00:24:20 2018 (r337937) @@ -16,7 +16,6 @@ # First field is username, second field is the raised limit required. achim bapt -cem davidcs dim 20480000 imp From owner-svn-src-all@freebsd.org Fri Aug 17 00:27: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 BFABD107BB04; Fri, 17 Aug 2018 00:27:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75523816A1; Fri, 17 Aug 2018 00:27:58 +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 52A8D20E9D; Fri, 17 Aug 2018 00:27:58 +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 w7H0Rw0e027571; Fri, 17 Aug 2018 00:27:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H0RuML027564; Fri, 17 Aug 2018 00:27:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170027.w7H0RuML027564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 00:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337938 - head/sys/crypto/libsodium X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/libsodium X-SVN-Commit-Revision: 337938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:27:59 -0000 Author: cem Date: Fri Aug 17 00:27:56 2018 New Revision: 337938 URL: https://svnweb.freebsd.org/changeset/base/337938 Log: Bring in compatibility glue for libsodium The idea is untouched upstream sources live in sys/contrib/libsodium. sys/crypto/libsodium are support routines or compatibility headers to allow building unmodified upstream code. This is not yet integrated into the build system, so no functional change. Added: head/sys/crypto/libsodium/ head/sys/crypto/libsodium/limits.h (contents, props changed) head/sys/crypto/libsodium/randombytes.c (contents, props changed) head/sys/crypto/libsodium/stddef.h (contents, props changed) head/sys/crypto/libsodium/stdint.h (contents, props changed) head/sys/crypto/libsodium/stdio.h (contents, props changed) head/sys/crypto/libsodium/stdlib.h (contents, props changed) head/sys/crypto/libsodium/string.h (contents, props changed) head/sys/crypto/libsodium/utils.c (contents, props changed) Added: head/sys/crypto/libsodium/limits.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/libsodium/limits.h Fri Aug 17 00:27:56 2018 (r337938) @@ -0,0 +1,3 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ +#include Added: head/sys/crypto/libsodium/randombytes.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/libsodium/randombytes.c Fri Aug 17 00:27:56 2018 (r337938) @@ -0,0 +1,13 @@ +/* This file is in the public domain. */ + +#include +__FBSDID("$FreeBSD$"); +#include + +#include + +void +randombytes_buf(void *buf, size_t size) +{ + arc4random_buf(buf, size); +} Added: head/sys/crypto/libsodium/stddef.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/libsodium/stddef.h Fri Aug 17 00:27:56 2018 (r337938) @@ -0,0 +1,3 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ +#include Added: head/sys/crypto/libsodium/stdint.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/libsodium/stdint.h Fri Aug 17 00:27:56 2018 (r337938) @@ -0,0 +1,3 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ +#include Added: head/sys/crypto/libsodium/stdio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/libsodium/stdio.h Fri Aug 17 00:27:56 2018 (r337938) @@ -0,0 +1,2 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ Added: head/sys/crypto/libsodium/stdlib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/libsodium/stdlib.h Fri Aug 17 00:27:56 2018 (r337938) @@ -0,0 +1,2 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ Added: head/sys/crypto/libsodium/string.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/libsodium/string.h Fri Aug 17 00:27:56 2018 (r337938) @@ -0,0 +1,2 @@ +/* This file is in the public domain */ +/* $FreeBSD$ */ Added: head/sys/crypto/libsodium/utils.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/libsodium/utils.c Fri Aug 17 00:27:56 2018 (r337938) @@ -0,0 +1,14 @@ +/* This file is in the public domain. */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include + +#include + +void +sodium_memzero(void *b, size_t n) +{ + explicit_bzero(b, n); +} From owner-svn-src-all@freebsd.org Fri Aug 17 00:30: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 CE69A107BBF4; Fri, 17 Aug 2018 00:30:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82F968180D; Fri, 17 Aug 2018 00:30:06 +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 64F1F20EA2; Fri, 17 Aug 2018 00:30:06 +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 w7H0U6o9027742; Fri, 17 Aug 2018 00:30:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H0U5rt027737; Fri, 17 Aug 2018 00:30:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170030.w7H0U5rt027737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 00:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337939 - in head/sys: conf modules/crypto opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: conf modules/crypto opencrypto X-SVN-Commit-Revision: 337939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:30:07 -0000 Author: cem Date: Fri Aug 17 00:30:04 2018 New Revision: 337939 URL: https://svnweb.freebsd.org/changeset/base/337939 Log: Add xform-conforming auth_hash wrapper for Poly-1305 The wrapper is a thin shim around libsodium's Poly-1305 implementation. For now, we just use the C algorithm and do not attempt to build the SSE-optimized variant for x86 processors. The algorithm support has not yet been plumbed through cryptodev, or added to cryptosoft. Added: head/sys/opencrypto/xform_poly1305.c (contents, props changed) head/sys/opencrypto/xform_poly1305.h (contents, props changed) Modified: head/sys/conf/files head/sys/modules/crypto/Makefile head/sys/opencrypto/cryptodev.h head/sys/opencrypto/xform_auth.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 17 00:27:56 2018 (r337938) +++ head/sys/conf/files Fri Aug 17 00:30:04 2018 (r337939) @@ -4819,6 +4819,21 @@ opencrypto/gfmult.c optional crypto | ipsec | ipsec_s opencrypto/rmd160.c optional crypto | ipsec | ipsec_support opencrypto/skipjack.c optional crypto | ipsec | ipsec_support opencrypto/xform.c optional crypto | ipsec | ipsec_support +opencrypto/xform_poly1305.c optional crypto \ + compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium" +contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \ + optional crypto \ + compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium" +contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c \ + optional crypto \ + compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium" +contrib/libsodium/src/libsodium/crypto_verify/sodium/verify.c \ + optional crypto \ + compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium" +crypto/libsodium/randombytes.c optional crypto \ + compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium" +crypto/libsodium/utils.c optional crypto \ + compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium" rpc/auth_none.c optional krpc | nfslockd | nfscl | nfsd rpc/auth_unix.c optional krpc | nfslockd | nfscl | nfsd rpc/authunix_prot.c optional krpc | nfslockd | nfscl | nfsd Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Fri Aug 17 00:27:56 2018 (r337938) +++ head/sys/modules/crypto/Makefile Fri Aug 17 00:30:04 2018 (r337939) @@ -1,5 +1,7 @@ # $FreeBSD$ +LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodium + .PATH: ${SRCTOP}/sys/opencrypto .PATH: ${SRCTOP}/sys/crypto .PATH: ${SRCTOP}/sys/crypto/blowfish @@ -12,6 +14,10 @@ .PATH: ${SRCTOP}/sys/crypto/blake2 .PATH: ${SRCTOP}/sys/crypto/chacha20 .PATH: ${SRCTOP}/sys/contrib/libb2 +.PATH: ${LIBSODIUM}/crypto_onetimeauth/poly1305 +.PATH: ${LIBSODIUM}/crypto_onetimeauth/poly1305/donna +.PATH: ${LIBSODIUM}/crypto_verify/sodium +.PATH: ${SRCTOP}/sys/crypto/libsodium KMOD = crypto SRCS = crypto.c cryptodev_if.c @@ -44,6 +50,22 @@ CWARNFLAGS.blake2b-ref.c += -Wno-cast-qual -Wno-unused CWARNFLAGS.blake2s-ref.c += -Wno-cast-qual -Wno-unused-function SRCS += chacha.c SRCS += chacha-sw.c + +LIBSODIUM_INC=${LIBSODIUM}/include +LIBSODIUM_COMPAT=${SRCTOP}/sys/crypto/libsodium +SRCS += xform_poly1305.c +CFLAGS.xform_poly1305.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT} +SRCS += onetimeauth_poly1305.c +CFLAGS.onetimeauth_poly1305.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} +SRCS += poly1305_donna.c +CFLAGS.poly1305_donna.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} +SRCS += verify.c +CFLAGS.verify.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} +SRCS += randombytes.c +CFLAGS.randombytes.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT} +SRCS += utils.c +CFLAGS.utils.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT} + SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h SRCS += opt_ddb.h Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Fri Aug 17 00:27:56 2018 (r337938) +++ head/sys/opencrypto/cryptodev.h Fri Aug 17 00:30:04 2018 (r337939) @@ -85,6 +85,7 @@ #define MD5_KPDK_HASH_LEN 16 #define SHA1_KPDK_HASH_LEN 20 #define AES_GMAC_HASH_LEN 16 +#define POLY1305_HASH_LEN 16 /* Maximum hash algorithm result length */ #define HASH_MAX_LEN SHA2_512_HASH_LEN /* Keep this updated */ @@ -107,6 +108,8 @@ #define AES_192_GMAC_KEY_LEN 24 #define AES_256_GMAC_KEY_LEN 32 +#define POLY1305_KEY_LEN 32 + /* Encryption algorithm block sizes */ #define NULL_BLOCK_LEN 4 /* IPsec to maintain alignment */ #define DES_BLOCK_LEN 8 @@ -195,7 +198,8 @@ #define CRYPTO_SHA2_256 35 #define CRYPTO_SHA2_384 36 #define CRYPTO_SHA2_512 37 -#define CRYPTO_ALGORITHM_MAX 37 /* Keep updated - see below */ +#define CRYPTO_POLY1305 38 +#define CRYPTO_ALGORITHM_MAX 38 /* Keep updated - see below */ #define CRYPTO_ALGO_VALID(x) ((x) >= CRYPTO_ALGORITHM_MIN && \ (x) <= CRYPTO_ALGORITHM_MAX) Modified: head/sys/opencrypto/xform_auth.h ============================================================================== --- head/sys/opencrypto/xform_auth.h Fri Aug 17 00:27:56 2018 (r337938) +++ head/sys/opencrypto/xform_auth.h Fri Aug 17 00:30:04 2018 (r337939) @@ -83,6 +83,7 @@ extern struct auth_hash auth_hash_nist_gmac_aes_192; extern struct auth_hash auth_hash_nist_gmac_aes_256; extern struct auth_hash auth_hash_blake2b; extern struct auth_hash auth_hash_blake2s; +extern struct auth_hash auth_hash_poly1305; union authctx { MD5_CTX md5ctx; Added: head/sys/opencrypto/xform_poly1305.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/opencrypto/xform_poly1305.c Fri Aug 17 00:30:04 2018 (r337939) @@ -0,0 +1,91 @@ +/* This file is in the public domain. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +struct poly1305_xform_ctx { + struct crypto_onetimeauth_poly1305_state state; +}; +CTASSERT(sizeof(union authctx) >= sizeof(struct poly1305_xform_ctx)); + +CTASSERT(POLY1305_KEY_LEN == crypto_onetimeauth_poly1305_KEYBYTES); +CTASSERT(POLY1305_HASH_LEN == crypto_onetimeauth_poly1305_BYTES); + +void +Poly1305_Init(struct poly1305_xform_ctx *polyctx) +{ + /* Nop */ +} + +void +Poly1305_Setkey(struct poly1305_xform_ctx *polyctx, + const uint8_t key[__min_size(POLY1305_KEY_LEN)], size_t klen) +{ + int rc; + + if (klen != POLY1305_KEY_LEN) + panic("%s: Bogus keylen: %u bytes", __func__, (unsigned)klen); + + rc = crypto_onetimeauth_poly1305_init(&polyctx->state, key); + if (rc != 0) + panic("%s: Invariant violated: %d", __func__, rc); +} + +static void +xform_Poly1305_Setkey(void *ctx, const uint8_t *key, uint16_t klen) +{ + Poly1305_Setkey(ctx, key, klen); +} + +int +Poly1305_Update(struct poly1305_xform_ctx *polyctx, const void *data, + size_t len) +{ + int rc; + + rc = crypto_onetimeauth_poly1305_update(&polyctx->state, data, len); + if (rc != 0) + panic("%s: Invariant violated: %d", __func__, rc); + return (0); +} + +static int +xform_Poly1305_Update(void *ctx, const uint8_t *data, uint16_t len) +{ + return (Poly1305_Update(ctx, data, len)); +} + +void +Poly1305_Final(uint8_t digest[__min_size(POLY1305_HASH_LEN)], + struct poly1305_xform_ctx *polyctx) +{ + int rc; + + rc = crypto_onetimeauth_poly1305_final(&polyctx->state, digest); + if (rc != 0) + panic("%s: Invariant violated: %d", __func__, rc); +} + +static void +xform_Poly1305_Final(uint8_t *digest, void *ctx) +{ + Poly1305_Final(digest, ctx); +} + +struct auth_hash auth_hash_poly1305 = { + .type = CRYPTO_POLY1305, + .name = "Poly-1305", + .keysize = POLY1305_KEY_LEN, + .hashsize = POLY1305_HASH_LEN, + .ctxsize = sizeof(struct poly1305_xform_ctx), + .blocksize = crypto_onetimeauth_poly1305_BYTES, + .Init = (void *)Poly1305_Init, + .Setkey = xform_Poly1305_Setkey, + .Update = xform_Poly1305_Update, + .Final = xform_Poly1305_Final, +}; Added: head/sys/opencrypto/xform_poly1305.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/opencrypto/xform_poly1305.h Fri Aug 17 00:30:04 2018 (r337939) @@ -0,0 +1,16 @@ +/* This file is in the public domain. */ +/* $FreeBSD$ */ +#pragma once + +#include + +struct poly1305_xform_ctx; + +void Poly1305_Init(struct poly1305_xform_ctx *); + +void Poly1305_Setkey(struct poly1305_xform_ctx *, + const uint8_t [__min_size(32)], size_t); + +int Poly1305_Update(struct poly1305_xform_ctx *, const void *, size_t); + +void Poly1305_Final(uint8_t [__min_size(16)], struct poly1305_xform_ctx *); From owner-svn-src-all@freebsd.org Fri Aug 17 00:31: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 11198107BD84; Fri, 17 Aug 2018 00:31:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC50E81A5A; Fri, 17 Aug 2018 00:31:06 +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 9D88320ECE; Fri, 17 Aug 2018 00:31:06 +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 w7H0V6T2028759; Fri, 17 Aug 2018 00:31:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H0V6o9028757; Fri, 17 Aug 2018 00:31:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170031.w7H0V6o9028757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 00:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337940 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 337940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:31:07 -0000 Author: cem Date: Fri Aug 17 00:31:06 2018 New Revision: 337940 URL: https://svnweb.freebsd.org/changeset/base/337940 Log: crypto(4): Add cryptosoft, cryptodev support for Poly-1305 Modified: head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Fri Aug 17 00:30:04 2018 (r337939) +++ head/sys/opencrypto/cryptodev.c Fri Aug 17 00:31:06 2018 (r337940) @@ -457,6 +457,9 @@ cryptof_ioctl( case CRYPTO_MD5_HMAC: thash = &auth_hash_hmac_md5; break; + case CRYPTO_POLY1305: + thash = &auth_hash_poly1305; + break; case CRYPTO_SHA1_HMAC: thash = &auth_hash_hmac_sha1; break; Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Fri Aug 17 00:30:04 2018 (r337939) +++ head/sys/opencrypto/cryptosoft.c Fri Aug 17 00:31:06 2018 (r337940) @@ -321,7 +321,7 @@ out: return (error); } -static void +static int __result_use_check swcr_authprepare(struct auth_hash *axf, struct swcr_data *sw, u_char *key, int klen) { @@ -377,6 +377,12 @@ swcr_authprepare(struct auth_hash *axf, struct swcr_da axf->Final(buf, sw->sw_ictx); break; } + case CRYPTO_POLY1305: + if (klen != POLY1305_KEY_LEN) { + CRYPTDEB("bad poly1305 key size %d", klen); + return EINVAL; + } + /* FALLTHROUGH */ case CRYPTO_BLAKE2B: case CRYPTO_BLAKE2S: axf->Setkey(sw->sw_ictx, key, klen); @@ -385,7 +391,9 @@ swcr_authprepare(struct auth_hash *axf, struct swcr_da default: printf("%s: CRD_F_KEY_EXPLICIT flag given, but algorithm %d " "doesn't use keys.\n", __func__, axf->type); + return EINVAL; } + return 0; } /* @@ -405,8 +413,11 @@ swcr_authcompute(struct cryptodesc *crd, struct swcr_d axf = sw->sw_axf; - if (crd->crd_flags & CRD_F_KEY_EXPLICIT) - swcr_authprepare(axf, sw, crd->crd_key, crd->crd_klen); + if (crd->crd_flags & CRD_F_KEY_EXPLICIT) { + err = swcr_authprepare(axf, sw, crd->crd_key, crd->crd_klen); + if (err != 0) + return err; + } bcopy(sw->sw_ictx, &ctx, axf->ctxsize); @@ -460,6 +471,7 @@ swcr_authcompute(struct cryptodesc *crd, struct swcr_d case CRYPTO_BLAKE2B: case CRYPTO_BLAKE2S: case CRYPTO_NULL_HMAC: + case CRYPTO_POLY1305: axf->Final(aalg, &ctx); break; } @@ -851,8 +863,12 @@ swcr_newsession(device_t dev, crypto_session_t cses, s } if (cri->cri_key != NULL) { - swcr_authprepare(axf, *swd, cri->cri_key, - cri->cri_klen); + error = swcr_authprepare(axf, *swd, + cri->cri_key, cri->cri_klen); + if (error != 0) { + swcr_freesession(dev, cses); + return error; + } } (*swd)->sw_mlen = cri->cri_mlen; @@ -882,8 +898,12 @@ swcr_newsession(device_t dev, crypto_session_t cses, s /* Store the key so we can "append" it to the payload */ if (cri->cri_key != NULL) { - swcr_authprepare(axf, *swd, cri->cri_key, - cri->cri_klen); + error = swcr_authprepare(axf, *swd, + cri->cri_key, cri->cri_klen); + if (error != 0) { + swcr_freesession(dev, cses); + return error; + } } (*swd)->sw_mlen = cri->cri_mlen; @@ -956,6 +976,9 @@ swcr_newsession(device_t dev, crypto_session_t cses, s goto auth5common; case CRYPTO_BLAKE2S: axf = &auth_hash_blake2s; + goto auth5common; + case CRYPTO_POLY1305: + axf = &auth_hash_poly1305; auth5common: (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); @@ -1054,6 +1077,7 @@ swcr_freesession(device_t dev, crypto_session_t cses) case CRYPTO_BLAKE2B: case CRYPTO_BLAKE2S: case CRYPTO_MD5: + case CRYPTO_POLY1305: case CRYPTO_SHA1: case CRYPTO_SHA2_224: case CRYPTO_SHA2_256: @@ -1155,6 +1179,7 @@ swcr_process(device_t dev, struct cryptop *crp, int hi case CRYPTO_SHA2_512: case CRYPTO_BLAKE2B: case CRYPTO_BLAKE2S: + case CRYPTO_POLY1305: if ((crp->crp_etype = swcr_authcompute(crd, sw, crp->crp_buf, crp->crp_flags)) != 0) goto done; @@ -1253,6 +1278,7 @@ swcr_attach(device_t dev) REGISTER(CRYPTO_BLAKE2B); REGISTER(CRYPTO_BLAKE2S); REGISTER(CRYPTO_CHACHA20); + REGISTER(CRYPTO_POLY1305); #undef REGISTER return 0; From owner-svn-src-all@freebsd.org Fri Aug 17 00:32:02 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 043BE107BF87; Fri, 17 Aug 2018 00:32:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF2B881D5F; Fri, 17 Aug 2018 00:32:01 +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 7621621003; Fri, 17 Aug 2018 00:32:01 +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 w7H0W1Q5031042; Fri, 17 Aug 2018 00:32:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H0W1XP031040; Fri, 17 Aug 2018 00:32:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170032.w7H0W1XP031040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 00:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337941 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 337941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:32:02 -0000 Author: cem Date: Fri Aug 17 00:32:00 2018 New Revision: 337941 URL: https://svnweb.freebsd.org/changeset/base/337941 Log: Add test cases for Poly1305 from RFC 7539 Added: head/tests/sys/opencrypto/poly1305_test.c (contents, props changed) Modified: head/tests/sys/opencrypto/Makefile Modified: head/tests/sys/opencrypto/Makefile ============================================================================== --- head/tests/sys/opencrypto/Makefile Fri Aug 17 00:31:06 2018 (r337940) +++ head/tests/sys/opencrypto/Makefile Fri Aug 17 00:32:00 2018 (r337941) @@ -8,8 +8,9 @@ BINDIR= ${TESTSDIR} CFLAGS+= -I${SRCTOP}/tests CFLAGS.blake2_test.c += -I${SRCTOP}/sys/opencrypto CFLAGS.blake2_test.c += -I${SRCTOP}/sys/contrib/libb2 +CFLAGS.poly1305_test.c += -I${SRCTOP}/sys/opencrypto -ATF_TESTS_C+= blake2_test +ATF_TESTS_C+= blake2_test poly1305_test PLAIN_TESTS_SH= runtests Added: head/tests/sys/opencrypto/poly1305_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/opencrypto/poly1305_test.c Fri Aug 17 00:32:00 2018 (r337941) @@ -0,0 +1,403 @@ +/*- + * Copyright (c) 2018 Conrad Meyer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include +#include + +#include + +/* Be sure to include tree copy rather than system copy. */ +#include "cryptodev.h" + +#include "freebsd_test_suite/macros.h" + +struct poly1305_kat { + const char *vector_name; + const char *test_key_hex; + const char *test_msg_hex; + const size_t test_msg_len; + + const char *expected_tag_hex; +}; + +static const struct poly1305_kat rfc7539_kats[] = { +{ + .vector_name = "RFC 7539 \xc2\xa7 2.5.2", + .test_key_hex = "85:d6:be:78:57:55:6d:33:7f:44:52:fe:42:d5:06:a8" + ":01:03:80:8a:fb:0d:b2:fd:4a:bf:f6:af:41:49:f5:1b", + .test_msg_hex = +"43 72 79 70 74 6f 67 72 61 70 68 69 63 20 46 6f " +"72 75 6d 20 52 65 73 65 61 72 63 68 20 47 72 6f " +"75 70", + .test_msg_len = 34, + .expected_tag_hex = "a8:06:1d:c1:30:51:36:c6:c2:2b:8b:af:0c:01:27:a9", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #1", + .test_key_hex = +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ", + .test_msg_hex = +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ", + .test_msg_len = 64, + .expected_tag_hex = "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #2", + .test_key_hex = +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"36 e5 f6 b5 c5 e0 60 70 f0 ef ca 96 22 7a 86 3e ", + .test_msg_hex = +"41 6e 79 20 73 75 62 6d 69 73 73 69 6f 6e 20 74 " +"6f 20 74 68 65 20 49 45 54 46 20 69 6e 74 65 6e " +"64 65 64 20 62 79 20 74 68 65 20 43 6f 6e 74 72 " +"69 62 75 74 6f 72 20 66 6f 72 20 70 75 62 6c 69 " +"63 61 74 69 6f 6e 20 61 73 20 61 6c 6c 20 6f 72 " +"20 70 61 72 74 20 6f 66 20 61 6e 20 49 45 54 46 " +"20 49 6e 74 65 72 6e 65 74 2d 44 72 61 66 74 20 " +"6f 72 20 52 46 43 20 61 6e 64 20 61 6e 79 20 73 " +"74 61 74 65 6d 65 6e 74 20 6d 61 64 65 20 77 69 " +"74 68 69 6e 20 74 68 65 20 63 6f 6e 74 65 78 74 " +"20 6f 66 20 61 6e 20 49 45 54 46 20 61 63 74 69 " +"76 69 74 79 20 69 73 20 63 6f 6e 73 69 64 65 72 " +"65 64 20 61 6e 20 22 49 45 54 46 20 43 6f 6e 74 " +"72 69 62 75 74 69 6f 6e 22 2e 20 53 75 63 68 20 " +"73 74 61 74 65 6d 65 6e 74 73 20 69 6e 63 6c 75 " +"64 65 20 6f 72 61 6c 20 73 74 61 74 65 6d 65 6e " +"74 73 20 69 6e 20 49 45 54 46 20 73 65 73 73 69 " +"6f 6e 73 2c 20 61 73 20 77 65 6c 6c 20 61 73 20 " +"77 72 69 74 74 65 6e 20 61 6e 64 20 65 6c 65 63 " +"74 72 6f 6e 69 63 20 63 6f 6d 6d 75 6e 69 63 61 " +"74 69 6f 6e 73 20 6d 61 64 65 20 61 74 20 61 6e " +"79 20 74 69 6d 65 20 6f 72 20 70 6c 61 63 65 2c " +"20 77 68 69 63 68 20 61 72 65 20 61 64 64 72 65 " +"73 73 65 64 20 74 6f", + .test_msg_len = 375, + .expected_tag_hex = "36 e5 f6 b5 c5 e0 60 70 f0 ef ca 96 22 7a 86 3e", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #3", + .test_key_hex = +"36 e5 f6 b5 c5 e0 60 70 f0 ef ca 96 22 7a 86 3e " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ", + .test_msg_hex = +"41 6e 79 20 73 75 62 6d 69 73 73 69 6f 6e 20 74 " +"6f 20 74 68 65 20 49 45 54 46 20 69 6e 74 65 6e " +"64 65 64 20 62 79 20 74 68 65 20 43 6f 6e 74 72 " +"69 62 75 74 6f 72 20 66 6f 72 20 70 75 62 6c 69 " +"63 61 74 69 6f 6e 20 61 73 20 61 6c 6c 20 6f 72 " +"20 70 61 72 74 20 6f 66 20 61 6e 20 49 45 54 46 " +"20 49 6e 74 65 72 6e 65 74 2d 44 72 61 66 74 20 " +"6f 72 20 52 46 43 20 61 6e 64 20 61 6e 79 20 73 " +"74 61 74 65 6d 65 6e 74 20 6d 61 64 65 20 77 69 " +"74 68 69 6e 20 74 68 65 20 63 6f 6e 74 65 78 74 " +"20 6f 66 20 61 6e 20 49 45 54 46 20 61 63 74 69 " +"76 69 74 79 20 69 73 20 63 6f 6e 73 69 64 65 72 " +"65 64 20 61 6e 20 22 49 45 54 46 20 43 6f 6e 74 " +"72 69 62 75 74 69 6f 6e 22 2e 20 53 75 63 68 20 " +"73 74 61 74 65 6d 65 6e 74 73 20 69 6e 63 6c 75 " +"64 65 20 6f 72 61 6c 20 73 74 61 74 65 6d 65 6e " +"74 73 20 69 6e 20 49 45 54 46 20 73 65 73 73 69 " +"6f 6e 73 2c 20 61 73 20 77 65 6c 6c 20 61 73 20 " +"77 72 69 74 74 65 6e 20 61 6e 64 20 65 6c 65 63 " +"74 72 6f 6e 69 63 20 63 6f 6d 6d 75 6e 69 63 61 " +"74 69 6f 6e 73 20 6d 61 64 65 20 61 74 20 61 6e " +"79 20 74 69 6d 65 20 6f 72 20 70 6c 61 63 65 2c " +"20 77 68 69 63 68 20 61 72 65 20 61 64 64 72 65 " +"73 73 65 64 20 74 6f", + .test_msg_len = 375, + .expected_tag_hex = "f3 47 7e 7c d9 54 17 af 89 a6 b8 79 4c 31 0c f0", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #4", + .test_key_hex = +"1c 92 40 a5 eb 55 d3 8a f3 33 88 86 04 f6 b5 f0 " +"47 39 17 c1 40 2b 80 09 9d ca 5c bc 20 70 75 c0 ", + .test_msg_hex = +"27 54 77 61 73 20 62 72 69 6c 6c 69 67 2c 20 61 " +"6e 64 20 74 68 65 20 73 6c 69 74 68 79 20 74 6f " +"76 65 73 0a 44 69 64 20 67 79 72 65 20 61 6e 64 " +"20 67 69 6d 62 6c 65 20 69 6e 20 74 68 65 20 77 " +"61 62 65 3a 0a 41 6c 6c 20 6d 69 6d 73 79 20 77 " +"65 72 65 20 74 68 65 20 62 6f 72 6f 67 6f 76 65 " +"73 2c 0a 41 6e 64 20 74 68 65 20 6d 6f 6d 65 20 " +"72 61 74 68 73 20 6f 75 74 67 72 61 62 65 2e", + .test_msg_len = 127, + .expected_tag_hex = "45 41 66 9a 7e aa ee 61 e7 08 dc 7c bc c5 eb 62", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #5", + .test_key_hex = +"02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ", + .test_msg_hex = +"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF", + .test_msg_len = 16, + .expected_tag_hex = "03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #6", + .test_key_hex = +"02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ", + .test_msg_hex = +"02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", + .test_msg_len = 16, + .expected_tag_hex = "03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", + +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #7", + .test_key_hex = +"01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ", + .test_msg_hex = +"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF " +"F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF " +"11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", + .test_msg_len = 48, + .expected_tag_hex = "05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #8", + .test_key_hex = +"01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ", + .test_msg_hex = +"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF " +"FB FE FE FE FE FE FE FE FE FE FE FE FE FE FE FE " +"01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01", + .test_msg_len = 48, + .expected_tag_hex = "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #9", + .test_key_hex = +"02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ", + .test_msg_hex = +"FD FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF", + .test_msg_len = 16, + .expected_tag_hex = "FA FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #10", + .test_key_hex = +"01 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ", + .test_msg_hex = +"E3 35 94 D7 50 5E 43 B9 00 00 00 00 00 00 00 00 " +"33 94 D7 50 5E 43 79 CD 01 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +"01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", + .test_msg_len = 64, + .expected_tag_hex = "14 00 00 00 00 00 00 00 55 00 00 00 00 00 00 00", +}, +{ + .vector_name = "RFC 7539 \xc2\xa7 A.3 #11", + .test_key_hex = +"01 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ", + .test_msg_hex = +"E3 35 94 D7 50 5E 43 B9 00 00 00 00 00 00 00 00 " +"33 94 D7 50 5E 43 79 CD 01 00 00 00 00 00 00 00 " +"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", + .test_msg_len = 48, + .expected_tag_hex = "13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", +}, +}; + +static void +parse_hex(const struct poly1305_kat *kat, const char *hexstr, void *voutput, + size_t explen) +{ + /* Space or colon delimited; may contain a single trailing space; + * length should match exactly. + */ + const char *sep, *it; + size_t sym_len, count; + char hbyte[3], *out; + int res; + + out = voutput; + memset(hbyte, 0, sizeof(hbyte)); + + it = hexstr; + count = 0; + while (true) { + sep = strpbrk(it, " :"); + if (sep == NULL) + sym_len = strlen(it); + else + sym_len = sep - it; + + ATF_REQUIRE_EQ_MSG(sym_len, 2, + "invalid hex byte '%.*s' in vector %s", (int)sym_len, it, + kat->vector_name); + + memcpy(hbyte, it, 2); + res = sscanf(hbyte, "%hhx", &out[count]); + ATF_REQUIRE_EQ_MSG(res, 1, + "invalid hex byte '%s' in vector %s", hbyte, + kat->vector_name); + + count++; + ATF_REQUIRE_MSG(count <= explen, + "got longer than expected value at %s", kat->vector_name); + + if (sep == NULL) + break; + it = sep; + while (*it == ' ' || *it == ':') + it++; + if (*it == 0) + break; + } + + ATF_REQUIRE_EQ_MSG(count, explen, "got short value at %s", + kat->vector_name); +} + +static void +parse_vector(const struct poly1305_kat *kat, + uint8_t key[__min_size(POLY1305_KEY_LEN)], char *msg, + uint8_t exptag[__min_size(POLY1305_HASH_LEN)]) +{ + parse_hex(kat, kat->test_key_hex, key, POLY1305_KEY_LEN); + parse_hex(kat, kat->test_msg_hex, msg, kat->test_msg_len); + parse_hex(kat, kat->expected_tag_hex, exptag, POLY1305_HASH_LEN); +} + +static int +get_handle_fd(void) +{ + int dc_fd, fd; + + dc_fd = open("/dev/crypto", O_RDWR); + + /* + * Why do we do this dance instead of just operating on /dev/crypto + * directly? I have no idea. + */ + ATF_REQUIRE(dc_fd >= 0); + ATF_REQUIRE(ioctl(dc_fd, CRIOGET, &fd) != -1); + close(dc_fd); + return (fd); +} + +static int +create_session(int fd, int alg, int crid, const void *key, size_t klen) +{ + struct session2_op sop; + + memset(&sop, 0, sizeof(sop)); + + sop.mac = alg; + sop.mackey = key; + sop.mackeylen = klen; + sop.crid = crid; + + ATF_REQUIRE_MSG(ioctl(fd, CIOCGSESSION2, &sop) >= 0, + "alg %d keylen %zu, errno=%d (%s)", alg, klen, errno, + strerror(errno)); + return (sop.ses); +} + +static void +destroy_session(int fd, int _ses) +{ + uint32_t ses; + + ses = _ses; + ATF_REQUIRE_MSG(ioctl(fd, CIOCFSESSION, &ses) >= 0, + "destroy session failed, errno=%d (%s)", errno, strerror(errno)); +} + +static void +do_cryptop(int fd, int ses, const void *inp, size_t inlen, void *out) +{ + struct crypt_op cop; + + memset(&cop, 0, sizeof(cop)); + + cop.ses = ses; + cop.len = inlen; + cop.src = inp; + cop.mac = out; + ATF_CHECK_MSG(ioctl(fd, CIOCCRYPT, &cop) >= 0, "ioctl(CIOCCRYPT)"); +} + +static void +test_rfc7539_poly1305_vectors(int crid, const char *modname) +{ + uint8_t comptag[POLY1305_HASH_LEN], exptag[POLY1305_HASH_LEN], + key[POLY1305_KEY_LEN], msg[512]; + int fd, ses; + size_t i; + + ATF_REQUIRE_KERNEL_MODULE(modname); + ATF_REQUIRE_KERNEL_MODULE("cryptodev"); + + fd = get_handle_fd(); + + for (i = 0; i < nitems(rfc7539_kats); i++) { + const struct poly1305_kat *kat; + + kat = &rfc7539_kats[i]; + parse_vector(kat, key, msg, exptag); + + ses = create_session(fd, CRYPTO_POLY1305, crid, key, sizeof(key)); + + do_cryptop(fd, ses, msg, kat->test_msg_len, comptag); + ATF_CHECK_EQ_MSG(memcmp(comptag, exptag, sizeof(exptag)), 0, + "KAT %s failed:", kat->vector_name); + + destroy_session(fd, ses); + } +} + +ATF_TC_WITHOUT_HEAD(poly1305_vectors); +ATF_TC_BODY(poly1305_vectors, tc) +{ + ATF_REQUIRE_SYSCTL_INT("kern.cryptodevallowsoft", 1); + test_rfc7539_poly1305_vectors(CRYPTO_FLAG_SOFTWARE, "nexus/cryptosoft"); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, poly1305_vectors); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Fri Aug 17 00:49: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 A0016107C490; Fri, 17 Aug 2018 00:49: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E05982412; Fri, 17 Aug 2018 00:49:36 +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 2C4DA211E3; Fri, 17 Aug 2018 00:49:36 +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 w7H0narj037959; Fri, 17 Aug 2018 00:49:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H0na3c037958; Fri, 17 Aug 2018 00:49:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808170049.w7H0na3c037958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 Aug 2018 00:49:36 +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: r337942 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 337942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:49:36 -0000 Author: kib Date: Fri Aug 17 00:49:35 2018 New Revision: 337942 URL: https://svnweb.freebsd.org/changeset/base/337942 Log: MFC r337770: Fix typo. Modified: stable/11/sys/amd64/amd64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Fri Aug 17 00:32:00 2018 (r337941) +++ stable/11/sys/amd64/amd64/pmap.c Fri Aug 17 00:49:35 2018 (r337942) @@ -7431,7 +7431,7 @@ pmap_activate_sw(struct thread *td) * pmap_activate_sw(), from the context switch, is * immune to this race, because interrupts are * disabled (while the thread lock is owned), and IPI - * happends after curpmap is updated. Protect other + * happens after curpmap is updated. Protect other * callers in a similar way, by disabling interrupts * around the %cr3 register reload and curpmap * assignment. From owner-svn-src-all@freebsd.org Fri Aug 17 00:51: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 BD323107C663; Fri, 17 Aug 2018 00:51:23 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (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 3416E8260A; Fri, 17 Aug 2018 00:51:23 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x132.google.com with SMTP id f135-v6so4708437lfg.10; Thu, 16 Aug 2018 17:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=A2ln+Con41RP9XWOJyUw636exI8bbkmFE6IaROOZBxk=; b=BhmUel0S9RigOq4t37x1bZvi+TW4RV3cDBUkYgOp4mb0cM8C8Lrx96uqhzZfXLdtYI 71hrlANOulCFYJqnvkrtfxTB5H26TEPuYo9VYlfvclyTPDa9H6URrsicV8qCBv6NJAoJ xsKlx4e16PLLAVNcDN2mkJU8U2kyyThf3lIGmGHICIjffABAoMUp49xTldddR7UhgTIO ZmfTMkQGV5XKJyb/j+E764eFjyTv/PIaguGnOCdbOZYsa+235CwXXEiovNrh1ShW8F90 c4S/kVRh7gaPW0g04tJC8K0dJvyBjCIkDx7dvikYx7JDBMVg8ph3xc8oVaRQ/bvEvMZE 2yKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=A2ln+Con41RP9XWOJyUw636exI8bbkmFE6IaROOZBxk=; b=tCZSvtyUXCSsP44a20QaknqhxRBM4ogu30LyZIBqBA+FZdpuYv+2Lu4ki+hlrWNvm0 GmRk0fQ4KNPVZNIQqEefIPe/sX4/NSS91yZDeFoUFLV+mvFLZXs5dNsUUZKCCMhD9Acu momLvagmV8MAw0vr55PHmb+3S8OS8rBUGp3HjTD6a8A4Gw3EyEdTTDrRexlWMtwMuCNV LAZAX5MvI0t42oyrY1IeQyxaLLUwHln22OvfnVVjDvY6UOq8pj1Jb2+ANgjOYeSzWcRF gMZKn6JIqnMuNOxJXcIgWjbZFgcUVaKjhfxWcii/8hsB9VRmbyARwTta5/dQZ7IoyxTz fZ2w== X-Gm-Message-State: AOUpUlEsdOczxLMf81YQSM1zOTer6QKL5zx90vqEGoEGqhTG+Am0sWcO dfnPbb9fjerOCAWTKsadrgpo5YJ7bEIqai+wgUEQaaUd X-Google-Smtp-Source: AA+uWPziHfN75vpG9syvP3OznVdX04YpExbGgHdU0yiSFxqVtb29xGaFNbwl7dqiVNNS8AlGTyQ4gVbO5QpxmTFxjls= X-Received: by 2002:a19:9710:: with SMTP id z16-v6mr21748875lfd.17.1534467081491; Thu, 16 Aug 2018 17:51:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:1f4c:0:0:0:0:0 with HTTP; Thu, 16 Aug 2018 17:51:20 -0700 (PDT) Reply-To: araujo@freebsd.org In-Reply-To: <20180816233314.GA11357@spindle.one-eyed-alien.net> References: <201808161929.w7GJTWfS055411@pdx.rh.CN85.dnsmgr.net> <20180816231630.GA10866@spindle.one-eyed-alien.net> <20180816233314.GA11357@spindle.one-eyed-alien.net> From: Marcelo Araujo Date: Fri, 17 Aug 2018 08:51:20 +0800 Message-ID: Subject: Re: svn commit: r337887 - head/usr.sbin/bhyve To: Brooks Davis Cc: Warner Losh , "Rodney W. Grimes" , John-Mark Gurney , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 00:51:24 -0000 2018-08-17 7:33 GMT+08:00 Brooks Davis : > On Thu, Aug 16, 2018 at 05:23:26PM -0600, Warner Losh wrote: > > On Thu, Aug 16, 2018 at 5:16 PM, Brooks Davis > wrote: > > > > > On Fri, Aug 17, 2018 at 07:04:05AM +0800, Marcelo Araujo wrote: > > > > 2018-08-17 3:29 GMT+08:00 Rodney W. Grimes > > > net>: > > > > > > > > > > On Thu, Aug 16, 2018 at 11:06 AM, John-Mark Gurney < > jmg@funkthat.com > > > > > > > > > wrote: > > > > > > > > > > > > > Marcelo Araujo wrote this message on Thu, Aug 16, 2018 at 06:31 > > > +0000: > > > > > > > > Author: araujo > > > > > > > > Date: Thu Aug 16 06:31:54 2018 > > > > > > > > New Revision: 337887 > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/337887 > > > > > > > > > > > > > > > > Log: > > > > > > > > Add a comment explaining how the PSN works and why there > is no > > > > > need for > > > > > > > > a null terminator. Also mark CID 1394825 as intentional. > > > > > > > > > > > > > > > > Reported by: Coverity > > > > > > > > CID: 1394825 > > > > > > > > MFC after: 1 week > > > > > > > > Sponsored by: iXsystems Inc. > > > > > > > > > > > > > > > > Modified: > > > > > > > > head/usr.sbin/bhyve/pci_nvme.c > > > > > > > > > > > > > > > > Modified: head/usr.sbin/bhyve/pci_nvme.c > > > > > > > > ============================================================ > > > > > > > ================== > > > > > > > > --- head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:20:25 > 2018 > > > > > > > (r337886) > > > > > > > > +++ head/usr.sbin/bhyve/pci_nvme.c Thu Aug 16 06:31:54 > 2018 > > > > > > > (r337887) > > > > > > > > @@ -1714,6 +1714,11 @@ pci_nvme_parse_opts(struct > pci_nvme_softc > > > *sc, > > > > > > > char *o > > > > > > > > > > > > > > [...] > > > > > > > > > > > > > > > memset(sc->ctrldata.sn, 0, sizeof(sc-> > > > > > ctrldata.sn > > > > > > > )); > > > > > > > > strncpy(sc->ctrldata.sn, config, > > > > > > > > sizeof(sc->ctrldata.sn)); > > > > > > > > > > > > > > This memset is unneeded, as strncpy will write NUL bytes to > fill > > > out > > > > > > > the buffer: > > > > > > > If src is less than len characters long, the remainder of > > > > > > > dst is filled with `\0' characters. > > > > > > > > > > > > > > > > > > > It also looks like the comment was wrong. The newest NVMe > standards > > > say > > > > > > these fields should be 7-bit and space-padded. > > > > > > > > > > lol, which is what the vendor that caused me grief with > > > > > ata serial numbers did decades ago. > > > > > > > > > > -- > > > > > Rod Grimes > > > > > rgrimes@freebsd.org > > > > > > > > > > > > > I have discussed a bit with imp@, but I will drop the patch here to > get > > > > other peoples opinion too. > > > > So, name space and firmware number also need to be padded with > spaces. > > > > > > > > I couldn't think in any other better way to do that. > > > > > > > > Does this patch looks reasonable? > > > > https://people.freebsd.org/~araujo/pci_nvme.diff > > > > > > You should check that len<=dst_size and at least truncate rather than > > > overflowing. If the strings from userspace you need to return or log > an > > > error, if they come from the kernel, you can panic. > > > > Help me understand, I thought that the strnlen bounded what was copied. > > Apparently the standard calls for ' ' rather than '\0' padding. The > prop memcpy+memset does the job, but contains potential overflows. > > -- Brooks > Maybe I missed something, but when I call cpywithpad() I pass the dst_size, even if the 'src' is bigger than the 'dst' it will be truncated because with strnlen(src, dst_size) the src will be reduced to dst_size length. I made couple tests and could not overflow it(example): cd->fr maximum length is 8: cpywithpad((char *)cd->fr, sizeof(cd->fr), "1.00000090000000000000\0", ' '); the output of cpywithpad: len: 8 is <= dst_size: 8 Same tests I made with mn that has length of 40 adding a string with 244 characters. Sorry my ignorance, but could you give me a better example? Best, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Fri Aug 17 01:03: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 47EDB107CB79; Fri, 17 Aug 2018 01:03:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1B4182E19; Fri, 17 Aug 2018 01:03:23 +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 D2B9821525; Fri, 17 Aug 2018 01:03:23 +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 w7H13Ndl047961; Fri, 17 Aug 2018 01:03:23 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H13Nl5047960; Fri, 17 Aug 2018 01:03:23 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808170103.w7H13Nl5047960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 17 Aug 2018 01:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337943 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 337943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 01:03:24 -0000 Author: np Date: Fri Aug 17 01:03:23 2018 New Revision: 337943 URL: https://svnweb.freebsd.org/changeset/base/337943 Log: if_vlan(4): A VLAN always has a PCP and its ifnet's if_pcp should be set to the PCP value in use instead of IFNET_PCP_NONE. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Fri Aug 17 00:49:35 2018 (r337942) +++ head/sys/net/if_vlan.c Fri Aug 17 01:03:23 2018 (r337943) @@ -1435,6 +1435,7 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint1 ifp->if_resolvemulti = p->if_resolvemulti; ifp->if_addrlen = p->if_addrlen; ifp->if_broadcastaddr = p->if_broadcastaddr; + ifp->if_pcp = ifv->ifv_pcp; /* * Copy only a selected subset of flags from the parent. @@ -1959,6 +1960,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } ifv->ifv_pcp = ifr->ifr_vlan_pcp; + ifp->if_pcp = ifv->ifv_pcp; vlan_tag_recalculate(ifv); /* broadcast event about PCP change */ EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_PCP); From owner-svn-src-all@freebsd.org Fri Aug 17 01:04: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 7F830107CC04; Fri, 17 Aug 2018 01:04:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14F1282F7A; Fri, 17 Aug 2018 01:04:03 +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 EB89E2152A; Fri, 17 Aug 2018 01:04:02 +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 w7H142kY048035; Fri, 17 Aug 2018 01:04:02 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H142P8048034; Fri, 17 Aug 2018 01:04:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170104.w7H142P8048034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 01:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337944 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 337944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 01:04:03 -0000 Author: cem Date: Fri Aug 17 01:04:02 2018 New Revision: 337944 URL: https://svnweb.freebsd.org/changeset/base/337944 Log: arm: Define crypto option on platforms that include IPsec Missed in r337940. (It's not like there are any crypto files IPsec doesn't pull in, so it is unclear what not defining the crypto option was supposed to achieve.) Reported by: np@ Modified: head/sys/arm/conf/std.armv6 head/sys/arm/conf/std.armv7 Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Fri Aug 17 01:03:23 2018 (r337943) +++ head/sys/arm/conf/std.armv6 Fri Aug 17 01:04:02 2018 (r337944) @@ -9,6 +9,7 @@ options VIMAGE # Subsystem virtualization, e.g. VNE options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP +device crypto # IPSec && !crypto is nonsensical options IPSEC # IP (v4/v6) security options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem Modified: head/sys/arm/conf/std.armv7 ============================================================================== --- head/sys/arm/conf/std.armv7 Fri Aug 17 01:03:23 2018 (r337943) +++ head/sys/arm/conf/std.armv7 Fri Aug 17 01:04:02 2018 (r337944) @@ -9,6 +9,7 @@ options VIMAGE # Subsystem virtualization, e.g. VNE options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP +device crypto # IPSec && !crypto is nonsensical options IPSEC # IP (v4/v6) security options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem From owner-svn-src-all@freebsd.org Fri Aug 17 01:08: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 337AB107CCFF; Fri, 17 Aug 2018 01:08:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE1D983181; Fri, 17 Aug 2018 01:08:22 +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 AE26C21551; Fri, 17 Aug 2018 01:08:22 +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 w7H18MES048245; Fri, 17 Aug 2018 01:08:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H18Mda048244; Fri, 17 Aug 2018 01:08:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170108.w7H18Mda048244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 01:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337945 - head/sys/riscv/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/riscv/conf X-SVN-Commit-Revision: 337945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 01:08:23 -0000 Author: cem Date: Fri Aug 17 01:08:22 2018 New Revision: 337945 URL: https://svnweb.freebsd.org/changeset/base/337945 Log: Riscv: Include crypto for IPSec Similar to r337944. I think this is the last configuration that includes IPsec but not crypto. Modified: head/sys/riscv/conf/GENERIC Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Fri Aug 17 01:04:02 2018 (r337944) +++ head/sys/riscv/conf/GENERIC Fri Aug 17 01:08:22 2018 (r337945) @@ -36,6 +36,7 @@ options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 +device crypto # core crypto support (required for IPSEC) options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem From owner-svn-src-all@freebsd.org Fri Aug 17 01:52:16 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 38525107DB5F; Fri, 17 Aug 2018 01:52:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2CD9844FD; Fri, 17 Aug 2018 01:52:15 +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 C40F921D59; Fri, 17 Aug 2018 01:52:15 +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 w7H1qFTV073184; Fri, 17 Aug 2018 01:52:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H1qFoN073183; Fri, 17 Aug 2018 01:52:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170152.w7H1qFoN073183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 01:52: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: r337946 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 01:52:16 -0000 Author: kevans Date: Fri Aug 17 01:52:15 2018 New Revision: 337946 URL: https://svnweb.freebsd.org/changeset/base/337946 Log: MFC r337559: Makefile.inc1: Add libl to -legacy as well libl is needed for config(8), which is a bootstrap-tool. It is possible to build a system WITHOUT_TOOLCHAIN to exclude lex and thus, libl. We still need to support building from this kind of host, though. While here, group the config(8) dependencies together and add a small explanation. These can likely both be scoped more clearly, but this will need some further investigation. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Fri Aug 17 01:08:22 2018 (r337945) +++ stable/11/Makefile.inc1 Fri Aug 17 01:52:15 2018 (r337946) @@ -1659,12 +1659,16 @@ update: .PHONY _elftoolchain_libs= lib/libelf lib/libdwarf .endif +# libnv and libl are both requirements for config(8), which is an unconditional +# bootstrap-tool. +_config_deps= lib/libnv usr.bin/lex/lib + legacy: .PHONY .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ false .endif -.for _tool in tools/build ${_elftoolchain_libs} lib/libnv +.for _tool in tools/build ${_elftoolchain_libs} ${_config_deps} ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ From owner-svn-src-all@freebsd.org Fri Aug 17 01:59: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 24B67107DDF7; Fri, 17 Aug 2018 01:59:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC9208472A; Fri, 17 Aug 2018 01:59:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9829521D7E; Fri, 17 Aug 2018 01:59:20 +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 w7H1xK1L073539; Fri, 17 Aug 2018 01:59:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H1xKLN073536; Fri, 17 Aug 2018 01:59:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170159.w7H1xKLN073536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 01:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337947 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 337947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 01:59:21 -0000 Author: kevans Date: Fri Aug 17 01:59:19 2018 New Revision: 337947 URL: https://svnweb.freebsd.org/changeset/base/337947 Log: bectl(8): Add batch mode to jail subcommand Adding batch mode to the jail `bectl(8)` subcommand enables jailing of ZFS Boot Environments in a scriptable fashion. Submitted by: Shawn Webb Obtained from: HardenedBSD (9e72d1c59a and ef7b6d9e1c with minor edit) Modified: head/sbin/bectl/bectl.8 head/sbin/bectl/bectl.c head/sbin/bectl/bectl_jail.c Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Fri Aug 17 01:52:15 2018 (r337946) +++ head/sbin/bectl/bectl.8 Fri Aug 17 01:59:19 2018 (r337947) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 12, 2018 +.Dd August 16, 2018 .Dt BECTL 8 .Os .Sh NAME @@ -50,6 +50,7 @@ import .Ao Ar targetBe Ac .Nm jail +.Op Fl b .Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... .Ao Ar jailID | jailName Ac .Ao Ar bootenv Ac @@ -160,6 +161,11 @@ arguments may be specified. will set a jail parameter, and .Fl u will unset a jail parameter. +By default, jails are created in interactive mode, with a shell being +executed within the jail. +The +.Fl b +argument enables batch mode, thereby disabling interactive mode. .Pp The .Va name , Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Fri Aug 17 01:52:15 2018 (r337946) +++ head/sbin/bectl/bectl.c Fri Aug 17 01:59:19 2018 (r337947) @@ -77,7 +77,7 @@ usage(bool explicit) #if SOON "\tbectl add (path)*\n" #endif - "\tbectl jail [ -o key=value | -u key ]... bootenv\n" + "\tbectl jail [-b] [ -o key=value | -u key ]... bootenv\n" "\tbectl list [-a] [-D] [-H] [-s]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" Modified: head/sbin/bectl/bectl_jail.c ============================================================================== --- head/sbin/bectl/bectl_jail.c Fri Aug 17 01:52:15 2018 (r337946) +++ head/sbin/bectl/bectl_jail.c Fri Aug 17 01:59:19 2018 (r337947) @@ -179,10 +179,10 @@ int bectl_cmd_jail(int argc, char *argv[]) { char *bootenv, *mountpoint; - int jid, opt, ret; - bool default_hostname, default_name; + int jflags, jid, opt, ret; + bool default_hostname, default_name, interactive; - default_hostname = default_name = true; + default_hostname = default_name = interactive = true; jpcnt = INIT_PARAMCOUNT; jp = malloc(jpcnt * sizeof(*jp)); if (jp == NULL) @@ -193,8 +193,11 @@ bectl_cmd_jail(int argc, char *argv[]) jailparam_add("allow.mount.devfs", "true"); jailparam_add("enforce_statfs", "1"); - while ((opt = getopt(argc, argv, "o:u:")) != -1) { + while ((opt = getopt(argc, argv, "bo:u:")) != -1) { switch (opt) { + case 'b': + interactive = false; + break; case 'o': if (jailparam_addarg(optarg)) { /* @@ -259,13 +262,17 @@ bectl_cmd_jail(int argc, char *argv[]) jailparam_add("name", bootenv); if (default_hostname) jailparam_add("host.hostname", bootenv); + + jflags = JAIL_CREATE; + if (interactive) + jflags |= JAIL_ATTACH; /* * This is our indicator that path was not set by the user, so we'll use * the path that libbe generated for us. */ if (mountpoint == NULL) jailparam_add("path", mnt_loc); - jid = jailparam_set(jp, jpused, JAIL_CREATE | JAIL_ATTACH); + jid = jailparam_set(jp, jpused, jflags); if (jid == -1) { fprintf(stderr, "unable to create jail. error: %d\n", errno); return (1); @@ -274,9 +281,13 @@ bectl_cmd_jail(int argc, char *argv[]) jailparam_free(jp, jpused); free(jp); - /* We're attached within the jail... good bye! */ - chdir("/"); - execl("/bin/sh", "/bin/sh", NULL); + if (interactive) { + /* We're attached within the jail... good bye! */ + chdir("/"); + execl("/bin/sh", "/bin/sh", NULL); + return (1); + } + return (0); } From owner-svn-src-all@freebsd.org Fri Aug 17 02:46:37 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 2688A107F393; Fri, 17 Aug 2018 02:46:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0B84880A2; Fri, 17 Aug 2018 02:46:36 +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 95CB7225C2; Fri, 17 Aug 2018 02:46:36 +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 w7H2ka5t099486; Fri, 17 Aug 2018 02:46:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H2kasQ099485; Fri, 17 Aug 2018 02:46:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808170246.w7H2kasQ099485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 17 Aug 2018 02:46:36 +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: r337948 - in stable: 10/sys/contrib/ipfilter/netinet 11/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 X-SVN-Commit-Revision: 337948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 02:46:37 -0000 Author: cy Date: Fri Aug 17 02:46:36 2018 New Revision: 337948 URL: https://svnweb.freebsd.org/changeset/base/337948 Log: MFC r337558, r337560 r337558: Identify the return value (rval) that led to the IPv4 NAT failure in ipf_nat_checkout() and report it in the frb_natv4out and frb_natv4in dtrace probes. This is currently being used to diagnose NAT failures in PR/208566. It's rather handy so this commit makes it available for future diagnosis and debugging efforts. PR: 208566 r337560: Correct a comment. Should have been detected by ipf_nat_in() not ipf_nat_out(). Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 17 01:59:19 2018 (r337947) +++ stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 17 02:46:36 2018 (r337948) @@ -4951,7 +4951,7 @@ retry_roundrobin: case 0 : continue; case -1 : - rval = -1; + rval = -3; goto outmatchfail; case 1 : default : @@ -4996,7 +4996,7 @@ retry_roundrobin: natfailed = 0; break; } - natfailed = -1; + natfailed = -2; } if ((np == NULL) && (nmsk < softn->ipf_nat_map_max)) { nmsk++; @@ -5021,15 +5021,23 @@ outmatchfail: switch (rval) { + case -3 : + /* ipf_nat_match() failure */ + /* FALLTHROUGH */ + case -2 : + /* retry_roundrobin loop failure */ + /* FALLTHROUGH */ case -1 : + /* proxy failure detected by ipf_nat_out() */ if (passp != NULL) { - DT1(frb_natv4out, fr_info_t *, fin); + DT2(frb_natv4out, fr_info_t *, fin, int, rval); NBUMPSIDED(1, ns_drop); *passp = FR_BLOCK; fin->fin_reason = FRB_NATV4; } fin->fin_flx |= FI_BADNAT; NBUMPSIDED(1, ns_badnat); + rval = -1; /* We only return -1 on error. */ break; case 0 : NBUMPSIDE(1, ns_ignored); @@ -5437,7 +5445,7 @@ retry_roundrobin: case 0 : continue; case -1 : - rval = -1; + rval = -3; goto inmatchfail; case 1 : default : @@ -5484,7 +5492,7 @@ retry_roundrobin: natfailed = 0; break; } - natfailed = -1; + natfailed = -2; } if ((np == NULL) && (rmsk < softn->ipf_nat_rdr_max)) { rmsk++; @@ -5509,15 +5517,23 @@ inmatchfail: switch (rval) { + case -3 : + /* ipf_nat_match() failure */ + /* FALLTHROUGH */ + case -2 : + /* retry_roundrobin loop failure */ + /* FALLTHROUGH */ case -1 : + /* proxy failure detected by ipf_nat_out() */ if (passp != NULL) { - DT1(frb_natv4in, fr_info_t *, fin); + DT2(frb_natv4in, fr_info_t *, fin, int, rval); NBUMPSIDED(0, ns_drop); *passp = FR_BLOCK; fin->fin_reason = FRB_NATV4; } fin->fin_flx |= FI_BADNAT; NBUMPSIDED(0, ns_badnat); + rval = -1; /* We only return -1 on error. */ break; case 0 : NBUMPSIDE(0, ns_ignored); From owner-svn-src-all@freebsd.org Fri Aug 17 02:46:37 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 65FA8107F394; Fri, 17 Aug 2018 02:46:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 185AF880A4; Fri, 17 Aug 2018 02:46:37 +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 ED9A0225C3; Fri, 17 Aug 2018 02:46:36 +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 w7H2ka9L099492; Fri, 17 Aug 2018 02:46:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H2kaOR099491; Fri, 17 Aug 2018 02:46:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808170246.w7H2kaOR099491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 17 Aug 2018 02:46: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: r337948 - in stable: 10/sys/contrib/ipfilter/netinet 11/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 X-SVN-Commit-Revision: 337948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 02:46:37 -0000 Author: cy Date: Fri Aug 17 02:46:36 2018 New Revision: 337948 URL: https://svnweb.freebsd.org/changeset/base/337948 Log: MFC r337558, r337560 r337558: Identify the return value (rval) that led to the IPv4 NAT failure in ipf_nat_checkout() and report it in the frb_natv4out and frb_natv4in dtrace probes. This is currently being used to diagnose NAT failures in PR/208566. It's rather handy so this commit makes it available for future diagnosis and debugging efforts. PR: 208566 r337560: Correct a comment. Should have been detected by ipf_nat_in() not ipf_nat_out(). Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 17 01:59:19 2018 (r337947) +++ stable/10/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 17 02:46:36 2018 (r337948) @@ -4956,7 +4956,7 @@ retry_roundrobin: case 0 : continue; case -1 : - rval = -1; + rval = -3; goto outmatchfail; case 1 : default : @@ -5001,7 +5001,7 @@ retry_roundrobin: natfailed = 0; break; } - natfailed = -1; + natfailed = -2; } if ((np == NULL) && (nmsk < softn->ipf_nat_map_max)) { nmsk++; @@ -5026,15 +5026,23 @@ outmatchfail: switch (rval) { + case -3 : + /* ipf_nat_match() failure */ + /* FALLTHROUGH */ + case -2 : + /* retry_roundrobin loop failure */ + /* FALLTHROUGH */ case -1 : + /* proxy failure detected by ipf_nat_out() */ if (passp != NULL) { - DT1(frb_natv4out, fr_info_t *, fin); + DT2(frb_natv4out, fr_info_t *, fin, int, rval); NBUMPSIDED(1, ns_drop); *passp = FR_BLOCK; fin->fin_reason = FRB_NATV4; } fin->fin_flx |= FI_BADNAT; NBUMPSIDED(1, ns_badnat); + rval = -1; /* We only return -1 on error. */ break; case 0 : NBUMPSIDE(1, ns_ignored); @@ -5442,7 +5450,7 @@ retry_roundrobin: case 0 : continue; case -1 : - rval = -1; + rval = -3; goto inmatchfail; case 1 : default : @@ -5489,7 +5497,7 @@ retry_roundrobin: natfailed = 0; break; } - natfailed = -1; + natfailed = -2; } if ((np == NULL) && (rmsk < softn->ipf_nat_rdr_max)) { rmsk++; @@ -5514,15 +5522,23 @@ inmatchfail: switch (rval) { + case -3 : + /* ipf_nat_match() failure */ + /* FALLTHROUGH */ + case -2 : + /* retry_roundrobin loop failure */ + /* FALLTHROUGH */ case -1 : + /* proxy failure detected by ipf_nat_in() */ if (passp != NULL) { - DT1(frb_natv4in, fr_info_t *, fin); + DT2(frb_natv4in, fr_info_t *, fin, int, rval); NBUMPSIDED(0, ns_drop); *passp = FR_BLOCK; fin->fin_reason = FRB_NATV4; } fin->fin_flx |= FI_BADNAT; NBUMPSIDED(0, ns_badnat); + rval = -1; /* We only return -1 on error. */ break; case 0 : NBUMPSIDE(0, ns_ignored); From owner-svn-src-all@freebsd.org Fri Aug 17 03:01: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 58567107F931; Fri, 17 Aug 2018 03:01:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1CC888C1; Fri, 17 Aug 2018 03:01:03 +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 E2DD6227B1; Fri, 17 Aug 2018 03:01:02 +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 w7H312QA009761; Fri, 17 Aug 2018 03:01:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H312aQ009758; Fri, 17 Aug 2018 03:01:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170301.w7H312aQ009758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 03:01: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: r337949 - stable/11/sys/dev/iwn X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/dev/iwn X-SVN-Commit-Revision: 337949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 03:01:03 -0000 Author: kevans Date: Fri Aug 17 03:01:01 2018 New Revision: 337949 URL: https://svnweb.freebsd.org/changeset/base/337949 Log: MFC r335785, r335812 r335785 by eadler: iwn: Correct Centrino Advanced-N 6235 constants The iwn 6235 is a 2x2 device (see https://ark.intel.com/products/66890/Intel-Centrino-Advanced-N-6235-Dual-Band) r335812 by eadler: iwn: Add the missing IWN_SDID_6035_5 subdevice Modified: stable/11/sys/dev/iwn/if_iwn.c stable/11/sys/dev/iwn/if_iwn_chip_cfg.h stable/11/sys/dev/iwn/if_iwn_devid.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/11/sys/dev/iwn/if_iwn.c Fri Aug 17 02:46:36 2018 (r337948) +++ stable/11/sys/dev/iwn/if_iwn.c Fri Aug 17 03:01:01 2018 (r337949) @@ -860,6 +860,7 @@ iwn_config_specific(struct iwn_softc *sc, uint16_t pid case IWN_SDID_6035_2: case IWN_SDID_6035_3: case IWN_SDID_6035_4: + case IWN_SDID_6035_5: sc->fwname = "iwn6000g2bfw"; sc->limits = &iwn6235_sensitivity_limits; sc->base_params = &iwn_6235_base_params; Modified: stable/11/sys/dev/iwn/if_iwn_chip_cfg.h ============================================================================== --- stable/11/sys/dev/iwn/if_iwn_chip_cfg.h Fri Aug 17 02:46:36 2018 (r337948) +++ stable/11/sys/dev/iwn/if_iwn_chip_cfg.h Fri Aug 17 03:01:01 2018 (r337949) @@ -382,8 +382,7 @@ static const struct iwn_base_params iwn_6235_base_para | IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), .support_hostap = false, .no_multi_vaps = true, - /* XXX 1x2? This NIC is 2x2, right? */ - .additional_gp_drv_bit = IWN_GP_DRIVER_6050_1X2, + .additional_gp_drv_bit = 0, .bt_mode = IWN_BT_ADVANCED, .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; Modified: stable/11/sys/dev/iwn/if_iwn_devid.h ============================================================================== --- stable/11/sys/dev/iwn/if_iwn_devid.h Fri Aug 17 02:46:36 2018 (r337948) +++ stable/11/sys/dev/iwn/if_iwn_devid.h Fri Aug 17 03:01:01 2018 (r337949) @@ -170,6 +170,7 @@ #define IWN_SDID_6035_2 0x4260 #define IWN_SDID_6035_3 0x4460 #define IWN_SDID_6035_4 0x4860 +#define IWN_SDID_6035_5 0x5260 /* * -------------------------------------------------------------------------- * Device ID for 1030 and 6030 Series From owner-svn-src-all@freebsd.org Fri Aug 17 03:03:28 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 7F9B1107FACA; Fri, 17 Aug 2018 03:03:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F85E88E1C; Fri, 17 Aug 2018 03:03:28 +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 D5C1022984; Fri, 17 Aug 2018 03:03:27 +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 w7H33Rot010699; Fri, 17 Aug 2018 03:03:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H33RPc010698; Fri, 17 Aug 2018 03:03:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170303.w7H33RPc010698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 03:03:27 +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: r337950 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 337950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 03:03:28 -0000 Author: kevans Date: Fri Aug 17 03:03:27 2018 New Revision: 337950 URL: https://svnweb.freebsd.org/changeset/base/337950 Log: MFC r336184: net80211: Fix ifdetach w/o ifattach, small whitespace cleanup As the comment says, ifdetach might be called during the course of driver detach if initialization failed. This shouldn't be a total failure, though, we just have nothing to do there. This has been modified slightly from Augustin's original commit to move the bail-out slightly earlier since the ic wouldn't have been added to the ic list in the first place, and a comment has been added describing when this might be an issue. Modified: stable/11/sys/net80211/ieee80211.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211.c ============================================================================== --- stable/11/sys/net80211/ieee80211.c Fri Aug 17 03:01:01 2018 (r337949) +++ stable/11/sys/net80211/ieee80211.c Fri Aug 17 03:03:27 2018 (r337950) @@ -247,14 +247,14 @@ null_update_chw(struct ieee80211com *ic) int ic_printf(struct ieee80211com *ic, const char * fmt, ...) -{ +{ va_list ap; int retval; retval = printf("%s: ", ic->ic_name); va_start(ap, fmt); retval += vprintf(fmt, ap); - va_end(ap); + va_end(ap); return (retval); } @@ -356,6 +356,15 @@ ieee80211_ifdetach(struct ieee80211com *ic) { struct ieee80211vap *vap; + /* + * We use this as an indicator that ifattach never had a chance to be + * called, e.g. early driver attach failed and ifdetach was called + * during subsequent detach. Never fear, for we have nothing to do + * here. + */ + if (ic->ic_tq == NULL) + return; + mtx_lock(&ic_list_mtx); LIST_REMOVE(ic, ic_next); mtx_unlock(&ic_list_mtx); @@ -635,7 +644,7 @@ ieee80211_vap_attach(struct ieee80211vap *vap, ifm_cha return 1; } -/* +/* * Tear down vap state and reclaim the ifnet. * The driver is assumed to have prepared for * this; e.g. by turning off interrupts for the @@ -1356,7 +1365,7 @@ addmedia(struct ifmedia *media, int caps, int addsta, #define ADD(_ic, _s, _o) \ ifmedia_add(media, \ IFM_MAKEWORD(IFM_IEEE80211, (_s), (_o), 0), 0, NULL) - static const u_int mopts[IEEE80211_MODE_MAX] = { + static const u_int mopts[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_AUTO] = IFM_AUTO, [IEEE80211_MODE_11A] = IFM_IEEE80211_11A, [IEEE80211_MODE_11B] = IFM_IEEE80211_11B, @@ -1954,13 +1963,13 @@ ieee80211_rate2media(struct ieee80211com *ic, int rate case IEEE80211_MODE_11NA: case IEEE80211_MODE_TURBO_A: case IEEE80211_MODE_STURBO_A: - return findmedia(rates, nitems(rates), + return findmedia(rates, nitems(rates), rate | IFM_IEEE80211_11A); case IEEE80211_MODE_11B: - return findmedia(rates, nitems(rates), + return findmedia(rates, nitems(rates), rate | IFM_IEEE80211_11B); case IEEE80211_MODE_FH: - return findmedia(rates, nitems(rates), + return findmedia(rates, nitems(rates), rate | IFM_IEEE80211_FH); case IEEE80211_MODE_AUTO: /* NB: ic may be NULL for some drivers */ From owner-svn-src-all@freebsd.org Fri Aug 17 03:05: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 1C300107FB73; Fri, 17 Aug 2018 03:05:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C569A88F9B; Fri, 17 Aug 2018 03:05:10 +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 A66FC22989; Fri, 17 Aug 2018 03:05:10 +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 w7H35ASj010832; Fri, 17 Aug 2018 03:05:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H35AtU010830; Fri, 17 Aug 2018 03:05:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170305.w7H35AtU010830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 03:05: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: r337951 - in stable/11/sys: dev/ath dev/bwi net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys: dev/ath dev/bwi net80211 X-SVN-Commit-Revision: 337951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 03:05:11 -0000 Author: kevans Date: Fri Aug 17 03:05:09 2018 New Revision: 337951 URL: https://svnweb.freebsd.org/changeset/base/337951 Log: MFC r337570-r337573 r337570: bwi(4): Set ic->ic_softc before bwi_getradiocaps to avoid bad deref r337571: net80211: Drain ageq before cleaning it up. The comment above ieee80211_ageq_cleanup specifically notes that the queue is assumed to be empty, and in order to make it so, ieee80211_ageq_drain must be used. r337572: ieee8021_node: fix whitespace issues r337573: ath: Minor style cleanups device_printf => DPRINTF and two whitespace adjustments Modified: stable/11/sys/dev/ath/if_ath_rx_edma.c stable/11/sys/dev/bwi/if_bwi.c stable/11/sys/net80211/ieee80211_node.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_rx_edma.c Fri Aug 17 03:03:27 2018 (r337950) +++ stable/11/sys/dev/ath/if_ath_rx_edma.c Fri Aug 17 03:05:09 2018 (r337951) @@ -166,7 +166,7 @@ ath_edma_stoprecv(struct ath_softc *sc, int dodelay) ath_hal_setrxfilter(ah, 0); /* - * + * */ if (ath_hal_stopdmarecv(ah) == AH_TRUE) sc->sc_rx_stopped = 1; @@ -727,7 +727,7 @@ ath_edma_rxbuf_alloc(struct ath_softc *sc) bf = TAILQ_FIRST(&sc->sc_rxbuf); /* XXX shouldn't happen upon startup? */ if (bf == NULL) { - device_printf(sc->sc_dev, "%s: nothing on rxbuf?!\n", + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: nothing on rxbuf?!\n", __func__); return (NULL); } @@ -808,7 +808,7 @@ ath_edma_rxfifo_alloc(struct ath_softc *sc, HAL_RX_QUE bf = ath_edma_rxbuf_alloc(sc); /* XXX should ensure the FIFO is not NULL? */ if (bf == NULL) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Q%d: alloc failed: i=%d, nbufs=%d?\n", __func__, qtype, @@ -925,7 +925,7 @@ ath_edma_rxfifo_free(struct ath_softc *sc, HAL_RX_QUEU device_printf(sc->sc_dev, "%s: called; qtype=%d\n", __func__, qtype); - + free(re->m_fifo, M_ATHDEV); return (0); Modified: stable/11/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/11/sys/dev/bwi/if_bwi.c Fri Aug 17 03:03:27 2018 (r337950) +++ stable/11/sys/dev/bwi/if_bwi.c Fri Aug 17 03:05:09 2018 (r337951) @@ -488,10 +488,12 @@ bwi_attach(struct bwi_softc *sc) BWI_SPROM_CARD_INFO_LOCALE); DPRINTF(sc, BWI_DBG_ATTACH, "locale: %d\n", sc->sc_locale); /* XXX use locale */ + + ic->ic_softc = sc; + bwi_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, ic->ic_channels); - ic->ic_softc = sc; ic->ic_name = device_get_nameunit(dev); ic->ic_caps = IEEE80211_C_STA | IEEE80211_C_SHSLOT | Modified: stable/11/sys/net80211/ieee80211_node.c ============================================================================== --- stable/11/sys/net80211/ieee80211_node.c Fri Aug 17 03:03:27 2018 (r337950) +++ stable/11/sys/net80211/ieee80211_node.c Fri Aug 17 03:05:09 2018 (r337951) @@ -30,13 +30,13 @@ __FBSDID("$FreeBSD$"); #include "opt_wlan.h" #include -#include -#include +#include +#include #include #include #include - + #include #include #include @@ -134,6 +134,7 @@ ieee80211_node_detach(struct ieee80211com *ic) callout_drain(&ic->ic_inact); ieee80211_node_table_cleanup(&ic->ic_sta); + ieee80211_ageq_drain(&ic->ic_stageq); ieee80211_ageq_cleanup(&ic->ic_stageq); } @@ -199,7 +200,7 @@ ieee80211_node_vdetach(struct ieee80211vap *vap) } } -/* +/* * Port authorize/unauthorize interfaces for use by an authenticator. */ @@ -370,7 +371,7 @@ ieee80211_create_ibss(struct ieee80211vap* vap, struct memcpy(ni->ni_meshid, vap->iv_mesh->ms_id, ni->ni_meshidlen); #endif } - /* + /* * Fix the channel and related attributes. */ /* clear DFS CAC state on previous channel */ @@ -550,8 +551,8 @@ check_bss_debug(struct ieee80211vap *vap, struct ieee8 printf("%s\n", fail & 0x10 ? "!" : ""); } #endif /* IEEE80211_DEBUG */ - + int ieee80211_ibss_merge_check(struct ieee80211_node *ni) { @@ -811,7 +812,7 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) * Set the erp state (mostly the slot time) to deal with * the auto-select case; this should be redundant if the * mode is locked. - */ + */ ieee80211_reset_erp(ic); ieee80211_wme_initparams(vap); @@ -1517,7 +1518,7 @@ ieee80211_fakeup_adhoc_node(struct ieee80211vap *vap, /* * In adhoc demo mode there are no management * frames to use to discover neighbor capabilities, - * so blindly propagate the local configuration + * so blindly propagate the local configuration * so we can do interesting things (e.g. use * WME to disable ACK's). */ @@ -2099,7 +2100,7 @@ timeout_stations(void *arg __unused, struct ieee80211_ /* XXX before inact decrement? */ if (ni == vap->iv_bss) return; - if (ni->ni_associd != 0 || + if (ni->ni_associd != 0 || (vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_AHDEMO)) { /* From owner-svn-src-all@freebsd.org Fri Aug 17 03:42: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 825791080A40; Fri, 17 Aug 2018 03:42:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 390208A184; Fri, 17 Aug 2018 03:42:58 +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 1A51323018; Fri, 17 Aug 2018 03:42:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7H3gv5g031146; Fri, 17 Aug 2018 03:42:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H3gvHc031145; Fri, 17 Aug 2018 03:42:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170342.w7H3gvHc031145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 03:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337952 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 03:42:58 -0000 Author: kevans Date: Fri Aug 17 03:42:57 2018 New Revision: 337952 URL: https://svnweb.freebsd.org/changeset/base/337952 Log: subr_prf: Don't write kern.boot_tag if it's empty This change allows one to set kern.boot_tag="" and not get a blank line preceding other boot messages. While this isn't super critical- blank lines are easy to filter out both mentally and in processing dmesg later- it allows for a mode of operation that matches previous behavior. I intend to MFC this whole series to stable/11 by the end of the month with boot_tag empty by default to make this effectively a nop in the stable branch. Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Fri Aug 17 03:05:09 2018 (r337951) +++ head/sys/kern/subr_prf.c Fri Aug 17 03:42:57 2018 (r337952) @@ -1048,7 +1048,7 @@ msgbufinit(void *ptr, int size) if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = true; - if (print_boot_tag) + if (print_boot_tag && *current_boot_tag != '\0') printf("%s\n", current_boot_tag); oldp = msgbufp; } From owner-svn-src-all@freebsd.org Fri Aug 17 03:49: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 BA95D1080B4B; Fri, 17 Aug 2018 03:49:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 624BB8A386; Fri, 17 Aug 2018 03:49:08 +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 3E0392302A; Fri, 17 Aug 2018 03:49:08 +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 w7H3n8k0031457; Fri, 17 Aug 2018 03:49:08 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H3n7b5031452; Fri, 17 Aug 2018 03:49:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201808170349.w7H3n7b5031452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 17 Aug 2018 03:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337953 - in head/sys: conf dev/random sys X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf dev/random sys X-SVN-Commit-Revision: 337953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 03:49:09 -0000 Author: jhibbits Date: Fri Aug 17 03:49:07 2018 New Revision: 337953 URL: https://svnweb.freebsd.org/changeset/base/337953 Log: random: Add PowerPC 'darn' instruction entropy source Summary: PowerISA 3.0 adds a 'darn' instruction to "deliver a random number". This driver was modeled after (rather, copied and gutted of) the Ivy Bridge rdrand driver. This uses the "Conditional Random Number" behavior to remove input bias. From the ISA reference the 'darn' instruction, and the random number generator backing it, conforms to the NIST SP800-90B and SP800-90C standards, compliant to the extent possible at the time the hardware was designed, and guarantees a minimum 0.5 bits of entropy per bit returned. Reviewed By: markm, secteam (delphij) Approved by: secteam (delphij) Differential Revision: https://reviews.freebsd.org/D16552 Added: head/sys/dev/random/darn.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/dev/random/random_harvestq.c head/sys/sys/random.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Aug 17 03:42:57 2018 (r337952) +++ head/sys/conf/files.powerpc Fri Aug 17 03:49:07 2018 (r337953) @@ -63,6 +63,7 @@ dev/ofw/ofw_standard.c optional aim powerpc dev/ofw/ofw_subr.c standard dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx +dev/random/darn.c optional powerpc64 random dev/scc/scc_bfe_macio.c optional scc powermac dev/sdhci/fsl_sdhci.c optional mpc85xx sdhci dev/sec/sec.c optional sec mpc85xx Added: head/sys/dev/random/darn.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/darn.c Fri Aug 17 03:49:07 2018 (r337953) @@ -0,0 +1,142 @@ +/*- + * Copyright (c) 2018 Justin Hibbits + * Copyright (c) 2013 The FreeBSD Foundation + * Copyright (c) 2013 David E. O'Brien + * Copyright (c) 2012 Konstantin Belousov + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* + * Power ISA 3.0 adds a "darn" instruction (Deliver A Random Number). The RNG + * backing this instruction conforms to NIST SP800-90B and SP800-90C at the + * point of hardware design, and provides a minimum of 0.5 bits of entropy per + * bit. + */ + +#define RETRY_COUNT 10 + +static u_int random_darn_read(void *, u_int); + +static struct random_source random_darn = { + .rs_ident = "PowerISA DARN random number generator", + .rs_source = RANDOM_PURE_DARN, + .rs_read = random_darn_read +}; + +static inline int +darn_rng_store(u_long *buf) +{ + u_long rndval; + int retry; + + for (retry = RETRY_COUNT; retry > 0; --retry) { + /* "DARN %rN, 1" instruction */ + /* + * Arguments for DARN: rN and "L", where "L" can be one of: + * 0 - 32-bit conditional random number + * 1 - Conditional random number (conditioned to remove bias) + * 2 - Raw random number (unprocessed, may include bias) + * 3 - Reserved + */ + __asm __volatile(".long 0x7c0105e6 | (%0 << 21)" : + "+r"(rndval)); + if (rndval != ~0) + break; + } + + *buf = rndval; + return (retry); +} + +/* It is required that buf length is a multiple of sizeof(u_long). */ +static u_int +random_darn_read(void *buf, u_int c) +{ + u_long *b, rndval; + u_int count; + + KASSERT(c % sizeof(*b) == 0, ("partial read %d", c)); + b = buf; + for (count = c; count > 0; count -= sizeof(*b)) { + if (darn_rng_store(&rndval) == 0) + break; + *b++ = rndval; + } + return (c - count); +} + +static int +darn_modevent(module_t mod, int type, void *unused) +{ + int error = 0; + + switch (type) { + case MOD_LOAD: + if (cpu_features2 & PPC_FEATURE2_DARN) { + random_source_register(&random_darn); + printf("random: fast provider: \"%s\"\n", random_darn.rs_ident); + } + break; + + case MOD_UNLOAD: + if (cpu_features2 & PPC_FEATURE2_DARN) + random_source_deregister(&random_darn); + break; + + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; + + } + + return (error); +} + +DEV_MODULE(darn, darn_modevent, NULL); +MODULE_VERSION(darn, 1); +MODULE_DEPEND(darn, random_device, 1, 1, 1); Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Fri Aug 17 03:42:57 2018 (r337952) +++ head/sys/dev/random/random_harvestq.c Fri Aug 17 03:49:07 2018 (r337953) @@ -307,6 +307,7 @@ static const char *random_source_descr[ENTROPYSOURCE] [RANDOM_PURE_VIRTIO] = "PURE_VIRTIO", [RANDOM_PURE_BROADCOM] = "PURE_BROADCOM", [RANDOM_PURE_CCP] = "PURE_CCP", + [RANDOM_PURE_DARN] = "PURE_DARN", /* "ENTROPYSOURCE" */ }; Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Fri Aug 17 03:42:57 2018 (r337952) +++ head/sys/sys/random.h Fri Aug 17 03:49:07 2018 (r337953) @@ -95,6 +95,7 @@ enum random_entropy_source { RANDOM_PURE_VIRTIO, RANDOM_PURE_BROADCOM, RANDOM_PURE_CCP, + RANDOM_PURE_DARN, ENTROPYSOURCE }; From owner-svn-src-all@freebsd.org Fri Aug 17 04: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 D77101081522; Fri, 17 Aug 2018 04:09:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DC3F8AE45; Fri, 17 Aug 2018 04:09:46 +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 5266E23391; Fri, 17 Aug 2018 04:09:46 +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 w7H49kIH041760; Fri, 17 Aug 2018 04:09:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H49kd5041759; Fri, 17 Aug 2018 04:09:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170409.w7H49kd5041759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 04:09:46 +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: r337954 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 04:09:47 -0000 Author: kevans Date: Fri Aug 17 04:09:45 2018 New Revision: 337954 URL: https://svnweb.freebsd.org/changeset/base/337954 Log: MFC r337607: Destroy a couple of rogue svn:mergeinfo This is generally just an MFC in spirit- the offending svn:mergeinfo apparently disappeared in r331019. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Fri Aug 17 04:11: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 6522D10815F1; Fri, 17 Aug 2018 04:11:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BEBA8B004; Fri, 17 Aug 2018 04:11:11 +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 F1B4F233C6; Fri, 17 Aug 2018 04:11:10 +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 w7H4BAGK044827; Fri, 17 Aug 2018 04:11:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H4BAV1044826; Fri, 17 Aug 2018 04:11:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170411.w7H4BAV1044826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 04:11: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: r337955 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 04:11:11 -0000 Author: kevans Date: Fri Aug 17 04:11:10 2018 New Revision: 337955 URL: https://svnweb.freebsd.org/changeset/base/337955 Log: MFC r335173, r335195 r335173: extres/regulator: Properly refcount gpio regulators regnode::enable_cnt is generally used to refcount regulator nodes. For GPIOs, the refcount was done on the gpio_entry since more than one regulator can share a GPIO. GPIO regulators were not taking part in the node refcount, since they had their own mechanism. This caused some fallout after manu started disabling everybody's unused regulators in r331989. Refcount it. r335195: Revert r335173 at request of mmel@ This was the wrong solution to the problem; regulator_shutdown invokes regnode_stop. regulator_stop is not a refcounting method, but it invokes regnode_enable, which is. mmel@ has a proposed patch/solution to instead provide regnode_fixed_stop behavior that properly takes shared GPIO pins into account. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Fri Aug 17 04:15: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 9122A10818BE; Fri, 17 Aug 2018 04:15:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3830E8B423; Fri, 17 Aug 2018 04:15:53 +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 0C2E623538; Fri, 17 Aug 2018 04:15:53 +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 w7H4FqBG046780; Fri, 17 Aug 2018 04:15:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H4Fp7D046775; Fri, 17 Aug 2018 04:15:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170415.w7H4Fp7D046775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 04:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337956 - in head: . bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . bin/ls X-SVN-Commit-Revision: 337956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 04:15:53 -0000 Author: kevans Date: Fri Aug 17 04:15:51 2018 New Revision: 337956 URL: https://svnweb.freebsd.org/changeset/base/337956 Log: ls(1): Add --color=when --color may be set to one of: 'auto', 'always', and 'never'. 'auto' is the default behavior- output colors only if -G or COLORTERM are set, and only if stdout is a tty. 'always' is a new behavior- output colors always. termcap(5) will be consulted unless TERM is unset or not a recognized terminal, in which case ls(1) will fall back to explicitly outputting ANSI escape sequences. 'never' to turn off any environment variable and -G usage. Reviewed by: cem, 0mp (both modulo last-minute manpage changes Differential Revision: https://reviews.freebsd.org/D16741 Modified: head/UPDATING head/bin/ls/extern.h head/bin/ls/ls.1 head/bin/ls/ls.c head/bin/ls/print.c head/bin/ls/util.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Aug 17 04:11:10 2018 (r337955) +++ head/UPDATING Fri Aug 17 04:15:51 2018 (r337956) @@ -35,9 +35,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ls(1) now respects the COLORTERM environment variable used in other systems and software to indicate that a colored terminal is both supported and desired. If ls(1) is suddenly emitting colors, they may - be disabled again by removing the unwanted COLORTERM from your - environment. The ls(1) specific CLICOLOR may not be observed in a - future release. + be disabled again by either removing the unwanted COLORTERM from your + environment, or using `ls --color=never`. The ls(1) specific CLICOLOR + may not be observed in a future release. 20180808: The default pager for most commands has been changed to "less". To Modified: head/bin/ls/extern.h ============================================================================== --- head/bin/ls/extern.h Fri Aug 17 04:11:10 2018 (r337955) +++ head/bin/ls/extern.h Fri Aug 17 04:15:51 2018 (r337956) @@ -32,6 +32,8 @@ * $FreeBSD$ */ +#include + int acccmp(const FTSENT *, const FTSENT *); int revacccmp(const FTSENT *, const FTSENT *); int birthcmp(const FTSENT *, const FTSENT *); @@ -64,5 +66,12 @@ extern char *ansi_bgcol; extern char *ansi_coloff; extern char *attrs_off; extern char *enter_bold; + +extern int colorflag; +extern bool explicitansi; + +#define COLORFLAG_NEVER 0 +#define COLORFLAG_AUTO 1 +#define COLORFLAG_ALWAYS 2 #endif extern int termwidth; Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Fri Aug 17 04:11:10 2018 (r337955) +++ head/bin/ls/ls.1 Fri Aug 17 04:15:51 2018 (r337956) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd August 8, 2018 +.Dd August 16, 2018 .Dt LS 1 .Os .Sh NAME @@ -41,6 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, +.Op Fl -color Ns = Ns Ar when .Op Fl D Ar format .Op Ar .Sh DESCRIPTION @@ -210,6 +211,47 @@ This option is not defined in .St -p1003.1-2001 . .It Fl c Use time when file status was last changed for sorting or printing. +.It Fl -color Ns = Ns Ar when +Output colored escape sequences based on +.Ar when , +which may be set to either +.Cm always , +.Cm auto +(default), or +.Cm never . +.Pp +.Cm always +will make +.Nm +always output color. +If +.Ev TERM +is unset or set to an invalid terminal, then +.Nm +will fall back to explicit +.Tn ANSI +escape sequences without the help of +.Xr termcap 5 . +.Cm always +is the default if +.Fl -color +is specified without an argument. +.Pp +.Cm auto +will make +.Nm +output escape sequences based on +.Xr termcap 5 , +but only if +.Dv stdout +is a tty and either the +.Fl G +flag is specified or the +.Ev COLORTERM +environment variable is set and not empty. +.Pp +.Cm never +will disable color regardless of environment variables. .It Fl d Directories are listed as plain files (not searched recursively). .It Fl f @@ -620,7 +662,10 @@ Colorization is silently disabled if the output is not directed to a terminal unless the .Ev CLICOLOR_FORCE -variable is defined. +variable is defined or +.Fl -color +is set to +.Dq always . .It Ev CLICOLOR_FORCE Color sequences are normally disabled if the output is not directed to a terminal. Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Fri Aug 17 04:11:10 2018 (r337955) +++ head/bin/ls/ls.c Fri Aug 17 04:15:51 2018 (r337956) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -99,6 +100,16 @@ static void display(const FTSENT *, FTSENT *, int); static int mastercmp(const FTSENT * const *, const FTSENT * const *); static void traverse(int, char **, int); +#define COLOR_OPT (CHAR_MAX + 1) + +static const struct option long_opts[] = +{ +#ifdef COLORLS + {"color", optional_argument, NULL, COLOR_OPT}, +#endif + {NULL, no_argument, NULL, 0} +}; + static void (*printfcn)(const DISPLAY *); static int (*sortfcn)(const FTSENT *, const FTSENT *); @@ -140,10 +151,10 @@ static int f_stream; /* stream the output, separate w static int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ static int f_whiteout; /* show whiteout entries */ - #ifdef COLORLS + int colorflag = COLORFLAG_AUTO; /* passed in colorflag */ int f_color; /* add type in color for non-regular files */ - + bool explicitansi; /* Explicit ANSI sequences, no termcap(5) */ char *ansi_bgcol; /* ANSI sequence to set background colour */ char *ansi_fgcol; /* ANSI sequence to set foreground colour */ char *ansi_coloff; /* ANSI sequence to reset colours */ @@ -176,6 +187,19 @@ do_color_from_env(void) (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))); } +static bool +do_color(void) +{ + +#ifdef COLORLS + if (colorflag == COLORFLAG_NEVER) + return (false); + else if (colorflag == COLORFLAG_ALWAYS) + return (true); +#endif + return (do_color_from_env()); +} + int main(int argc, char *argv[]) { @@ -187,7 +211,7 @@ main(int argc, char *argv[]) #ifdef COLORLS char termcapbuf[1024]; /* termcap definition buffer */ char tcapbuf[512]; /* capability buffer */ - char *bp = tcapbuf; + char *bp = tcapbuf, *term; #endif (void)setlocale(LC_ALL, ""); @@ -215,8 +239,9 @@ main(int argc, char *argv[]) fts_options = FTS_PHYSICAL; if (getenv("LS_SAMESORT")) f_samesort = 1; - while ((ch = getopt(argc, argv, - "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { + while ((ch = getopt_long(argc, argv, + "+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts, + NULL)) != -1) { switch (ch) { /* * The -1, -C, -x and -l options all override each other so @@ -379,6 +404,19 @@ main(int argc, char *argv[]) case 'y': f_samesort = 1; break; +#ifdef COLORLS + case COLOR_OPT: + if (optarg == NULL || strcmp(optarg, "always") == 0) + colorflag = COLORFLAG_ALWAYS; + else if (strcmp(optarg, "auto") == 0) + colorflag = COLORFLAG_AUTO; + else if (strcmp(optarg, "never") == 0) + colorflag = COLORFLAG_NEVER; + else + errx(2, "unsupported --color value '%s' (must be always, auto, or never)", + optarg); + break; +#endif default: case '?': usage(); @@ -391,10 +429,14 @@ main(int argc, char *argv[]) if (!f_listdot && getuid() == (uid_t)0 && !f_noautodot) f_listdot = 1; - /* Enabling of colours is conditional on the environment. */ - if (do_color_from_env()) + /* + * Enabling of colours is conditional on the environment in conjunction + * with the --color and -G arguments, if supplied. + */ + if (do_color()) { #ifdef COLORLS - if (tgetent(termcapbuf, getenv("TERM")) == 1) { + if ((term = getenv("TERM")) != NULL && + tgetent(termcapbuf, term) == 1) { ansi_fgcol = tgetstr("AF", &bp); ansi_bgcol = tgetstr("AB", &bp); attrs_off = tgetstr("me", &bp); @@ -408,10 +450,19 @@ main(int argc, char *argv[]) ansi_coloff = tgetstr("oc", &bp); if (ansi_fgcol && ansi_bgcol && ansi_coloff) f_color = 1; + } else if (colorflag == COLORFLAG_ALWAYS) { + /* + * If we're *always* doing color but we don't have + * a functional TERM supplied, we'll fallback to + * outputting raw ANSI sequences. + */ + f_color = 1; + explicitansi = true; } #else warnx("color support not compiled in"); #endif /*COLORLS*/ + } #ifdef COLORLS if (f_color) { Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Fri Aug 17 04:11:10 2018 (r337955) +++ head/bin/ls/print.c Fri Aug 17 04:15:51 2018 (r337956) @@ -73,6 +73,8 @@ static void printtime(time_t); static int printtype(u_int); static void printsize(size_t, off_t); #ifdef COLORLS +static void endcolor_termcap(int); +static void endcolor_ansi(void); static void endcolor(int); static int colortype(mode_t); #endif @@ -540,7 +542,7 @@ writech(int c) } static void -printcolor(Colors c) +printcolor_termcap(Colors c) { char *ansiseq; @@ -560,10 +562,53 @@ printcolor(Colors c) } static void -endcolor(int sig) +printcolor_ansi(Colors c) { + + printf("\033["); + + if (colors[c].bold) + printf("1"); + if (colors[c].num[0] != -1) + printf(";3%d", colors[c].num[0]); + if (colors[c].num[1] != -1) + printf(";4%d", colors[c].num[1]); + printf("m"); +} + +static void +printcolor(Colors c) +{ + + if (explicitansi) + printcolor_ansi(c); + else + printcolor_termcap(c); +} + +static void +endcolor_termcap(int sig) +{ + tputs(ansi_coloff, 1, sig ? writech : putch); tputs(attrs_off, 1, sig ? writech : putch); +} + +static void +endcolor_ansi(void) +{ + + printf("\33[m"); +} + +static void +endcolor(int sig) +{ + + if (explicitansi) + endcolor_ansi(); + else + endcolor_termcap(sig); } static int Modified: head/bin/ls/util.c ============================================================================== --- head/bin/ls/util.c Fri Aug 17 04:11:10 2018 (r337955) +++ head/bin/ls/util.c Fri Aug 17 04:15:51 2018 (r337956) @@ -227,7 +227,7 @@ usage(void) { (void)fprintf(stderr, #ifdef COLORLS - "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" + "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [--color=when] [-D format]" #else "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #endif From owner-svn-src-all@freebsd.org Fri Aug 17 04:17: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 0079C1081A01; Fri, 17 Aug 2018 04:17:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A632D8B629; Fri, 17 Aug 2018 04:17:52 +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 8543E2354D; Fri, 17 Aug 2018 04:17:52 +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 w7H4HqLI046901; Fri, 17 Aug 2018 04:17:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H4HpL0046896; Fri, 17 Aug 2018 04:17:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808170417.w7H4HpL0046896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 04:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337957 - in head: lib/libefivar share/man/man4 share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libefivar share/man/man4 share/man/man9 X-SVN-Commit-Revision: 337957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 04:17:53 -0000 Author: kevans Date: Fri Aug 17 04:17:51 2018 New Revision: 337957 URL: https://svnweb.freebsd.org/changeset/base/337957 Log: Add efidev(4)/efirt(9) Document efidev(4), provider of userland access to EFI Runtime Services. A link is created to efirtc(4), which handles the time-of-day clock side. efirt(9) is the kernel side of this. Reviewed by: imp, kib (earlier version) Differential Revision: https://reviews.freebsd.org/D16696 Added: head/share/man/man4/efidev.4 (contents, props changed) head/share/man/man9/efirt.9 (contents, props changed) Modified: head/lib/libefivar/efivar.3 head/share/man/man4/Makefile head/share/man/man9/Makefile Modified: head/lib/libefivar/efivar.3 ============================================================================== --- head/lib/libefivar/efivar.3 Fri Aug 17 04:15:51 2018 (r337956) +++ head/lib/libefivar/efivar.3 Fri Aug 17 04:17:51 2018 (r337957) @@ -92,6 +92,8 @@ This function is not actually implemented. .Sh BUGS No facilities exist to process the strings as native UTF. This is a limitation in the Linux libefivar library interface. +.Sh SEE ALSO +.Xr efidev 4 .Sh AUTHORS .An -nosplit This software was originally written by Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Aug 17 04:15:51 2018 (r337956) +++ head/share/man/man4/Makefile Fri Aug 17 04:17:51 2018 (r337957) @@ -900,6 +900,12 @@ _dtrace_provs= dtrace_io.4 \ dtrace_udplite.4 .endif +.if ${MK_EFI} != "no" +MAN+= efidev.4 + +MLINKS+= efidev.4 efirtc.4 +.endif + .if ${MK_ISCSI} != "no" MAN+= cfiscsi.4 MAN+= iscsi.4 Added: head/share/man/man4/efidev.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/efidev.4 Fri Aug 17 04:17:51 2018 (r337957) @@ -0,0 +1,143 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 12, 2018 +.Dt EFIDEV 4 +.Os +.Sh NAME +.Nm efidev , +.Nm efirtc +.Nd user-mode access to UEFI runtime services +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in your +kernel configuration file: +.Bd -ragged -offset -indent +.Cd "options EFIRT" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +efirt_load="YES" +.Ed +.Pp +.Nm +may be disabled by setting the +.Xr loader 8 +tunable +.Va efi.rt.disabled +to 1. +.Pp +.Nm +is currently only available on amd64 and arm64. +.Sh DESCRIPTION +The +.Nm +device provides user-mode access to UEFI runtime services. +.Nm +also includes a driver to provide a time-of-day clock using the UEFI +real time clock (RTC). +However, the RTC may not always be available, based on the UEFI firmware. +If the RTC is not available, it will not be registered as a time-of-day clock +and the time related ioctls below will not be functional. +.Pp +.Nm +provides the following ioctls defined in +.In sys/efiio.h +with supplemental structures and constants defined in +.In sys/efi.h : +.Bl -tag -width ".Dv EFIIOC_GET_TABLE" +.It Dv EFIIOC_GET_TABLE Pq Vt "struct efi_get_table_ioc" +Get a table by uuid from the UEFI system table. +.Bd -literal +struct efi_get_table_ioc { + struct uuid uuid; + void *ptr; +}; +.Ed +.It Dv EFIIOC_GET_TIME Pq Vt "struct efi_tm" +Get the time from the RTC, if the RTC is available. +The +.Vt struct efi_tm +passed is populated with the current time, unless an error occurs. +.Bd -literal +struct efi_tm { + uint16_t tm_year; + uint8_t tm_mon + uint8_t tm_mday + uint8_t tm_hour; + uint8_t tm_min; + uint8_t tm_sec; + uint8_t __pad1; + uint32_t tm_nsec; + int16_t tm_tz; + uint8_t tm_dst; + uint8_t __pad2; +}; +.Ed +.It Dv EFIIOC_SET_TIME Pq Vt "struct efi_tm" +Sets the time stored by the RTC, if the RTC is available. +.It Dv EFIIOC_VAR_GET Pq Vt "struct efi_var_ioc" +Gets data from the variable described by the vendor and name fields of the +.Vt struct efi_var_ioc +into the aata field. +.Dv EFIIOC_VAR_GET Pq Vt "struct efi_var_ioc" +will also populate the attrib field. +.Bd -literal +struct efi_var_ioc { + efi_char *name; + size_t namesize; + struct uuid vendor; + uint32_t attrib; + void *data; + size_t datasize; +}; +.Ed +.It Dv EFIIOC_VAR_NEXT Pq Vt "struct efi_var_ioc" +Used for enumerating all UEFI variables. +The initial call should use an empty string for the name attribute. +Subsequent calls should supply the vendor uuid and name of the last variable +returned. +.It Dv EFIIOC_VAR_SET Pq Vt "struct efi_var_ioc" +Sets data and attributes for the variable described by the name and vendor in +the +.Vt struct efi_var_ioc . +.El +.Sh FILES +.Bl -tag -width /dev/efi +.It Pa /dev/efi +.El +.Sh SEE ALSO +.Xr efivar 3 +.Xr efirt 9 +.Sh HISTORY +A +.Nm +device first appeared in +.Fx 11.1 . Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Aug 17 04:15:51 2018 (r337956) +++ head/share/man/man9/Makefile Fri Aug 17 04:17:51 2018 (r337957) @@ -123,6 +123,7 @@ MAN= accept_filter.9 \ drbr.9 \ driver.9 \ DRIVER_MODULE.9 \ + efirt.9 \ epoch.9 \ EVENTHANDLER.9 \ eventtimers.9 \ Added: head/share/man/man9/efirt.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/efirt.9 Fri Aug 17 04:17:51 2018 (r337957) @@ -0,0 +1,250 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Kyle Evans +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 12, 2018 +.Dt EFIRT 9 +.Os +.Sh NAME +.Nm efirt , +.Nm efi_rt_ok , +.Nm efi_get_table , +.Nm efi_get_time , +.Nm efi_get_time_capabilities , +.Nm efi_reset_system , +.Nm efi_set_time , +.Nm efi_var_get , +.Nm efi_var_nextname , +.Nm efi_var_set +.Nd kernel access to UEFI runtime services +.Sh SYNOPSIS +.Cd "options EFIRT" +.Pp +.In sys/efi.h +.Ft int +.Fn efi_rt_ok "void" +.Ft int +.Fn efi_get_table "struct uuid *uuid" "void **ptr" +.Ft int +.Fn efi_get_time "struct efi_tm *tm" +.Ft int +.Fn efi_get_time_capabilities "struct efi_tmcap *tmcap" +.Ft int +.Fn efi_reset_system "void" +.Ft int +.Fn efi_set_time "struct efi_tm *tm" +.Ft int +.Fn efi_var_get "uint16_t *name" "struct uuid *vendor" "uint32_t *attrib" \ + "size_t *datasize" "void *data" +.Ft int +.Fn efi_var_nextname "size_t *namesize" "uint16_t *name" "struct uuid *vendor" +.Ft int +.Fn efi_var_set "uint16_t *name" "struct uuid *vendor" "uint32_t *attrib" \ + "size_t *datasize" "void *data" +.Sh DESCRIPTION +All of the following calls will return +.Dv ENXIO +if UEFI runtime services are not available. +.Nm +is currently only available on amd64 and arm64. +.Pp +The +.Fn efi_rt_ok +Returns 0 if UEFI runtime services are present and functional, or +.Dv ENXIO +if not. +.Pp +The +.Fn efi_get_table +function gets a table by uuid from the UEFI system table. +Returns 0 if the table was found and populates *ptr with the address. +Returns +.Dv ENXIO +if the configuration table or system table are unset. +Returns +.Dv ENOENT +if the requested table cannot be found. +.Pp +The +.Fn efi_get_time +function gets the current time from the RTC, if available. +Returns 0 and populates the +.Vt struct efi_tm +on success. +Returns +.Dv EINVAL +if the +.Vt struct efi_tm +is +.Dv NULL , +or +.Dv EIO +if the time could not be retrieved due to a hardware error. +.Pp +The +.Fn efi_get_time_capabilities +function gets the capabilities from the RTC. +Returns 0 and populates the +.Vt struct efi_tmcap +on success. +Returns +.Dv EINVAL +if the +.Vt struct efi_tm +is +.Dv NULL , +or +.Dv EIO +if the time could not be retrieved due to a hardware error. +.Pp +The +.Fn efi_reset_system +function requests a warm reset and reboot of the system. +.Pp +The +.Fn efi_set_time +function sets the time on the RTC to the time described by the +.Vt struct efi_tm +passed in. +Returns 0 on success, +.Dv EINVAL +if a time field is out of range, or +.Dv EIO +if the time could not be set due to a hardware error. +.Pp +The +.Fn efi_var_get +function fetches the variable identified by +.Fa vendor +and +.Fa name . +Returns 0 and populates +.Fa attrib , +.Fa datasize , +and +.Fa data +on success. +Otherwise, one of the following errors are returned: +.Bl -tag -width ".Dv EOVERFLOW" +.It Dv ENOENT +The variable was not found. +.It Dv EOVERFLOW +.Fa datasize +is not sufficient to hold the variable data. +.Fa namesize +is updated to reflect the size needed to complete the request. +.It Dv EINVAL +One of +.Fa name , +.Fa vendor , +or +.Fa datasize +are NULL. +Alternatively, +.Fa datasize +is large enough to hold the response but +.Fa data +is NULL. +.It Dv EIO +The variable could not be retrieved due to a hardware error. +.It Dv EDOOFUS +The variable could not be retireved due to an authentication failure. +.El +.Pp +The +.Fn efi_var_nextname +function is used for enumeration of variables. +On the initial call to +.Fn efi_var_nextname , +.Fa name +should be an empty string. +Subsequent calls should pass in the last +.Fa name +and +.Fa vendor +returned until +.Dv ENOENT +is returned. +Returns 0 and populates +.Fa namesize , +.Fa name , +and +.Fa vendor +with the next variable's data. +Otherwise, returns one of the following errors: +.Bl -tag -width ".Dv EOVERFLOW" +.It Dv ENOENT +The next variable was not found. +.It Dv EOVERFLOW +.Fa datasize +is not sufficient to hold the variable data. +.Fa namesize +is updated to reflect the size needed to complete the request. +.It Dv EINVAL +One of +.Fa name , +.Fa vendor , +or +.Fa datasize +are NULL. +.It Dv EIO +The variable could not be retrieved due to a hardware error. +.El +.Pp +The +.Fn efi_var_set +function sets the variable described by +.Fa name +and +.Fa vendor . +Returns 0 if the variable has been successfully. +Otherwise, returns one of the following errors: +.Bl -tag -width ".Dv EOVERFLOW" +.It Dv EINVAL +Either +.Fa attrib +was an invalid combination of attributes, +.Fa datasize +exceeds the maximum allowed size, or +.Fa name +is an empty Unicode stirng. +.It Dv EAGAIN +Not enough storage is available to hold the variable and its data. +.It Dv EIO +The variable could not be saved due to a hardware error. +.It Dv EROFS +The variable in question is read-only or may not be deleted. +.It Dv EDOOFUS +The varialbe could not be set due to an authentication failure. +.It Dv ENOENT +The variable trying to be updated or deleted was not found. +.El +.Sh SEE ALSO +.Xr efidev 4 +.Sh AUTHORS +This manual page was written by +.An Kyle Evans Aq Mt kevans@FreeBSD.org . From owner-svn-src-all@freebsd.org Fri Aug 17 04:40:02 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 4F53A108206E; Fri, 17 Aug 2018 04:40:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0121E8C1B3; Fri, 17 Aug 2018 04:40:02 +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 D65EB23891; Fri, 17 Aug 2018 04:40:01 +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 w7H4e1Wu056994; Fri, 17 Aug 2018 04:40:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H4e1Cj056992; Fri, 17 Aug 2018 04:40:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170440.w7H4e1Cj056992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 04:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337958 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 337958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 04:40:02 -0000 Author: cem Date: Fri Aug 17 04:40:01 2018 New Revision: 337958 URL: https://svnweb.freebsd.org/changeset/base/337958 Log: cryptosoft: Reduce generality of supported algorithm composition Fix a regression introduced in r336439. Rather than allowing any linked list of algorithms, allow at most two (typically, some combination of encrypt and/or MAC). Removes a WAITOK malloc in an unsleepable context (classic LOR) by placing both software algorithm contexts within the OCF-managed session object. Tested with 'cryptocheck -a all -d cryptosoft0', which includes some encrypt-and-MAC modes. PR: 230304 Reported by: sef@ Modified: head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/cryptosoft.h Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Fri Aug 17 04:17:51 2018 (r337957) +++ head/sys/opencrypto/cryptosoft.c Fri Aug 17 04:40:01 2018 (r337958) @@ -497,6 +497,7 @@ swcr_authenc(struct cryptop *crp) u_char uaalg[AALG_MAX_RESULT_LEN]; u_char iv[EALG_MAX_BLOCK_LEN]; union authctx ctx; + struct swcr_session *ses; struct cryptodesc *crd, *crda = NULL, *crde = NULL; struct swcr_data *sw, *swa, *swe = NULL; struct auth_hash *axf = NULL; @@ -507,14 +508,16 @@ swcr_authenc(struct cryptop *crp) ivlen = blksz = iskip = oskip = 0; + ses = crypto_get_driver_session(crp->crp_session); + for (crd = crp->crp_desc; crd; crd = crd->crd_next) { - for (sw = crypto_get_driver_session(crp->crp_session); - sw && sw->sw_alg != crd->crd_alg; - sw = sw->sw_next) + for (i = 0; i < nitems(ses->swcr_algorithms) && + ses->swcr_algorithms[i].sw_alg != crd->crd_alg; i++) ; - if (sw == NULL) + if (i == nitems(ses->swcr_algorithms)) return (EINVAL); + sw = &ses->swcr_algorithms[i]; switch (sw->sw_alg) { case CRYPTO_AES_NIST_GCM_16: case CRYPTO_AES_NIST_GMAC: @@ -749,10 +752,12 @@ swcr_compdec(struct cryptodesc *crd, struct swcr_data static int swcr_newsession(device_t dev, crypto_session_t cses, struct cryptoini *cri) { - struct swcr_data **swd, *ses; + struct swcr_session *ses; + struct swcr_data *swd; struct auth_hash *axf; struct enc_xform *txf; struct comp_algo *cxf; + size_t i; int len; int error; @@ -760,16 +765,9 @@ swcr_newsession(device_t dev, crypto_session_t cses, s return EINVAL; ses = crypto_get_driver_session(cses); - swd = &ses; - while (cri) { - if (*swd == NULL) - *swd = malloc(sizeof(struct swcr_data), - M_CRYPTO_DATA, M_WAITOK | M_ZERO); - if (*swd == NULL) { - swcr_freesession(dev, cses); - return ENOBUFS; - } + for (i = 0; cri != NULL && i < nitems(ses->swcr_algorithms); i++) { + swd = &ses->swcr_algorithms[i]; switch (cri->cri_alg) { case CRYPTO_DES_CBC: @@ -801,7 +799,7 @@ swcr_newsession(device_t dev, crypto_session_t cses, s goto enccommon; case CRYPTO_AES_NIST_GMAC: txf = &enc_xform_aes_nist_gmac; - (*swd)->sw_exf = txf; + swd->sw_exf = txf; break; case CRYPTO_CAMELLIA_CBC: txf = &enc_xform_camellia; @@ -814,14 +812,14 @@ swcr_newsession(device_t dev, crypto_session_t cses, s goto enccommon; enccommon: if (cri->cri_key != NULL) { - error = txf->setkey(&((*swd)->sw_kschedule), + error = txf->setkey(&swd->sw_kschedule, cri->cri_key, cri->cri_klen / 8); if (error) { swcr_freesession(dev, cses); return error; } } - (*swd)->sw_exf = txf; + swd->sw_exf = txf; break; case CRYPTO_MD5_HMAC: @@ -848,22 +846,22 @@ swcr_newsession(device_t dev, crypto_session_t cses, s case CRYPTO_RIPEMD160_HMAC: axf = &auth_hash_hmac_ripemd_160; authcommon: - (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, + swd->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); - if ((*swd)->sw_ictx == NULL) { + if (swd->sw_ictx == NULL) { swcr_freesession(dev, cses); return ENOBUFS; } - (*swd)->sw_octx = malloc(axf->ctxsize, M_CRYPTO_DATA, + swd->sw_octx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); - if ((*swd)->sw_octx == NULL) { + if (swd->sw_octx == NULL) { swcr_freesession(dev, cses); return ENOBUFS; } if (cri->cri_key != NULL) { - error = swcr_authprepare(axf, *swd, + error = swcr_authprepare(axf, swd, cri->cri_key, cri->cri_klen); if (error != 0) { swcr_freesession(dev, cses); @@ -871,8 +869,8 @@ swcr_newsession(device_t dev, crypto_session_t cses, s } } - (*swd)->sw_mlen = cri->cri_mlen; - (*swd)->sw_axf = axf; + swd->sw_mlen = cri->cri_mlen; + swd->sw_axf = axf; break; case CRYPTO_MD5_KPDK: @@ -882,23 +880,23 @@ swcr_newsession(device_t dev, crypto_session_t cses, s case CRYPTO_SHA1_KPDK: axf = &auth_hash_key_sha1; auth2common: - (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, + swd->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); - if ((*swd)->sw_ictx == NULL) { + if (swd->sw_ictx == NULL) { swcr_freesession(dev, cses); return ENOBUFS; } - (*swd)->sw_octx = malloc(cri->cri_klen / 8, + swd->sw_octx = malloc(cri->cri_klen / 8, M_CRYPTO_DATA, M_NOWAIT); - if ((*swd)->sw_octx == NULL) { + if (swd->sw_octx == NULL) { swcr_freesession(dev, cses); return ENOBUFS; } /* Store the key so we can "append" it to the payload */ if (cri->cri_key != NULL) { - error = swcr_authprepare(axf, *swd, + error = swcr_authprepare(axf, swd, cri->cri_key, cri->cri_klen); if (error != 0) { swcr_freesession(dev, cses); @@ -906,8 +904,8 @@ swcr_newsession(device_t dev, crypto_session_t cses, s } } - (*swd)->sw_mlen = cri->cri_mlen; - (*swd)->sw_axf = axf; + swd->sw_mlen = cri->cri_mlen; + swd->sw_axf = axf; break; #ifdef notdef case CRYPTO_MD5: @@ -931,16 +929,16 @@ swcr_newsession(device_t dev, crypto_session_t cses, s axf = &auth_hash_sha2_512; auth3common: - (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, + swd->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); - if ((*swd)->sw_ictx == NULL) { + if (swd->sw_ictx == NULL) { swcr_freesession(dev, cses); return ENOBUFS; } - axf->Init((*swd)->sw_ictx); - (*swd)->sw_mlen = cri->cri_mlen; - (*swd)->sw_axf = axf; + axf->Init(swd->sw_ictx); + swd->sw_mlen = cri->cri_mlen; + swd->sw_axf = axf; break; case CRYPTO_AES_128_NIST_GMAC: @@ -960,15 +958,15 @@ swcr_newsession(device_t dev, crypto_session_t cses, s return EINVAL; } - (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, + swd->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); - if ((*swd)->sw_ictx == NULL) { + if (swd->sw_ictx == NULL) { swcr_freesession(dev, cses); return ENOBUFS; } - axf->Init((*swd)->sw_ictx); - axf->Setkey((*swd)->sw_ictx, cri->cri_key, len); - (*swd)->sw_axf = axf; + axf->Init(swd->sw_ictx); + axf->Setkey(swd->sw_ictx, cri->cri_key, len); + swd->sw_axf = axf; break; case CRYPTO_BLAKE2B: @@ -980,45 +978,52 @@ swcr_newsession(device_t dev, crypto_session_t cses, s case CRYPTO_POLY1305: axf = &auth_hash_poly1305; auth5common: - (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, + swd->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); - if ((*swd)->sw_ictx == NULL) { + if (swd->sw_ictx == NULL) { swcr_freesession(dev, cses); return ENOBUFS; } - axf->Setkey((*swd)->sw_ictx, cri->cri_key, + axf->Setkey(swd->sw_ictx, cri->cri_key, cri->cri_klen / 8); - axf->Init((*swd)->sw_ictx); - (*swd)->sw_axf = axf; + axf->Init(swd->sw_ictx); + swd->sw_axf = axf; break; case CRYPTO_DEFLATE_COMP: cxf = &comp_algo_deflate; - (*swd)->sw_cxf = cxf; + swd->sw_cxf = cxf; break; default: swcr_freesession(dev, cses); return EINVAL; } - (*swd)->sw_alg = cri->cri_alg; + swd->sw_alg = cri->cri_alg; cri = cri->cri_next; - swd = &((*swd)->sw_next); + ses->swcr_nalgs++; } + + if (cri != NULL) { + CRYPTDEB("Bogus session request for three or more algorithms"); + return EINVAL; + } return 0; } static void swcr_freesession(device_t dev, crypto_session_t cses) { - struct swcr_data *ses, *swd, *next; + struct swcr_session *ses; + struct swcr_data *swd; struct enc_xform *txf; struct auth_hash *axf; + size_t i; ses = crypto_get_driver_session(cses); - for (swd = ses; swd != NULL; swd = next) { - next = swd->sw_next; + for (i = 0; i < nitems(ses->swcr_algorithms); i++) { + swd = &ses->swcr_algorithms[i]; switch (swd->sw_alg) { case CRYPTO_DES_CBC: @@ -1095,10 +1100,6 @@ swcr_freesession(device_t dev, crypto_session_t cses) /* Nothing to do */ break; } - - /* OCF owns and frees the primary session object */ - if (swd != ses) - free(swd, M_CRYPTO_DATA); } } @@ -1108,8 +1109,10 @@ swcr_freesession(device_t dev, crypto_session_t cses) static int swcr_process(device_t dev, struct cryptop *crp, int hint) { + struct swcr_session *ses; struct cryptodesc *crd; - struct swcr_data *sw, *ses; + struct swcr_data *sw; + size_t i; /* Sanity check */ if (crp == NULL) @@ -1134,15 +1137,16 @@ swcr_process(device_t dev, struct cryptop *crp, int hi * XXX between the various instances of an algorithm (so we can * XXX locate the correct crypto context). */ - for (sw = ses; sw && sw->sw_alg != crd->crd_alg; - sw = sw->sw_next) + for (i = 0; i < nitems(ses->swcr_algorithms) && + ses->swcr_algorithms[i].sw_alg != crd->crd_alg; i++) ; /* No such context ? */ - if (sw == NULL) { + if (i == nitems(ses->swcr_algorithms)) { crp->crp_etype = EINVAL; goto done; } + sw = &ses->swcr_algorithms[i]; switch (sw->sw_alg) { case CRYPTO_DES_CBC: case CRYPTO_3DES_CBC: @@ -1235,7 +1239,7 @@ swcr_attach(device_t dev) memset(hmac_ipad_buffer, HMAC_IPAD_VAL, HMAC_MAX_BLOCK_LEN); memset(hmac_opad_buffer, HMAC_OPAD_VAL, HMAC_MAX_BLOCK_LEN); - swcr_id = crypto_get_driverid(dev, sizeof(struct swcr_data), + swcr_id = crypto_get_driverid(dev, sizeof(struct swcr_session), CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_SYNC); if (swcr_id < 0) { device_printf(dev, "cannot initialize!"); Modified: head/sys/opencrypto/cryptosoft.h ============================================================================== --- head/sys/opencrypto/cryptosoft.h Fri Aug 17 04:17:51 2018 (r337957) +++ head/sys/opencrypto/cryptosoft.h Fri Aug 17 04:40:01 2018 (r337958) @@ -55,8 +55,11 @@ struct swcr_data { #define sw_exf SWCR_UN.SWCR_ENC.SW_exf #define sw_size SWCR_UN.SWCR_COMP.SW_size #define sw_cxf SWCR_UN.SWCR_COMP.SW_cxf +}; - struct swcr_data *sw_next; +struct swcr_session { + struct swcr_data swcr_algorithms[2]; + unsigned swcr_nalgs; }; #ifdef _KERNEL From owner-svn-src-all@freebsd.org Fri Aug 17 05:03:26 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 EDA0210828C1; Fri, 17 Aug 2018 05:03:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FAEE8CE6D; Fri, 17 Aug 2018 05:03:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id qWunfztJg5HxqqWupfKUcR; Thu, 16 Aug 2018 23:03:17 -0600 X-Authority-Analysis: v=2.3 cv=BMcHU2YG c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=8nJEP1OIZ-IA:10 a=dapMudl6Dx4A:10 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=1Or5bU9e0AI0tzUjqsgA:9 a=6xGzzM0H9_jsLZEB:21 a=wPNLvfGTeEIA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 573A920EA; Thu, 16 Aug 2018 22:03:42 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w7H53GD4023610; Thu, 16 Aug 2018 22:03:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w7H53GR9023607; Thu, 16 Aug 2018 22:03:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201808170503.w7H53GR9023607@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... In-Reply-To: Message from Conrad Meyer of "Fri, 17 Aug 2018 00:23:51 -0000." <201808170023.w7H0Np0H027296@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Thu, 16 Aug 2018 22:03:16 -0700 X-CMAE-Envelope: MS4wfPSTkQqYBrVW26YyxWDPzyMQB97TwOpK25qzL85s0S0GU4nudg0R9qiPbGgzoEWcXRGc5TAUvtcLWDwgPf+e7P+6+ZPn/NQ7ONPrXckkgiQOICtu2d7W 8nhiE8ds6UyLZ+Bmg/EagqY/VDJf/L3p3j1jpX88DGIxU2d+LqS/yGNmY+VcDcL+98OjXRxudWcktYqdDYyollhuieZIiDQZiXT+XpP/3cctgFq8K3zh5EY+ VPyTErOrJId7KZ55MMUxcvwRa5UNxNwnRzqbrbW48Kn+zVkKH1BlyhqZkTzqxn0m X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 05:03:26 -0000 In message <201808170023.w7H0Np0H027296@repo.freebsd.org>, Conrad Meyer writes: > Author: cem > Date: Fri Aug 17 00:23:50 2018 > New Revision: 337936 > URL: https://svnweb.freebsd.org/changeset/base/337936 > > Log: > Bring in libsodium to sys/contrib > > Bring in https://github.com/jedisct1/libsodium at > 461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified. > > libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl > ("Networking and Cryptography Library," pronounced "salt") software library > . > At the risk of oversimplifying, libsodium primarily exists to make it easie > r > to use NaCl. NaCl and libsodium provide high quality implementations of a > number of useful cryptographic concepts (as well as the underlying > primitics) seeing some adoption in newer network protocols. > > I considered but dismissed cleaning up the directory hierarchy and > discarding artifacts of other build systems in favor of remaining close to > upstream (and easing future updates). > > Nothing is integrated into the build system yet, so in that sense, no > functional change. > > Added: > head/sys/contrib/libsodium/ > head/sys/contrib/libsodium/.gitignore > head/sys/contrib/libsodium/.travis.yml > head/sys/contrib/libsodium/AUTHORS > head/sys/contrib/libsodium/ChangeLog > head/sys/contrib/libsodium/LICENSE > head/sys/contrib/libsodium/Makefile.am (contents, props changed) > head/sys/contrib/libsodium/README.markdown > head/sys/contrib/libsodium/THANKS > head/sys/contrib/libsodium/appveyor.yml > head/sys/contrib/libsodium/autogen.sh (contents, props changed) > head/sys/contrib/libsodium/builds/ > head/sys/contrib/libsodium/builds/.gitignore > head/sys/contrib/libsodium/builds/Makefile.am (contents, props changed) > head/sys/contrib/libsodium/builds/msvc/ > head/sys/contrib/libsodium/builds/msvc/build/ > head/sys/contrib/libsodium/builds/msvc/build/buildall.bat > head/sys/contrib/libsodium/builds/msvc/build/buildbase.bat > head/sys/contrib/libsodium/builds/msvc/properties/ > head/sys/contrib/libsodium/builds/msvc/properties/Common.props > head/sys/contrib/libsodium/builds/msvc/properties/DLL.props > head/sys/contrib/libsodium/builds/msvc/properties/Debug.props > head/sys/contrib/libsodium/builds/msvc/properties/DebugDEXE.props > head/sys/contrib/libsodium/builds/msvc/properties/DebugDLL.props > head/sys/contrib/libsodium/builds/msvc/properties/DebugLEXE.props > head/sys/contrib/libsodium/builds/msvc/properties/DebugLIB.props > head/sys/contrib/libsodium/builds/msvc/properties/DebugLTCG.props > head/sys/contrib/libsodium/builds/msvc/properties/DebugSEXE.props > head/sys/contrib/libsodium/builds/msvc/properties/EXE.props > head/sys/contrib/libsodium/builds/msvc/properties/LIB.props > head/sys/contrib/libsodium/builds/msvc/properties/LTCG.props > head/sys/contrib/libsodium/builds/msvc/properties/Link.props > head/sys/contrib/libsodium/builds/msvc/properties/Messages.props > head/sys/contrib/libsodium/builds/msvc/properties/Output.props > head/sys/contrib/libsodium/builds/msvc/properties/Release.props > head/sys/contrib/libsodium/builds/msvc/properties/ReleaseDEXE.props > head/sys/contrib/libsodium/builds/msvc/properties/ReleaseDLL.props > head/sys/contrib/libsodium/builds/msvc/properties/ReleaseLEXE.props > head/sys/contrib/libsodium/builds/msvc/properties/ReleaseLIB.props > head/sys/contrib/libsodium/builds/msvc/properties/ReleaseLTCG.props > head/sys/contrib/libsodium/builds/msvc/properties/ReleaseSEXE.props > head/sys/contrib/libsodium/builds/msvc/properties/Win32.props > head/sys/contrib/libsodium/builds/msvc/properties/x64.props > head/sys/contrib/libsodium/builds/msvc/resource.h (contents, props change > d) > head/sys/contrib/libsodium/builds/msvc/resource.rc > head/sys/contrib/libsodium/builds/msvc/version.h (contents, props changed > ) > head/sys/contrib/libsodium/builds/msvc/vs2010/ > head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/ > head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium.import.props > head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium.import.xml (conte > nts, props changed) > head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium.sln > head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/libsodium.props > head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj > head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.f > ilters > head/sys/contrib/libsodium/builds/msvc/vs2010/libsodium/libsodium.xml (co > ntents, props changed) > head/sys/contrib/libsodium/builds/msvc/vs2012/ > head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/ > head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium.import.props > head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium.import.xml (conte > nts, props changed) > head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium.sln > head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/libsodium.props > head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj > head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.f > ilters > head/sys/contrib/libsodium/builds/msvc/vs2012/libsodium/libsodium.xml (co > ntents, props changed) > head/sys/contrib/libsodium/builds/msvc/vs2013/ > head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/ > head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium.import.props > head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium.import.xml (conte > nts, props changed) > head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium.sln > head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/libsodium.props > head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj > head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.f > ilters > head/sys/contrib/libsodium/builds/msvc/vs2013/libsodium/libsodium.xml (co > ntents, props changed) > head/sys/contrib/libsodium/builds/msvc/vs2015/ > head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/ > head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium.import.props > head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium.import.xml (conte > nts, props changed) > head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium.sln > head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/libsodium.props > head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj > head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.f > ilters > head/sys/contrib/libsodium/builds/msvc/vs2015/libsodium/libsodium.xml (co > ntents, props changed) > head/sys/contrib/libsodium/builds/msvc/vs2017/ > head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/ > head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium.import.props > head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium.import.xml (conte > nts, props changed) > head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium.sln > head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/libsodium.props > head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj > head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.f > ilters > head/sys/contrib/libsodium/builds/msvc/vs2017/libsodium/libsodium.xml (co > ntents, props changed) > head/sys/contrib/libsodium/configure.ac > head/sys/contrib/libsodium/contrib/ > head/sys/contrib/libsodium/contrib/Findsodium.cmake > head/sys/contrib/libsodium/contrib/Makefile.am (contents, props changed) > head/sys/contrib/libsodium/dist-build/ > head/sys/contrib/libsodium/dist-build/Makefile.am (contents, props change > d) > head/sys/contrib/libsodium/dist-build/android-arm.sh (contents, props cha > nged) > head/sys/contrib/libsodium/dist-build/android-armv7-a.sh (contents, props > changed) > head/sys/contrib/libsodium/dist-build/android-armv8-a.sh (contents, props > changed) > head/sys/contrib/libsodium/dist-build/android-build.sh (contents, props c > hanged) > head/sys/contrib/libsodium/dist-build/android-mips32.sh (contents, props > changed) > head/sys/contrib/libsodium/dist-build/android-mips64.sh (contents, props > changed) > head/sys/contrib/libsodium/dist-build/android-x86.sh (contents, props cha > nged) > head/sys/contrib/libsodium/dist-build/android-x86_64.sh (contents, props > changed) > head/sys/contrib/libsodium/dist-build/emscripten-symbols.def > head/sys/contrib/libsodium/dist-build/emscripten.sh (contents, props chan > ged) > head/sys/contrib/libsodium/dist-build/generate-emscripten-symbols.sh (con > tents, props changed) > head/sys/contrib/libsodium/dist-build/ios.sh (contents, props changed) > head/sys/contrib/libsodium/dist-build/msys2-win32.sh (contents, props cha > nged) > head/sys/contrib/libsodium/dist-build/msys2-win64.sh (contents, props cha > nged) > head/sys/contrib/libsodium/dist-build/nativeclient-pnacl.sh (contents, pr > ops changed) > head/sys/contrib/libsodium/dist-build/nativeclient-x86.sh (contents, prop > s changed) > head/sys/contrib/libsodium/dist-build/nativeclient-x86_64.sh (contents, p > rops changed) > head/sys/contrib/libsodium/dist-build/osx.sh (contents, props changed) > head/sys/contrib/libsodium/lgtm.yml > head/sys/contrib/libsodium/libsodium-uninstalled.pc.in (contents, props c > hanged) > head/sys/contrib/libsodium/libsodium.pc.in (contents, props changed) > head/sys/contrib/libsodium/libsodium.sln > head/sys/contrib/libsodium/libsodium.vcxproj > head/sys/contrib/libsodium/libsodium.vcxproj.filters > head/sys/contrib/libsodium/m4/ > head/sys/contrib/libsodium/m4/ax_check_catchable_abrt.m4 > head/sys/contrib/libsodium/m4/ax_check_catchable_segv.m4 > head/sys/contrib/libsodium/m4/ax_check_compile_flag.m4 > head/sys/contrib/libsodium/m4/ax_check_define.m4 > head/sys/contrib/libsodium/m4/ax_check_gnu_make.m4 > head/sys/contrib/libsodium/m4/ax_check_link_flag.m4 > head/sys/contrib/libsodium/m4/ax_pthread.m4 > head/sys/contrib/libsodium/m4/ax_tls.m4 > head/sys/contrib/libsodium/m4/ax_valgrind_check.m4 > head/sys/contrib/libsodium/m4/ld-output-def.m4 > head/sys/contrib/libsodium/msvc-scripts/ > head/sys/contrib/libsodium/msvc-scripts/Makefile.am (contents, props chan > ged) > head/sys/contrib/libsodium/msvc-scripts/process.bat > head/sys/contrib/libsodium/msvc-scripts/rep.vbs > head/sys/contrib/libsodium/msvc-scripts/sodium.props > head/sys/contrib/libsodium/packaging/ > head/sys/contrib/libsodium/packaging/dotnet-core/ > head/sys/contrib/libsodium/packaging/dotnet-core/.gitignore > head/sys/contrib/libsodium/packaging/dotnet-core/README.md > head/sys/contrib/libsodium/packaging/dotnet-core/libsodium.props > head/sys/contrib/libsodium/packaging/dotnet-core/prepare.py (contents, pr > ops changed) > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/ > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/alpine-x64 > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/build > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/centos-x64 > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/debian-x64 > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/fedora-x64 > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/linux-x64 > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/opensuse-x64 > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/pack > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/test > head/sys/contrib/libsodium/packaging/dotnet-core/recipes/ubuntu-x64 > head/sys/contrib/libsodium/packaging/nuget/ > head/sys/contrib/libsodium/packaging/nuget/.gitignore > head/sys/contrib/libsodium/packaging/nuget/package.bat > head/sys/contrib/libsodium/packaging/nuget/package.config > head/sys/contrib/libsodium/packaging/nuget/package.gsl > head/sys/contrib/libsodium/regen-msvc/ > head/sys/contrib/libsodium/regen-msvc/libsodium.vcxproj > head/sys/contrib/libsodium/regen-msvc/libsodium.vcxproj.filters > head/sys/contrib/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl > head/sys/contrib/libsodium/regen-msvc/libsodium.vcxproj.tpl > head/sys/contrib/libsodium/regen-msvc/regen-msvc.py (contents, props chan > ged) > head/sys/contrib/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl > head/sys/contrib/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl > head/sys/contrib/libsodium/src/ > head/sys/contrib/libsodium/src/Makefile.am (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/ > head/sys/contrib/libsodium/src/libsodium/Makefile.am (contents, props cha > nged) > head/sys/contrib/libsodium/src/libsodium/crypto_aead/ > head/sys/contrib/libsodium/src/libsodium/crypto_aead/aes256gcm/ > head/sys/contrib/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/ > head/sys/contrib/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_a > es256gcm_aesni.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_aead/chacha20poly1305/ > head/sys/contrib/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodiu > m/ > head/sys/contrib/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodiu > m/aead_chacha20poly1305.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/ > head/sys/contrib/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodi > um/ > head/sys/contrib/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodi > um/aead_xchacha20poly1305.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_auth/ > head/sys/contrib/libsodium/src/libsodium/crypto_auth/crypto_auth.c (conte > nts, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha256/ > head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsh > a256.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha512/ > head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsh > a512.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha512256/ > head/sys/contrib/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hma > csha512256.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_box/ > head/sys/contrib/libsodium/src/libsodium/crypto_box/crypto_box.c (content > s, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_box/crypto_box_easy.c (co > ntents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_box/crypto_box_seal.c (co > ntents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly > 1305/ > head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly > 1305/box_curve25519xchacha20poly1305.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly > 1305/box_seal_curve25519xchacha20poly1305.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1 > 305/ > head/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1 > 305/box_curve25519xsalsa20poly1305.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ > ref10.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/ > base.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/ > base2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/ > constants.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/ > fe.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/ba > se.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/ba > se2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/co > nstants.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe > .h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/hchacha20/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha > 20.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/hsalsa20/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/hsalsa20/core_hsalsa20 > .c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsa > lsa20_ref2.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_core/salsa/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/salsa/ref/ > head/sys/contrib/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_r > ef.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/ > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/generic > hash_blake2.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/ > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-compress-avx2.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-compress-avx2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-compress-ref.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-compress-sse41.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-compress-sse41.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-compress-ssse3.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-compress-ssse3.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-load-avx2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-load-sse2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-load-sse41.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/bla > ke2b-ref.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/blake2b/ref/gen > erichash_blake2b.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_generichash/crypto_generich > ash.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_hash/ > head/sys/contrib/libsodium/src/libsodium/crypto_hash/crypto_hash.c (conte > nts, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha256/ > head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha256/cp/ > head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_ > cp.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256.c > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha512/ > head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha512/cp/ > head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_ > cp.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_hash/sha512/hash_sha512.c > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_kdf/ > head/sys/contrib/libsodium/src/libsodium/crypto_kdf/blake2b/ > head/sys/contrib/libsodium/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_kdf/crypto_kdf.c (content > s, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_kx/ > head/sys/contrib/libsodium/src/libsodium/crypto_kx/crypto_kx.c (contents, > props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/ > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/crypto_onetimea > uth.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/ > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/ > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/ > poly1305_donna.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/ > poly1305_donna.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/ > poly1305_donna32.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/ > poly1305_donna64.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetim > eauth_poly1305.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetim > eauth_poly1305.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/ > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/p > oly1305_sse2.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/p > oly1305_sse2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/ > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/ > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encodi > ng.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encodi > ng.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-b > lock-avx2.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-b > lock-avx512f.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-b > lock-ref.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-b > lock-ssse3.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c (c > ontents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h (c > ontents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long. > c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round- > avx2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round- > avx512f.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round- > ref.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round- > ssse3.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2 > i.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2 > id.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c (c > ontents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > / > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /crypto_scrypt-common.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /crypto_scrypt.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /nosse/ > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /nosse/pwhash_scryptsalsa208sha256_nosse.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /pbkdf2-sha256.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /pbkdf2-sha256.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /pwhash_scryptsalsa208sha256.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /scrypt_platform.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /sse/ > head/sys/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 > /sse/pwhash_scryptsalsa208sha256_sse.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/ > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmul > t.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/ > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10 > / > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10 > /x25519_ref10.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10 > /x25519_ref10.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/ > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/consts.S (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/consts_namespace.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/curve25519_sandy2x.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/curve25519_sandy2x.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/fe.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/fe51.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/fe51_invert.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/fe51_mul.S (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/fe51_namespace.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/fe51_nsquare.S (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/fe51_pack.S (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/fe_frombytes_sandy2x.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/ladder.S (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/ladder.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/ladder_base.S (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/ladder_base.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/ladder_base_namespace.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/ladder_namespace.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy > 2x/sandy2x.S (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/scala > rmult_curve25519.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/curve25519/scala > rmult_curve25519.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/ed25519/ > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10/ > head/sys/contrib/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10/sc > alarmult_ed25519_ref10.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/ > head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox. > c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_ > easy.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305 > / > head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305 > /secretbox_xchacha20poly1305.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ > head/sys/contrib/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ > secretbox_xsalsa20poly1305.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_secretstream/ > head/sys/contrib/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1 > 305/ > head/sys/contrib/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1 > 305/secretstream_xchacha20poly1305.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/ > head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/crypto_shorthash. > c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ > head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/ > head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/sho > rthash_siphash24_ref.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/sho > rthash_siphash_ref.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/sho > rthash_siphashx24_ref.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/shortha > sh_siphash24.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_shorthash/siphash24/shortha > sh_siphashx24.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_sign/ > head/sys/contrib/libsodium/src/libsodium/crypto_sign/crypto_sign.c (conte > nts, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ > head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ > head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair. > c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete > .c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign_ed2 > 5519_ref10.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/cha > cha20_dolbeau-avx2.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/cha > cha20_dolbeau-avx2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/cha > cha20_dolbeau-ssse3.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/cha > cha20_dolbeau-ssse3.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u0. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u1. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u4. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u8. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/ref/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha2 > 0_ref.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha2 > 0_ref.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/stream_chac > ha20.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/chacha20/stream_chac > ha20.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/crypto_stream.c (c > ontents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/ref/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ > ref.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ > ref.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa > 20.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa > 20.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20 > _xmm6-asm.S (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20 > _xmm6.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20 > _xmm6.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/sals > a20_xmm6int-avx2.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/sals > a20_xmm6int-avx2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/sals > a20_xmm6int-sse2.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/sals > a20_xmm6int-sse2.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u1.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u4.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u8.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa2012/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa2012/ref/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream > _salsa2012_ref.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa2012/stream_sal > sa2012.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa208/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa208/ref/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_ > salsa208_ref.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/salsa208/stream_sals > a208.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/xchacha20/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/xchacha20/stream_xch > acha20.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_stream/xsalsa20/ > head/sys/contrib/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsal > sa20.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/crypto_verify/ > head/sys/contrib/libsodium/src/libsodium/crypto_verify/sodium/ > head/sys/contrib/libsodium/src/libsodium/crypto_verify/sodium/verify.c (c > ontents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/ > head/sys/contrib/libsodium/src/libsodium/include/Makefile.am (contents, p > rops changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/ > head/sys/contrib/libsodium/src/libsodium/include/sodium.h (contents, prop > s changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/core.h (contents, > props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_aead_aes256g > cm.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_aead_chacha2 > 0poly1305.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_aead_xchacha > 20poly1305.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_auth.h (co > ntents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha > 256.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha > 512.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha > 512256.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_box.h (con > tents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_box_curve255 > 19xchacha20poly1305.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_box_curve255 > 19xsalsa20poly1305.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_ed25519 > .h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_hchacha > 20.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_hsalsa2 > 0.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_salsa20 > .h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_salsa20 > 12.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_core_salsa20 > 8.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_generichash. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_generichash_ > blake2b.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_hash.h (co > ntents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_hash_sha256. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_hash_sha512. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_kdf.h (con > tents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_kdf_blake2b. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_kx.h (cont > ents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_onetimeauth. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_ > poly1305.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_pwhash.h ( > contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon > 2i.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon > 2id.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryp > tsalsa208sha256.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_scalarmult_c > urve25519.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_scalarmult_e > d25519.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_secretbox.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_secretbox_xc > hacha20poly1305.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_secretbox_xs > alsa20poly1305.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_secretstream > _xchacha20poly1305.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_shorthash.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_shorthash_si > phash24.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_sign.h (co > ntents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519 > .h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_sign_edwards > 25519sha512batch.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream.h ( > contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_chach > a20.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_salsa > 20.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_salsa > 2012.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_salsa > 208.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_xchac > ha20.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_xsals > a20.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_verify_16.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_verify_32.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/crypto_verify_64.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/export.h (content > s, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/private/ > head/sys/contrib/libsodium/src/libsodium/include/sodium/private/common.h > (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/private/ed25519_ref > 10.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/private/ed25519_ref > 10_fe_25_5.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/private/ed25519_ref > 10_fe_51.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/private/implementat > ions.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/private/mutex.h ( > contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/private/sse2_64_32. > h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/randombytes.h (co > ntents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/randombytes_nativec > lient.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/randombytes_salsa20 > _random.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/randombytes_sysrand > om.h (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/runtime.h (conten > ts, props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/utils.h (contents > , props changed) > head/sys/contrib/libsodium/src/libsodium/include/sodium/version.h.in (con > tents, props changed) > head/sys/contrib/libsodium/src/libsodium/randombytes/ > head/sys/contrib/libsodium/src/libsodium/randombytes/nativeclient/ > head/sys/contrib/libsodium/src/libsodium/randombytes/nativeclient/randombyt > es_nativeclient.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/randombytes/randombytes.c (conte > nts, props changed) > head/sys/contrib/libsodium/src/libsodium/randombytes/salsa20/ > head/sys/contrib/libsodium/src/libsodium/randombytes/salsa20/randombytes_sa > lsa20_random.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/randombytes/sysrandom/ > head/sys/contrib/libsodium/src/libsodium/randombytes/sysrandom/randombytes_ > sysrandom.c (contents, props changed) > head/sys/contrib/libsodium/src/libsodium/sodium/ > head/sys/contrib/libsodium/src/libsodium/sodium/codecs.c (contents, props > changed) > head/sys/contrib/libsodium/src/libsodium/sodium/core.c (contents, props c > hanged) > head/sys/contrib/libsodium/src/libsodium/sodium/runtime.c (contents, prop > s changed) > head/sys/contrib/libsodium/src/libsodium/sodium/utils.c (contents, props > changed) > head/sys/contrib/libsodium/src/libsodium/sodium/version.c (contents, prop > s changed) > head/sys/contrib/libsodium/test/ > head/sys/contrib/libsodium/test/Makefile.am (contents, props changed) > head/sys/contrib/libsodium/test/constcheck.sh (contents, props changed) > head/sys/contrib/libsodium/test/default/ > head/sys/contrib/libsodium/test/default/Makefile.am (contents, props chan > ged) > head/sys/contrib/libsodium/test/default/aead_aes256gcm.c (contents, props > changed) > head/sys/contrib/libsodium/test/default/aead_aes256gcm.exp > head/sys/contrib/libsodium/test/default/aead_chacha20poly1305.c (contents > , props changed) > head/sys/contrib/libsodium/test/default/aead_chacha20poly1305.exp > head/sys/contrib/libsodium/test/default/aead_xchacha20poly1305.c (content > s, props changed) > head/sys/contrib/libsodium/test/default/aead_xchacha20poly1305.exp > head/sys/contrib/libsodium/test/default/auth.c (contents, props changed) > head/sys/contrib/libsodium/test/default/auth.exp > head/sys/contrib/libsodium/test/default/auth2.c (contents, props changed) > head/sys/contrib/libsodium/test/default/auth2.exp > head/sys/contrib/libsodium/test/default/auth3.c (contents, props changed) > head/sys/contrib/libsodium/test/default/auth3.exp > head/sys/contrib/libsodium/test/default/auth5.c (contents, props changed) > head/sys/contrib/libsodium/test/default/auth6.c (contents, props changed) > head/sys/contrib/libsodium/test/default/auth6.exp > head/sys/contrib/libsodium/test/default/auth7.c (contents, props changed) > head/sys/contrib/libsodium/test/default/box.c (contents, props changed) > head/sys/contrib/libsodium/test/default/box.exp > head/sys/contrib/libsodium/test/default/box2.c (contents, props changed) > head/sys/contrib/libsodium/test/default/box2.exp > head/sys/contrib/libsodium/test/default/box7.c (contents, props changed) > head/sys/contrib/libsodium/test/default/box8.c (contents, props changed) > head/sys/contrib/libsodium/test/default/box_easy.c (contents, props chang > ed) > head/sys/contrib/libsodium/test/default/box_easy.exp > head/sys/contrib/libsodium/test/default/box_easy2.c (contents, props chan > ged) > head/sys/contrib/libsodium/test/default/box_easy2.exp > head/sys/contrib/libsodium/test/default/box_seal.c (contents, props chang > ed) > head/sys/contrib/libsodium/test/default/box_seal.exp > head/sys/contrib/libsodium/test/default/box_seed.c (contents, props chang > ed) > head/sys/contrib/libsodium/test/default/box_seed.exp > head/sys/contrib/libsodium/test/default/chacha20.c (contents, props chang > ed) > head/sys/contrib/libsodium/test/default/chacha20.exp > head/sys/contrib/libsodium/test/default/cmptest.h (contents, props change > d) > head/sys/contrib/libsodium/test/default/codecs.c (contents, props changed > ) > head/sys/contrib/libsodium/test/default/codecs.exp > head/sys/contrib/libsodium/test/default/core1.c (contents, props changed) > head/sys/contrib/libsodium/test/default/core1.exp > head/sys/contrib/libsodium/test/default/core2.c (contents, props changed) > head/sys/contrib/libsodium/test/default/core2.exp > head/sys/contrib/libsodium/test/default/core3.c (contents, props changed) > head/sys/contrib/libsodium/test/default/core3.exp > head/sys/contrib/libsodium/test/default/core4.c (contents, props changed) > head/sys/contrib/libsodium/test/default/core4.exp > head/sys/contrib/libsodium/test/default/core5.c (contents, props changed) > head/sys/contrib/libsodium/test/default/core5.exp > head/sys/contrib/libsodium/test/default/core6.c (contents, props changed) > head/sys/contrib/libsodium/test/default/core6.exp > head/sys/contrib/libsodium/test/default/core_ed25519.c (contents, props c > hanged) > head/sys/contrib/libsodium/test/default/core_ed25519.exp > head/sys/contrib/libsodium/test/default/ed25519_convert.c (contents, prop > s changed) > head/sys/contrib/libsodium/test/default/ed25519_convert.exp > head/sys/contrib/libsodium/test/default/generichash.c (contents, props ch > anged) > head/sys/contrib/libsodium/test/default/generichash.exp > head/sys/contrib/libsodium/test/default/generichash2.c (contents, props c > hanged) > head/sys/contrib/libsodium/test/default/generichash2.exp > head/sys/contrib/libsodium/test/default/generichash3.c (contents, props c > hanged) > head/sys/contrib/libsodium/test/default/generichash3.exp > head/sys/contrib/libsodium/test/default/hash.c (contents, props changed) > head/sys/contrib/libsodium/test/default/hash.exp > head/sys/contrib/libsodium/test/default/hash2.exp > head/sys/contrib/libsodium/test/default/hash3.c (contents, props changed) > head/sys/contrib/libsodium/test/default/hash3.exp > head/sys/contrib/libsodium/test/default/index.html.tpl > head/sys/contrib/libsodium/test/default/kdf.c (contents, props changed) > head/sys/contrib/libsodium/test/default/kdf.exp > head/sys/contrib/libsodium/test/default/keygen.c (contents, props changed > ) > head/sys/contrib/libsodium/test/default/keygen.exp > head/sys/contrib/libsodium/test/default/kx.c (contents, props changed) > head/sys/contrib/libsodium/test/default/kx.exp > head/sys/contrib/libsodium/test/default/metamorphic.c (contents, props ch > anged) > head/sys/contrib/libsodium/test/default/metamorphic.exp > head/sys/contrib/libsodium/test/default/misuse.c (contents, props changed > ) > head/sys/contrib/libsodium/test/default/nacl-test-wrapper.sh (contents, p > rops changed) > head/sys/contrib/libsodium/test/default/onetimeauth.c (contents, props ch > anged) > head/sys/contrib/libsodium/test/default/onetimeauth.exp > head/sys/contrib/libsodium/test/default/onetimeauth2.c (contents, props c > hanged) > head/sys/contrib/libsodium/test/default/onetimeauth2.exp > head/sys/contrib/libsodium/test/default/onetimeauth7.c (contents, props c > hanged) > head/sys/contrib/libsodium/test/default/pre.js.inc (contents, props chang > ed) > head/sys/contrib/libsodium/test/default/pwhash_argon2i.c (contents, props > changed) > head/sys/contrib/libsodium/test/default/pwhash_argon2i.exp > head/sys/contrib/libsodium/test/default/pwhash_argon2id.c (contents, prop > s changed) > head/sys/contrib/libsodium/test/default/pwhash_argon2id.exp > head/sys/contrib/libsodium/test/default/pwhash_scrypt.c (contents, props > changed) > head/sys/contrib/libsodium/test/default/pwhash_scrypt.exp > head/sys/contrib/libsodium/test/default/pwhash_scrypt_ll.c (contents, pro > ps changed) > head/sys/contrib/libsodium/test/default/pwhash_scrypt_ll.exp > head/sys/contrib/libsodium/test/default/randombytes.c (contents, props ch > anged) > head/sys/contrib/libsodium/test/default/randombytes.exp > head/sys/contrib/libsodium/test/default/scalarmult.c (contents, props cha > nged) > head/sys/contrib/libsodium/test/default/scalarmult.exp > head/sys/contrib/libsodium/test/default/scalarmult2.c (contents, props ch > anged) > head/sys/contrib/libsodium/test/default/scalarmult2.exp > head/sys/contrib/libsodium/test/default/scalarmult5.c (contents, props ch > anged) > head/sys/contrib/libsodium/test/default/scalarmult5.exp > head/sys/contrib/libsodium/test/default/scalarmult6.c (contents, props ch > anged) > head/sys/contrib/libsodium/test/default/scalarmult6.exp > head/sys/contrib/libsodium/test/default/scalarmult7.c (contents, props ch > anged) > head/sys/contrib/libsodium/test/default/scalarmult7.exp > head/sys/contrib/libsodium/test/default/scalarmult_ed25519.c (contents, p > rops changed) > head/sys/contrib/libsodium/test/default/scalarmult_ed25519.exp > head/sys/contrib/libsodium/test/default/secretbox.c (contents, props chan > ged) > head/sys/contrib/libsodium/test/default/secretbox.exp > head/sys/contrib/libsodium/test/default/secretbox2.c (contents, props cha > nged) > head/sys/contrib/libsodium/test/default/secretbox2.exp > head/sys/contrib/libsodium/test/default/secretbox7.c (contents, props cha > nged) > head/sys/contrib/libsodium/test/default/secretbox8.c (contents, props cha > nged) > head/sys/contrib/libsodium/test/default/secretbox_easy.c (contents, props > changed) > head/sys/contrib/libsodium/test/default/secretbox_easy.exp > head/sys/contrib/libsodium/test/default/secretbox_easy2.c (contents, prop > s changed) > head/sys/contrib/libsodium/test/default/secretbox_easy2.exp > head/sys/contrib/libsodium/test/default/secretstream.c (contents, props c > hanged) > head/sys/contrib/libsodium/test/default/secretstream.exp > head/sys/contrib/libsodium/test/default/shorthash.c (contents, props chan > ged) > head/sys/contrib/libsodium/test/default/shorthash.exp > head/sys/contrib/libsodium/test/default/sign.c (contents, props changed) > head/sys/contrib/libsodium/test/default/sign.exp > head/sys/contrib/libsodium/test/default/siphashx24.c (contents, props cha > nged) > head/sys/contrib/libsodium/test/default/siphashx24.exp > head/sys/contrib/libsodium/test/default/sodium_core.c (contents, props ch > anged) > head/sys/contrib/libsodium/test/default/sodium_core.exp > head/sys/contrib/libsodium/test/default/sodium_utils.c (contents, props c > hanged) > head/sys/contrib/libsodium/test/default/sodium_utils.exp > head/sys/contrib/libsodium/test/default/sodium_utils2.c (contents, props > changed) > head/sys/contrib/libsodium/test/default/sodium_utils2.exp > head/sys/contrib/libsodium/test/default/sodium_utils3.c (contents, props > changed) > head/sys/contrib/libsodium/test/default/sodium_utils3.exp > head/sys/contrib/libsodium/test/default/sodium_version.c (contents, props > changed) > head/sys/contrib/libsodium/test/default/sodium_version.exp > head/sys/contrib/libsodium/test/default/stream.c (contents, props changed > ) > head/sys/contrib/libsodium/test/default/stream.exp > head/sys/contrib/libsodium/test/default/stream2.c (contents, props change > d) > head/sys/contrib/libsodium/test/default/stream2.exp > head/sys/contrib/libsodium/test/default/stream3.c (contents, props change > d) > head/sys/contrib/libsodium/test/default/stream3.exp > head/sys/contrib/libsodium/test/default/stream4.c (contents, props change > d) > head/sys/contrib/libsodium/test/default/stream4.exp > head/sys/contrib/libsodium/test/default/verify1.c (contents, props change > d) > head/sys/contrib/libsodium/test/default/verify1.exp > head/sys/contrib/libsodium/test/default/wintest.bat > head/sys/contrib/libsodium/test/default/xchacha20.c (contents, props chan > ged) > head/sys/contrib/libsodium/test/default/xchacha20.exp > head/sys/contrib/libsodium/test/quirks/ > head/sys/contrib/libsodium/test/quirks/quirks.h (contents, props changed) > Why wasn't this imported into vendor-sys first? Especially if we intend on tailoring it over time. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri Aug 17 06:26:28 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 BC3BC1084340; Fri, 17 Aug 2018 06:26: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 68D068EED4; Fri, 17 Aug 2018 06:26:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (unknown [51.52.172.98]) by mail.baldwin.cx (Postfix) with ESMTPSA id 3667A10AFCD; Fri, 17 Aug 2018 02:26:27 -0400 (EDT) Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808170023.w7H0Np0H027296@repo.freebsd.org> From: John Baldwin Message-ID: <3ffeebe7-07c5-bab2-d8c6-45d48adf662f@FreeBSD.org> Date: Fri, 17 Aug 2018 07:26:25 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808170023.w7H0Np0H027296@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 17 Aug 2018 02:26:27 -0400 (EDT) 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.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 06:26:28 -0000 On 8/17/18 1:23 AM, Conrad Meyer wrote: > Author: cem > Date: Fri Aug 17 00:23:50 2018 > New Revision: 337936 > URL: https://svnweb.freebsd.org/changeset/base/337936 > > Log: > Bring in libsodium to sys/contrib > > Bring in https://github.com/jedisct1/libsodium at > 461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified. > > libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl > ("Networking and Cryptography Library," pronounced "salt") software library. > At the risk of oversimplifying, libsodium primarily exists to make it easier > to use NaCl. NaCl and libsodium provide high quality implementations of a > number of useful cryptographic concepts (as well as the underlying > primitics) seeing some adoption in newer network protocols. > > I considered but dismissed cleaning up the directory hierarchy and > discarding artifacts of other build systems in favor of remaining close to > upstream (and easing future updates). > > Nothing is integrated into the build system yet, so in that sense, no > functional change. Can you import this into the vendor area and then do a bootstrap of mergeinfo to sys/contrib? This permits future updates to use svn to merge instead of doing it by hand. It also permits future imports to be done by other developers following our standard, documented process for working with third-party code. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Aug 17 06:31: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 351BD108464A; Fri, 17 Aug 2018 06:31:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE8D18F1B3; Fri, 17 Aug 2018 06:31:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC62924AC1; Fri, 17 Aug 2018 06:31:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7H6VUfq015052; Fri, 17 Aug 2018 06:31:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H6VU1j015051; Fri, 17 Aug 2018 06:31:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808170631.w7H6VU1j015051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 17 Aug 2018 06:31:30 +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: r337959 - in stable: 10/sys/dev/hyperv/pcib 11/sys/dev/hyperv/pcib X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/sys/dev/hyperv/pcib 11/sys/dev/hyperv/pcib X-SVN-Commit-Revision: 337959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 06:31:31 -0000 Author: dim Date: Fri Aug 17 06:31:30 2018 New Revision: 337959 URL: https://svnweb.freebsd.org/changeset/base/337959 Log: MFC r337322: Fix build of hyperv with base gcc on i386 Summary: Base gcc fails to compile `sys/dev/hyperv/pcib/vmbus_pcib.c` for i386, with the following -Werror warnings: cc1: warnings being treated as errors /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'new_pcichild_device': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:567: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'vmbus_pcib_on_channel_callback': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:940: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_pci_protocol_negotiation': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1012: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_pci_enter_d0': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1073: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_send_resources_allocated': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1125: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'vmbus_pcib_map_msi': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1730: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] This is because on i386, several casts from `uint64_t` to a pointer reduce the value from 64 bit to 32 bit. For gcc, this can be fixed by an intermediate cast to uintptr_t. Note that I am assuming the incoming values will always fit into 32 bit! Differential Revision: https://reviews.freebsd.org/D15753 Modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c ============================================================================== --- stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Fri Aug 17 04:40:01 2018 (r337958) +++ stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Fri Aug 17 06:31:30 2018 (r337959) @@ -564,7 +564,7 @@ new_pcichild_device(struct hv_pcibus *hbus, struct pci ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - res_req, sizeof(*res_req), (uint64_t)&ctxt.pkt); + res_req, sizeof(*res_req), (uint64_t)(uintptr_t)&ctxt.pkt); if (ret) goto err; @@ -937,7 +937,8 @@ vmbus_pcib_on_channel_callback(struct vmbus_channel *c switch (pkt->cph_type) { case VMBUS_CHANPKT_TYPE_COMP: - comp_packet = (struct pci_packet *)pkt->cph_xactid; + comp_packet = + (struct pci_packet *)(uintptr_t)pkt->cph_xactid; response = (struct pci_response *)pkt; comp_packet->completion_func(comp_packet->compl_ctxt, response, bytes_rxed); @@ -1009,7 +1010,7 @@ hv_pci_protocol_negotiation(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, version_req, sizeof(*version_req), - (uint64_t)&ctxt.pkt); + (uint64_t)(uintptr_t)&ctxt.pkt); if (ret) goto out; @@ -1070,7 +1071,7 @@ hv_pci_enter_d0(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, d0_entry, sizeof(*d0_entry), - (uint64_t)&ctxt.pkt); + (uint64_t)(uintptr_t)&ctxt.pkt); if (ret) goto out; @@ -1122,7 +1123,8 @@ hv_send_resources_allocated(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - &pkt->message, sizeof(*res_assigned), (uint64_t)pkt); + &pkt->message, sizeof(*res_assigned), + (uint64_t)(uintptr_t)pkt); if (ret) { free_completion(&comp_pkt.host_event); break; @@ -1727,7 +1729,7 @@ vmbus_pcib_map_msi(device_t pcib, device_t child, int ret = vmbus_chan_send(sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, int_pkt, sizeof(*int_pkt), - (uint64_t)&ctxt.pkt); + (uint64_t)(uintptr_t)&ctxt.pkt); if (ret) { free_completion(&comp.comp_pkt.host_event); return (ret); From owner-svn-src-all@freebsd.org Fri Aug 17 06:31: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 D98471084646; Fri, 17 Aug 2018 06:31:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D9018F1B2; Fri, 17 Aug 2018 06:31:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EAD824AC0; Fri, 17 Aug 2018 06:31:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7H6VUoq015046; Fri, 17 Aug 2018 06:31:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H6VUEb015045; Fri, 17 Aug 2018 06:31:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808170631.w7H6VUEb015045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 17 Aug 2018 06:31: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: r337959 - in stable: 10/sys/dev/hyperv/pcib 11/sys/dev/hyperv/pcib X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/sys/dev/hyperv/pcib 11/sys/dev/hyperv/pcib X-SVN-Commit-Revision: 337959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 06:31:31 -0000 Author: dim Date: Fri Aug 17 06:31:30 2018 New Revision: 337959 URL: https://svnweb.freebsd.org/changeset/base/337959 Log: MFC r337322: Fix build of hyperv with base gcc on i386 Summary: Base gcc fails to compile `sys/dev/hyperv/pcib/vmbus_pcib.c` for i386, with the following -Werror warnings: cc1: warnings being treated as errors /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'new_pcichild_device': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:567: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'vmbus_pcib_on_channel_callback': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:940: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_pci_protocol_negotiation': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1012: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_pci_enter_d0': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1073: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_send_resources_allocated': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1125: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'vmbus_pcib_map_msi': /usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1730: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] This is because on i386, several casts from `uint64_t` to a pointer reduce the value from 64 bit to 32 bit. For gcc, this can be fixed by an intermediate cast to uintptr_t. Note that I am assuming the incoming values will always fit into 32 bit! Differential Revision: https://reviews.freebsd.org/D15753 Modified: stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c ============================================================================== --- stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Fri Aug 17 04:40:01 2018 (r337958) +++ stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Fri Aug 17 06:31:30 2018 (r337959) @@ -564,7 +564,7 @@ new_pcichild_device(struct hv_pcibus *hbus, struct pci ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - res_req, sizeof(*res_req), (uint64_t)&ctxt.pkt); + res_req, sizeof(*res_req), (uint64_t)(uintptr_t)&ctxt.pkt); if (ret) goto err; @@ -937,7 +937,8 @@ vmbus_pcib_on_channel_callback(struct vmbus_channel *c switch (pkt->cph_type) { case VMBUS_CHANPKT_TYPE_COMP: - comp_packet = (struct pci_packet *)pkt->cph_xactid; + comp_packet = + (struct pci_packet *)(uintptr_t)pkt->cph_xactid; response = (struct pci_response *)pkt; comp_packet->completion_func(comp_packet->compl_ctxt, response, bytes_rxed); @@ -1009,7 +1010,7 @@ hv_pci_protocol_negotiation(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, version_req, sizeof(*version_req), - (uint64_t)&ctxt.pkt); + (uint64_t)(uintptr_t)&ctxt.pkt); if (ret) goto out; @@ -1070,7 +1071,7 @@ hv_pci_enter_d0(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, d0_entry, sizeof(*d0_entry), - (uint64_t)&ctxt.pkt); + (uint64_t)(uintptr_t)&ctxt.pkt); if (ret) goto out; @@ -1122,7 +1123,8 @@ hv_send_resources_allocated(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - &pkt->message, sizeof(*res_assigned), (uint64_t)pkt); + &pkt->message, sizeof(*res_assigned), + (uint64_t)(uintptr_t)pkt); if (ret) { free_completion(&comp_pkt.host_event); break; @@ -1727,7 +1729,7 @@ vmbus_pcib_map_msi(device_t pcib, device_t child, int ret = vmbus_chan_send(sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, int_pkt, sizeof(*int_pkt), - (uint64_t)&ctxt.pkt); + (uint64_t)(uintptr_t)&ctxt.pkt); if (ret) { free_completion(&comp.comp_pkt.host_event); return (ret); From owner-svn-src-all@freebsd.org Fri Aug 17 07:27:16 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 9605C1085846; Fri, 17 Aug 2018 07:27:16 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4782C70A08; Fri, 17 Aug 2018 07:27:16 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 237A52542B; Fri, 17 Aug 2018 07:27:16 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7H7RFGX042677; Fri, 17 Aug 2018 07:27:15 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H7RFT3042675; Fri, 17 Aug 2018 07:27:15 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201808170727.w7H7RFT3042675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 17 Aug 2018 07:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337960 - in head: . release release/scripts X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in head: . release release/scripts X-SVN-Commit-Revision: 337960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 07:27:16 -0000 Author: royger Date: Fri Aug 17 07:27:15 2018 New Revision: 337960 URL: https://svnweb.freebsd.org/changeset/base/337960 Log: build: skip the database check when generating install media There are several scripts and targets solely used to generate install media, make sure DB_FROM_SRC is used in that case in order to prevent checking the host database, which is irrelevant when generating install binaries. Sponsored by: Citrix Systems R&D PR: 230459 Reviewed by: gjb Differential revision: https://reviews.freebsd.org/D16638 Modified: head/Makefile.inc1 head/release/Makefile head/release/scripts/mm-mtree.sh Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Aug 17 06:31:30 2018 (r337959) +++ head/Makefile.inc1 Fri Aug 17 07:27:15 2018 (r337960) @@ -833,7 +833,7 @@ IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} # When generating install media, do not allow user and group information from # the build host to affect the contents of the distribution. -.if make(distributeworld) +.if make(distributeworld) || make(distrib-dirs) || make(distribution) DB_FROM_SRC= yes .endif Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Fri Aug 17 06:31:30 2018 (r337959) +++ head/release/Makefile Fri Aug 17 07:27:15 2018 (r337960) @@ -185,7 +185,8 @@ disc1: packagesystem MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \ MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \ MK_RESCUE=no MK_DICT=no \ - MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no + MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \ + -DDB_FROM_SRC # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist for dist in MANIFEST $$(ls *.txz | grep -vE -- '(base|lib32)-dbg'); \ @@ -213,7 +214,8 @@ bootonly: packagesystem MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \ MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \ MK_RESCUE=no MK_DICT=no \ - MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no + MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \ + -DDB_FROM_SRC # Copy manifest only (no distfiles) to get checksums mkdir -p ${.TARGET}/usr/freebsd-dist cp MANIFEST ${.TARGET}/usr/freebsd-dist @@ -234,7 +236,8 @@ dvd: packagesystem mkdir -p ${.TARGET} cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \ - MK_TESTS=no MK_DEBUG_FILES=no + MK_TESTS=no MK_DEBUG_FILES=no \ + -DDB_FROM_SRC # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist for dist in MANIFEST $$(ls *.txz | grep -v -- '(base|lib32)-dbg'); \ Modified: head/release/scripts/mm-mtree.sh ============================================================================== --- head/release/scripts/mm-mtree.sh Fri Aug 17 06:31:30 2018 (r337959) +++ head/release/scripts/mm-mtree.sh Fri Aug 17 07:27:15 2018 (r337960) @@ -81,7 +81,7 @@ if [ ! -f ${SOURCEDIR}/Makefile.inc1 -a \ fi # Setup make to use system files from SOURCEDIR -MM_MAKE="make ${ARCHSTRING} ${MM_MAKE_ARGS} -m ${SOURCEDIR}/share/mk" +MM_MAKE="make ${ARCHSTRING} ${MM_MAKE_ARGS} -m ${SOURCEDIR}/share/mk -DDB_FROM_SRC" delete_temproot () { rm -rf "${TEMPROOT}" 2>/dev/null From owner-svn-src-all@freebsd.org Fri Aug 17 10:18: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 05B241055364; Fri, 17 Aug 2018 10:18:47 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A64EE75FD8; Fri, 17 Aug 2018 10:18:46 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D2EA26FEC; Fri, 17 Aug 2018 10:18:46 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HAIkX2030059; Fri, 17 Aug 2018 10:18:46 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HAIjMk030054; Fri, 17 Aug 2018 10:18:45 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201808171018.w7HAIjMk030054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Fri, 17 Aug 2018 10:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337961 - head/usr.sbin/ppp X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/usr.sbin/ppp X-SVN-Commit-Revision: 337961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 10:18:47 -0000 Author: n_hibma Date: Fri Aug 17 10:18:45 2018 New Revision: 337961 URL: https://svnweb.freebsd.org/changeset/base/337961 Log: Add the possibility to mark packets urgent based on their length. This allows preferring small (e.g. ACK) packets, in upload heavy environments. It was already possible to mark packets urgent based on destination port. This option piggy backs on that feature. Modified: head/usr.sbin/ppp/command.c head/usr.sbin/ppp/ip.c head/usr.sbin/ppp/ncp.c head/usr.sbin/ppp/ncp.h head/usr.sbin/ppp/ppp.8 Modified: head/usr.sbin/ppp/command.c ============================================================================== --- head/usr.sbin/ppp/command.c Fri Aug 17 07:27:15 2018 (r337960) +++ head/usr.sbin/ppp/command.c Fri Aug 17 10:18:45 2018 (r337961) @@ -139,7 +139,7 @@ #define VAR_CD 30 #define VAR_PARITY 31 #define VAR_CRTSCTS 32 -#define VAR_URGENTPORTS 33 +#define VAR_URGENT 33 #define VAR_LOGOUT 34 #define VAR_IFQUEUE 35 #define VAR_MPPE 36 @@ -2267,7 +2267,7 @@ SetVariable(struct cmdargs const *arg) } break; - case VAR_URGENTPORTS: + case VAR_URGENT: if (arg->argn == arg->argc) { ncp_SetUrgentTOS(&arg->bundle->ncp); ncp_ClearUrgentTcpPorts(&arg->bundle->ncp); @@ -2291,6 +2291,11 @@ SetVariable(struct cmdargs const *arg) ncp_ClearUrgentTcpPorts(&arg->bundle->ncp); ncp_ClearUrgentUdpPorts(&arg->bundle->ncp); ncp_ClearUrgentTOS(&arg->bundle->ncp); + } else if (!strcasecmp(arg->argv[arg->argn], "length")) { + if (arg->argn == arg->argc - 1) + ncp_SetUrgentTcpLen(&arg->bundle->ncp, 0); + else + ncp_SetUrgentTcpLen(&arg->bundle->ncp, atoi(arg->argv[arg->argn + 1])); } else { ncp_SetUrgentTOS(&arg->bundle->ncp); first = arg->argn; @@ -2469,8 +2474,8 @@ static struct cmdtab const SetCommands[] = { "STOPPED timeouts", "set stopped [LCPseconds [CCPseconds]]", NULL}, {"timeout", NULL, SetVariable, LOCAL_AUTH, "Idle timeout", "set timeout idletime", (const void *)VAR_IDLETIMEOUT}, - {"urgent", NULL, SetVariable, LOCAL_AUTH, "urgent ports", - "set urgent [tcp|udp] [+|-]port...", (const void *)VAR_URGENTPORTS}, + {"urgent", NULL, SetVariable, LOCAL_AUTH, "urgent traffic", + "set urgent [[tcp|udp] [+|-]port...]|[length len]", (const void *)VAR_URGENT}, {"vj", NULL, ipcp_vjset, LOCAL_AUTH, "vj values", "set vj slots|slotcomp [value]", NULL}, {"help", "?", HelpCommand, LOCAL_AUTH | LOCAL_NO_AUTH, Modified: head/usr.sbin/ppp/ip.c ============================================================================== --- head/usr.sbin/ppp/ip.c Fri Aug 17 07:27:15 2018 (r337960) +++ head/usr.sbin/ppp/ip.c Fri Aug 17 10:18:45 2018 (r337961) @@ -820,6 +820,8 @@ PacketCheck(struct bundle *bundle, u_int32_t family, if (!frag && ncp_IsUrgentTcpPort(&bundle->ncp, ntohs(th->th_sport), ntohs(th->th_dport))) pri++; + else if (!frag && ncp_IsUrgentTcpLen(&bundle->ncp, datalen)) + pri++; if (logit && loglen < sizeof logbuf) { len = datalen - (th->th_off << 2); @@ -851,6 +853,8 @@ PacketCheck(struct bundle *bundle, u_int32_t family, loglen += strlen(logbuf + loglen); } } + snprintf(logbuf + loglen, sizeof logbuf - loglen, " pri:%d", pri); + loglen += strlen(logbuf + loglen); } break; Modified: head/usr.sbin/ppp/ncp.c ============================================================================== --- head/usr.sbin/ppp/ncp.c Fri Aug 17 07:27:15 2018 (r337960) +++ head/usr.sbin/ppp/ncp.c Fri Aug 17 10:18:45 2018 (r337961) @@ -441,6 +441,21 @@ ncp_ClearUrgentPorts(struct port_range *range) } int +ncp_IsUrgentTcpLen(struct ncp *ncp, int len) +{ + if (len < ncp->cfg.urgent.len) + return 1; + else + return 0; +} + +void +ncp_SetUrgentTcpLen(struct ncp *ncp, int len) +{ + ncp->cfg.urgent.len = len; +} + +int ncp_Show(struct cmdargs const *arg) { struct ncp *ncp = &arg->bundle->ncp; Modified: head/usr.sbin/ppp/ncp.h ============================================================================== --- head/usr.sbin/ppp/ncp.h Fri Aug 17 07:27:15 2018 (r337960) +++ head/usr.sbin/ppp/ncp.h Fri Aug 17 10:18:45 2018 (r337961) @@ -42,6 +42,7 @@ struct ncp { struct { struct port_range tcp, udp; /* The range of urgent ports */ unsigned tos : 1; /* Urgent IPTOS_LOWDELAY packets ? */ + int len; /* The size below which traffic is prioritised */ } urgent; } cfg; @@ -68,6 +69,8 @@ extern size_t ncp_QueueLen(struct ncp *); extern size_t ncp_FillPhysicalQueues(struct ncp *, struct bundle *); extern int ncp_PushPacket(struct ncp *, int *, struct link *); extern int ncp_IsUrgentPort(struct port_range *, u_short, u_short); +extern int ncp_IsUrgentTcpLen(struct ncp *, int); +extern void ncp_SetUrgentTcpLen(struct ncp *, int); extern void ncp_AddUrgentPort(struct port_range *, u_short); extern void ncp_RemoveUrgentPort(struct port_range *, u_short); extern void ncp_ClearUrgentPorts(struct port_range *); Modified: head/usr.sbin/ppp/ppp.8 ============================================================================== --- head/usr.sbin/ppp/ppp.8 Fri Aug 17 07:27:15 2018 (r337960) +++ head/usr.sbin/ppp/ppp.8 Fri Aug 17 10:18:45 2018 (r337961) @@ -5823,6 +5823,13 @@ If is specified, all priority port lists are disabled and even .Dv IPTOS_LOWDELAY packets are not prioritised. +.It set urgent length Ar length +This command tells ppp to prioritize small packets up to +.Ar length +bytes. +If +.Ar length +is not specified, or 0, this feature is disabled. .It set vj slotcomp on|off This command tells .Nm From owner-svn-src-all@freebsd.org Fri Aug 17 10:26: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 5F18E105578A; Fri, 17 Aug 2018 10:26:08 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) (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 E0AAF76628; Fri, 17 Aug 2018 10:26:07 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-wm0-f49.google.com with SMTP id s9-v6so7120367wmh.3; Fri, 17 Aug 2018 03:26:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T6E98hZdunJSeeK1/B6GZw8zY6hf7zrO7pU/iPRFNYo=; b=QRb103owd5rSL4GM8cRD10bkofIMweRLPu106fjx1t4IBeNlK0qRG9hGwhbThz0Qjo GtCnkmJyNci5co3pluLN7vA6EzSKUotrNrC1zqZRp4txk6uiMZxL0J/NfBcJsezYtCMk nrB9QGmGQmXy9domkgH66oUbFPCy4C4jsa1URz0kZ9RxMi4kEEzLm9UvsxKuw1UWhLZV 5bFUVZd6RfKeLu/JzKxz78LijCApw9psrqfpWRjh9TGra8STICgGAgahSWOGZBC1pvlg SvgWdhwfsfl+rInD8ofYnYchVHaLJHCrZreK+JbBNl08DpthXdnq5u6A8PWPUx2MgHM1 ytwg== X-Gm-Message-State: AOUpUlEXatGlBBdUTwi/zq8feFpOxtIka2QUBKV5bVtBFU3Xr2s2jB9G OjTPhWTPhWXK4efHBGG5I1Zm81EZO/mrC8MnnYDp4I7A X-Google-Smtp-Source: AA+uWPyIycvDe/It8DjeCyJZgFGNDkf6dvUAmWEeMP7ZPt/fHhR91oJmwgI9NpOVDGA3OdGxQ9Xz8RmpHDMdH2qztbo= X-Received: by 2002:a1c:13ca:: with SMTP id 193-v6mr17636921wmt.127.1534501560628; Fri, 17 Aug 2018 03:26:00 -0700 (PDT) MIME-Version: 1.0 References: <201808170023.w7H0Np0H027296@repo.freebsd.org> <3ffeebe7-07c5-bab2-d8c6-45d48adf662f@FreeBSD.org> In-Reply-To: <3ffeebe7-07c5-bab2-d8c6-45d48adf662f@FreeBSD.org> From: Li-Wen Hsu Date: Fri, 17 Aug 2018 11:25:48 +0100 Message-ID: Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... To: John Baldwin Cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 10:26:08 -0000 On Fri, Aug 17, 2018 at 7:26 AM John Baldwin wrote: > > On 8/17/18 1:23 AM, Conrad Meyer wrote: > > Author: cem > > Date: Fri Aug 17 00:23:50 2018 > > New Revision: 337936 > > URL: https://svnweb.freebsd.org/changeset/base/337936 > > > > Log: > > Bring in libsodium to sys/contrib > > > > Bring in https://github.com/jedisct1/libsodium at > > 461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified. > > > > libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl > > ("Networking and Cryptography Library," pronounced "salt") software library. > > At the risk of oversimplifying, libsodium primarily exists to make it easier > > to use NaCl. NaCl and libsodium provide high quality implementations of a > > number of useful cryptographic concepts (as well as the underlying > > primitics) seeing some adoption in newer network protocols. > > > > I considered but dismissed cleaning up the directory hierarchy and > > discarding artifacts of other build systems in favor of remaining close to > > upstream (and easing future updates). > > > > Nothing is integrated into the build system yet, so in that sense, no > > functional change. > > Can you import this into the vendor area and then do a bootstrap of > mergeinfo to sys/contrib? This permits future updates to use svn to > merge instead of doing it by hand. It also permits future imports to > be done by other developers following our standard, documented process > for working with third-party code. There are some files like `builds/msvc/*` probably not very useful for FreeBSD. I might be good to have these files listed in FREEBSD-Xlist and excluded from importing. Best, Li-Wen -- Li-Wen Hsu https://lwhsu.org From owner-svn-src-all@freebsd.org Fri Aug 17 12:30: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 23E78106C1DF; Fri, 17 Aug 2018 12:30:34 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98ED57A41B; Fri, 17 Aug 2018 12:30:33 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 38C5818082D1; Fri, 17 Aug 2018 15:27:39 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6zwlTpyyIw-RdWeSvDK; Fri, 17 Aug 2018 15:27:39 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1534508859; bh=wBsVIlcm+JeVTijb8hdudP81dIUAdPzhmTP8xtwMJiE=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=KDIwIlJOC6fLi/ZRlC/65dE3uL89USyDP78sh0M/7cDzgTA4kitUoKiipnnrhTWkO a19A2RIVkuFTl0muQUp38uqfUxgkVIc1oAmzLgyaQhnGbLo4MWxd4+FkbhhEC0+smb swoKn8Jp+iCxm9A61AlFxmbe0fs0Axhxgnn6pEfg= Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id NwVOaWUyK0-RbS8jUd1; Fri, 17 Aug 2018 15:27:38 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1534508858; bh=wBsVIlcm+JeVTijb8hdudP81dIUAdPzhmTP8xtwMJiE=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=R8hVuUK0gHES418phMsGuA/3JEE3zJI05p+k+rjFRsbG/NSHQpQhgp1Kaxxn+8GMf bNf/Szqjojwei8RYo6R9g8WPhux/oUGqf8Qy/1onyLzPg7lkz5unDyD/+ERzqGzBI0 nPt3WaR/Cdgl3Ui5qPxDw5yEjZjsZpeVb19f8zJE= Authentication-Results: smtp4o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337866 - in head/sys: net netinet netinet6 To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808152023.w7FKN9LL055254@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <79ad414a-3e8e-3abd-0a8a-4d61b9ccfb4f@yandex.ru> Date: Fri, 17 Aug 2018 15:26:57 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808152023.w7FKN9LL055254@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1skQXaHeY89nXXTruWibTpyyHVkQ4rdpm" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 12:30:34 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1skQXaHeY89nXXTruWibTpyyHVkQ4rdpm Content-Type: multipart/mixed; boundary="q0rU0J4cejTfA9ikQzULQMpmVTl08wV9r"; protected-headers="v1" From: "Andrey V. Elsukov" To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <79ad414a-3e8e-3abd-0a8a-4d61b9ccfb4f@yandex.ru> Subject: Re: svn commit: r337866 - in head/sys: net netinet netinet6 References: <201808152023.w7FKN9LL055254@repo.freebsd.org> In-Reply-To: <201808152023.w7FKN9LL055254@repo.freebsd.org> --q0rU0J4cejTfA9ikQzULQMpmVTl08wV9r Content-Type: multipart/mixed; boundary="------------34A4AD5EE952CB09E8EA7BA5" Content-Language: en-US This is a multi-part message in MIME format. --------------34A4AD5EE952CB09E8EA7BA5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 15.08.2018 23:23, Matt Macy wrote: > Author: mmacy > Date: Wed Aug 15 20:23:08 2018 > New Revision: 337866 > URL: https://svnweb.freebsd.org/changeset/base/337866 >=20 > Log: > Fix in6_multi double free > =20 > This is actually several different bugs: > - The code is not designed to handle inpcb deletion after interface d= eletion > - add reference for inpcb membership > - The multicast address has to be removed from interface lists when t= he refcount > goes to zero OR when the interface goes away > - decouple list disconnect from refcount (v6 only for now) > - ifmultiaddr can exist past being on interface lists > - add flag for tracking whether or not it's enqueued > - deferring freeing moptions makes the incpb cleanup code simpler but= opens the > door wider still to races > - call inp_gcmoptions synchronously after dropping the the inpcb lo= ck > =20 > Fundamentally multicast needs a rewrite - but keep applying band-aids= for now. > =20 > Tested by: kp > Reported by: novel, kp, lwhsu >=20 > Modified: > head/sys/net/if.c > head/sys/net/if_var.h > head/sys/netinet/in_mcast.c > head/sys/netinet/in_pcb.c > head/sys/netinet/ip_carp.c > head/sys/netinet6/in6_ifattach.c > head/sys/netinet6/in6_mcast.c > head/sys/netinet6/in6_var.h > head/sys/netinet6/mld6.c Hi, After this commit my test machine panics just after boot finishes. Reverting this commit helps. Machine has two interfaces in failover lagg. One interface is not connect= ed. FreeBSD 12.0-ALPHA2 (GENERIC) #2 r337961M: Fri Aug 17 14:54:48 MSK 2018 # ifconfig em0: flags=3D8843 metric 0 mtu 15= 00 options=3D209b ether 00:22:4d:6a:5e:b9 media: Ethernet autoselect status: no carrier nd6 options=3D21 re0: flags=3D8843 metric 0 mtu 15= 00 options=3D8209b ether 00:22:4d:6a:5e:b9 hwaddr 1c:bd:b9:de:0d:7d media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D21 lagg0: flags=3D8843 metric 0 mtu = 1500 options=3D209b ether 00:22:4d:6a:5e:b9 inet6 fe80::222:4dff:fe6a:5eb9%lagg0 prefixlen 64 scopeid 0x5 inet 10.9.8.6 netmask 0xffffff00 broadcast 10.9.8.255 laggproto failover lagghash l2,l3,l4 laggport: em0 flags=3D1 laggport: re0 flags=3D4 groups: lagg media: Ethernet autoselect status: active nd6 options=3D21 --=20 WBR, Andrey V. Elsukov --------------34A4AD5EE952CB09E8EA7BA5 Content-Type: text/plain; charset=UTF-8; name="bt.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bt.txt" R05VIGdkYiAoR0RCKSA4LjEgW0dEQiB2OC4xIGZvciBGcmVlQlNEXQpDb3B5cmlnaHQgKEMp IDIwMTggRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLCBJbmMuCkxpY2Vuc2UgR1BMdjMrOiBH TlUgR1BMIHZlcnNpb24gMyBvciBsYXRlciA8aHR0cDovL2dudS5vcmcvbGljZW5zZXMvZ3Bs Lmh0bWw+ClRoaXMgaXMgZnJlZSBzb2Z0d2FyZTogeW91IGFyZSBmcmVlIHRvIGNoYW5nZSBh bmQgcmVkaXN0cmlidXRlIGl0LgpUaGVyZSBpcyBOTyBXQVJSQU5UWSwgdG8gdGhlIGV4dGVu dCBwZXJtaXR0ZWQgYnkgbGF3LiAgVHlwZSAic2hvdyBjb3B5aW5nIgphbmQgInNob3cgd2Fy cmFudHkiIGZvciBkZXRhaWxzLgpUaGlzIEdEQiB3YXMgY29uZmlndXJlZCBhcyAieDg2XzY0 LXBvcnRibGQtZnJlZWJzZDEyLjAiLgpUeXBlICJzaG93IGNvbmZpZ3VyYXRpb24iIGZvciBj b25maWd1cmF0aW9uIGRldGFpbHMuCkZvciBidWcgcmVwb3J0aW5nIGluc3RydWN0aW9ucywg cGxlYXNlIHNlZToKPGh0dHA6Ly93d3cuZ251Lm9yZy9zb2Z0d2FyZS9nZGIvYnVncy8+LgpG aW5kIHRoZSBHREIgbWFudWFsIGFuZCBvdGhlciBkb2N1bWVudGF0aW9uIHJlc291cmNlcyBv bmxpbmUgYXQ6CjxodHRwOi8vd3d3LmdudS5vcmcvc29mdHdhcmUvZ2RiL2RvY3VtZW50YXRp b24vPi4KRm9yIGhlbHAsIHR5cGUgImhlbHAiLgpUeXBlICJhcHJvcG9zIHdvcmQiIHRvIHNl YXJjaCBmb3IgY29tbWFuZHMgcmVsYXRlZCB0byAid29yZCIuLi4KUmVhZGluZyBzeW1ib2xz IGZyb20gL2Jvb3Qva2VybmVsL2tlcm5lbC4uLlJlYWRpbmcgc3ltYm9scyBmcm9tIC91c3Iv bGliL2RlYnVnLy9ib290L2tlcm5lbC9rZXJuZWwuZGVidWcuLi5kb25lLgpkb25lLgoKVW5y ZWFkIHBvcnRpb24gb2YgdGhlIGtlcm5lbCBtZXNzYWdlIGJ1ZmZlcjoKLS0tPDxCT09UPj4t LS0KQ29weXJpZ2h0IChjKSAxOTkyLTIwMTggVGhlIEZyZWVCU0QgUHJvamVjdC4KQ29weXJp Z2h0IChjKSAxOTc5LCAxOTgwLCAxOTgzLCAxOTg2LCAxOTg4LCAxOTg5LCAxOTkxLCAxOTky LCAxOTkzLCAxOTk0CglUaGUgUmVnZW50cyBvZiB0aGUgVW5pdmVyc2l0eSBvZiBDYWxpZm9y bmlhLiBBbGwgcmlnaHRzIHJlc2VydmVkLgpGcmVlQlNEIGlzIGEgcmVnaXN0ZXJlZCB0cmFk ZW1hcmsgb2YgVGhlIEZyZWVCU0QgRm91bmRhdGlvbi4KRnJlZUJTRCAxMi4wLUFMUEhBMiAj MSByMzM3OTYxTTogRnJpIEF1ZyAxNyAxNDowNzo1MCBNU0sgMjAxOAogICAgYnV0Y2hlckBi dHItdGVzdC55YW5kZXgubmV0Oi91c3Ivb2JqL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hl YWQvYW1kNjQuYW1kNjQvc3lzL0dFTkVSSUMgYW1kNjQKRnJlZUJTRCBjbGFuZyB2ZXJzaW9u IDYuMC4xICh0YWdzL1JFTEVBU0VfNjAxL2ZpbmFsIDMzNTU0MCkgKGJhc2VkIG9uIExMVk0g Ni4wLjEpCldBUk5JTkc6IFdJVE5FU1Mgb3B0aW9uIGVuYWJsZWQsIGV4cGVjdCByZWR1Y2Vk IHBlcmZvcm1hbmNlLgpWVCh2Z2EpOiByZXNvbHV0aW9uIDY0MHg0ODAKQ1BVOiBJbnRlbChS KSBDb3JlKFRNKSBpNS0yNDAwIENQVSBAIDMuMTBHSHogKDMwOTMuMDUtTUh6IEs4LWNsYXNz IENQVSkKICBPcmlnaW49IkdlbnVpbmVJbnRlbCIgIElkPTB4MjA2YTcgIEZhbWlseT0weDYg IE1vZGVsPTB4MmEgIFN0ZXBwaW5nPTcKICBGZWF0dXJlcz0weGJmZWJmYmZmPEZQVSxWTUUs REUsUFNFLFRTQyxNU1IsUEFFLE1DRSxDWDgsQVBJQyxTRVAsTVRSUixQR0UsTUNBLENNT1Ys UEFULFBTRTM2LENMRkxVU0gsRFRTLEFDUEksTU1YLEZYU1IsU1NFLFNTRTIsU1MsSFRULFRN LFBCRT4KICBGZWF0dXJlczI9MHgxZmJhZTNmZjxTU0UzLFBDTE1VTFFEUSxEVEVTNjQsTU9O LERTX0NQTCxWTVgsU01YLEVTVCxUTTIsU1NTRTMsQ1gxNix4VFBSLFBEQ00sUENJRCxTU0U0 LjEsU1NFNC4yLHgyQVBJQyxQT1BDTlQsVFNDRExULEFFU05JLFhTQVZFLE9TWFNBVkUsQVZY PgogIEFNRCBGZWF0dXJlcz0weDI4MTAwODAwPFNZU0NBTEwsTlgsUkRUU0NQLExNPgogIEFN RCBGZWF0dXJlczI9MHgxPExBSEY+CiAgWFNBVkUgRmVhdHVyZXM9MHgxPFhTQVZFT1BUPgog IFZULXg6IFBBVCxITFQsTVRGLFBBVVNFLEVQVCxVRyxWUElECiAgVFNDOiBQLXN0YXRlIGlu dmFyaWFudCwgcGVyZm9ybWFuY2Ugc3RhdGlzdGljcwpyZWFsIG1lbW9yeSAgPSAyNTc2OTgw Mzc3NiAoMjQ1NzYgTUIpCmF2YWlsIG1lbW9yeSA9IDI0ODY0MjY0MTkyICgyMzcxMiBNQikK RXZlbnQgdGltZXIgIkxBUElDIiBxdWFsaXR5IDYwMApBQ1BJIEFQSUMgVGFibGU6IDxJTlRF TCAgRFE2N1NXICA+CkZyZWVCU0QvU01QOiBNdWx0aXByb2Nlc3NvciBTeXN0ZW0gRGV0ZWN0 ZWQ6IDQgQ1BVcwpGcmVlQlNEL1NNUDogMSBwYWNrYWdlKHMpIHggNCBjb3JlKHMpCnJhbmRv bTogdW5ibG9ja2luZyBkZXZpY2UuCmlvYXBpYzAgPFZlcnNpb24gMi4wPiBpcnFzIDAtMjMg b24gbW90aGVyYm9hcmQKTGF1bmNoaW5nIEFQczogMiAxIDMKVGltZWNvdW50ZXIgIlRTQy1s b3ciIGZyZXF1ZW5jeSAxNTQ2NTIyODYxIEh6IHF1YWxpdHkgMTAwMApyYW5kb206IGVudHJv cHkgZGV2aWNlIGV4dGVybmFsIGludGVyZmFjZQpbYXRoX2hhbF0gbG9hZGVkCm1vZHVsZV9y ZWdpc3Rlcl9pbml0OiBNT0RfTE9BRCAodmVzYSwgMHhmZmZmZmZmZjgxMTAxMTYwLCAwKSBl cnJvciAxOQprYmQxIGF0IGtiZG11eDAKbmV0bWFwOiBsb2FkZWQgbW9kdWxlCm5leHVzMAp2 dHZnYTA6IDxWVCBWR0EgZHJpdmVyPiBvbiBtb3RoZXJib2FyZApjcnlwdG9zb2Z0MDogPHNv ZnR3YXJlIGNyeXB0bz4gb24gbW90aGVyYm9hcmQKYWNwaTA6IDxSU3R5bGUgUHJveGltYT4g b24gbW90aGVyYm9hcmQKYWNwaTA6IFBvd2VyIEJ1dHRvbiAoZml4ZWQpCmNwdTA6IDxBQ1BJ IENQVT4gb24gYWNwaTAKYXR0aW1lcjA6IDxBVCB0aW1lcj4gcG9ydCAweDQwLTB4NDMgaXJx IDAgb24gYWNwaTAKVGltZWNvdW50ZXIgImk4MjU0IiBmcmVxdWVuY3kgMTE5MzE4MiBIeiBx dWFsaXR5IDAKRXZlbnQgdGltZXIgImk4MjU0IiBmcmVxdWVuY3kgMTE5MzE4MiBIeiBxdWFs aXR5IDEwMAphdHJ0YzA6IDxBVCByZWFsdGltZSBjbG9jaz4gcG9ydCAweDcwLTB4NzEgaXJx IDggb24gYWNwaTAKYXRydGMwOiByZWdpc3RlcmVkIGFzIGEgdGltZS1vZi1kYXkgY2xvY2ss IHJlc29sdXRpb24gMS4wMDAwMDBzCkV2ZW50IHRpbWVyICJSVEMiIGZyZXF1ZW5jeSAzMjc2 OCBIeiBxdWFsaXR5IDAKaHBldDA6IDxIaWdoIFByZWNpc2lvbiBFdmVudCBUaW1lcj4gaW9t ZW0gMHhmZWQwMDAwMC0weGZlZDAwM2ZmIG9uIGFjcGkwClRpbWVjb3VudGVyICJIUEVUIiBm cmVxdWVuY3kgMTQzMTgxODAgSHogcXVhbGl0eSA5NTAKRXZlbnQgdGltZXIgIkhQRVQiIGZy ZXF1ZW5jeSAxNDMxODE4MCBIeiBxdWFsaXR5IDU1MApFdmVudCB0aW1lciAiSFBFVDEiIGZy ZXF1ZW5jeSAxNDMxODE4MCBIeiBxdWFsaXR5IDQ0MApFdmVudCB0aW1lciAiSFBFVDIiIGZy ZXF1ZW5jeSAxNDMxODE4MCBIeiBxdWFsaXR5IDQ0MApFdmVudCB0aW1lciAiSFBFVDMiIGZy ZXF1ZW5jeSAxNDMxODE4MCBIeiBxdWFsaXR5IDQ0MApFdmVudCB0aW1lciAiSFBFVDQiIGZy ZXF1ZW5jeSAxNDMxODE4MCBIeiBxdWFsaXR5IDQ0MApUaW1lY291bnRlciAiQUNQSS1mYXN0 IiBmcmVxdWVuY3kgMzU3OTU0NSBIeiBxdWFsaXR5IDkwMAphY3BpX3RpbWVyMDogPDI0LWJp dCB0aW1lciBhdCAzLjU3OTU0NU1Iej4gcG9ydCAweDQwOC0weDQwYiBvbiBhY3BpMApwY2li MDogPEFDUEkgSG9zdC1QQ0kgYnJpZGdlPiBwb3J0IDB4Y2Y4LTB4Y2ZmIG9uIGFjcGkwCnBj aTA6IDxBQ1BJIFBDSSBidXM+IG9uIHBjaWIwCnBjaWIxOiA8QUNQSSBQQ0ktUENJIGJyaWRn ZT4gaXJxIDE2IGF0IGRldmljZSAxLjAgb24gcGNpMApwY2kxOiA8QUNQSSBQQ0kgYnVzPiBv biBwY2liMQp2Z2FwY2kwOiA8VkdBLWNvbXBhdGlibGUgZGlzcGxheT4gcG9ydCAweGYwMDAt MHhmMDNmIG1lbSAweGZlMDAwMDAwLTB4ZmUzZmZmZmYsMHhkMDAwMDAwMC0weGRmZmZmZmZm IGlycSAxNiBhdCBkZXZpY2UgMi4wIG9uIHBjaTAKdmdhcGNpMDogQm9vdCB2aWRlbyBkZXZp Y2UKcGNpMDogPHNpbXBsZSBjb21tcz4gYXQgZGV2aWNlIDIyLjAgKG5vIGRyaXZlciBhdHRh Y2hlZCkKYXRhcGNpMDogPEludGVsIEFUQSBjb250cm9sbGVyPiBwb3J0IDB4ZjEzMC0weGYx MzcsMHhmMTIwLTB4ZjEyMywweGYxMTAtMHhmMTE3LDB4ZjEwMC0weGYxMDMsMHhmMGYwLTB4 ZjBmZiBpcnEgMTggYXQgZGV2aWNlIDIyLjIgb24gcGNpMAphdGEyOiA8QVRBIGNoYW5uZWw+ IGF0IGNoYW5uZWwgMCBvbiBhdGFwY2kwCmF0YTM6IDxBVEEgY2hhbm5lbD4gYXQgY2hhbm5l bCAxIG9uIGF0YXBjaTAKdWFydDI6IDxJbnRlbCBBTVQgLSBLVCBDb250cm9sbGVyPiBwb3J0 IDB4ZjBlMC0weGYwZTcgbWVtIDB4ZmU2MjkwMDAtMHhmZTYyOWZmZiBpcnEgMTcgYXQgZGV2 aWNlIDIyLjMgb24gcGNpMAp1YXJ0MjogVXNpbmcgMSBNU0kgbWVzc2FnZQplbTA6IDxJbnRl bChSKSBQUk8vMTAwMCBOZXR3b3JrIENvbm5lY3Rpb24+IHBvcnQgMHhmMDgwLTB4ZjA5ZiBt ZW0gMHhmZTYwMDAwMC0weGZlNjFmZmZmLDB4ZmU2MjgwMDAtMHhmZTYyOGZmZiBpcnEgMjAg YXQgZGV2aWNlIDI1LjAgb24gcGNpMAplbTA6IGF0dGFjaF9wcmUgY2FwcGluZyBxdWV1ZXMg YXQgMQplbTA6IHVzaW5nIDEwMjQgdHggZGVzY3JpcHRvcnMgYW5kIDEwMjQgcnggZGVzY3Jp cHRvcnMKZW0wOiBtc2l4X2luaXQgcXNldHMgY2FwcGVkIGF0IDEKZW0wOiBVbmFibGUgdG8g bWFwIE1TSVggdGFibGUgCmVtMDogVXNpbmcgYW4gTVNJIGludGVycnVwdAplbTA6IGFsbG9j YXRlZCBmb3IgMSB0eF9xdWV1ZXMKZW0wOiBhbGxvY2F0ZWQgZm9yIDEgcnhfcXVldWVzCjw2 PmVtMDogRXRoZXJuZXQgYWRkcmVzczogMDA6MjI6NGQ6NmE6NWU6YjkKPDY+ZW0wOiBuZXRt YXAgcXVldWVzL3Nsb3RzOiBUWCAxLzEwMjQsIFJYIDEvMTAyNAplaGNpMDogPEludGVsIENv dWdhciBQb2ludCBVU0IgMi4wIGNvbnRyb2xsZXI+IG1lbSAweGZlNjI3MDAwLTB4ZmU2Mjcz ZmYgaXJxIDE2IGF0IGRldmljZSAyNi4wIG9uIHBjaTAKdXNidXMwOiBFSENJIHZlcnNpb24g MS4wCnVzYnVzMCBvbiBlaGNpMAp1c2J1czA6IDQ4ME1icHMgSGlnaCBTcGVlZCBVU0IgdjIu MApoZGFjMDogPEludGVsIENvdWdhciBQb2ludCBIREEgQ29udHJvbGxlcj4gbWVtIDB4ZmU2 MjAwMDAtMHhmZTYyM2ZmZiBpcnEgMjIgYXQgZGV2aWNlIDI3LjAgb24gcGNpMApwY2liMjog PEFDUEkgUENJLVBDSSBicmlkZ2U+IGlycSAxNyBhdCBkZXZpY2UgMjguMCBvbiBwY2kwCnBj aTI6IDxBQ1BJIFBDSSBidXM+IG9uIHBjaWIyCnBjaWIzOiA8QUNQSSBQQ0ktUENJIGJyaWRn ZT4gaXJxIDE4IGF0IGRldmljZSAyOC42IG9uIHBjaTAKcGNpMzogPEFDUEkgUENJIGJ1cz4g b24gcGNpYjMKeGhjaTA6IDxORUMgdVBENzIwMjAwIFVTQiAzLjAgY29udHJvbGxlcj4gbWVt IDB4ZmU1MDAwMDAtMHhmZTUwMWZmZiBpcnEgMTggYXQgZGV2aWNlIDAuMCBvbiBwY2kzCnho Y2kwOiAzMiBieXRlcyBjb250ZXh0IHNpemUsIDMyLWJpdCBETUEKeGhjaTA6IFVuYWJsZSB0 byBtYXAgTVNJLVggdGFibGUgCnVzYnVzMSBvbiB4aGNpMAp1c2J1czE6IDUuMEdicHMgU3Vw ZXIgU3BlZWQgVVNCIHYzLjAKZWhjaTE6IDxJbnRlbCBDb3VnYXIgUG9pbnQgVVNCIDIuMCBj b250cm9sbGVyPiBtZW0gMHhmZTYyNjAwMC0weGZlNjI2M2ZmIGlycSAyMyBhdCBkZXZpY2Ug MjkuMCBvbiBwY2kwCnVzYnVzMjogRUhDSSB2ZXJzaW9uIDEuMAp1c2J1czIgb24gZWhjaTEK dXNidXMyOiA0ODBNYnBzIEhpZ2ggU3BlZWQgVVNCIHYyLjAKcGNpYjQ6IDxBQ1BJIFBDSS1Q Q0kgYnJpZGdlPiBhdCBkZXZpY2UgMzAuMCBvbiBwY2kwCnBjaTQ6IDxBQ1BJIFBDSSBidXM+ IG9uIHBjaWI0CnJlMDogPEQtTGluayBER0UtNTI4KFQpIEdpZ2FiaXQgRXRoZXJuZXQgQWRh cHRlcj4gcG9ydCAweGUwMDAtMHhlMGZmIG1lbSAweGZlNDIxMDAwLTB4ZmU0MjEwZmYgaXJx IDE2IGF0IGRldmljZSAwLjAgb24gcGNpNApyZTA6IENoaXAgcmV2LiAweDEwMDAwMDAwCnJl MDogTUFDIHJldi4gMHgwMDAwMDAwMAptaWlidXMwOiA8TUlJIGJ1cz4gb24gcmUwCnJnZXBo eTA6IDxSVEw4MTY5Uy84MTEwUy84MjExIDEwMDBCQVNFLVQgbWVkaWEgaW50ZXJmYWNlPiBQ SFkgMSBvbiBtaWlidXMwCnJnZXBoeTA6ICBub25lLCAxMGJhc2VULCAxMGJhc2VULUZEWCwg MTBiYXNlVC1GRFgtZmxvdywgMTAwYmFzZVRYLCAxMDBiYXNlVFgtRkRYLCAxMDBiYXNlVFgt RkRYLWZsb3csIDEwMDBiYXNlVCwgMTAwMGJhc2VULW1hc3RlciwgMTAwMGJhc2VULUZEWCwg MTAwMGJhc2VULUZEWC1tYXN0ZXIsIDEwMDBiYXNlVC1GRFgtZmxvdywgMTAwMGJhc2VULUZE WC1mbG93LW1hc3RlciwgYXV0bywgYXV0by1mbG93Cjw2PnJlMDogVXNpbmcgZGVmYXVsdHMg Zm9yIFRTTzogNjU1MTgvMzUvMjA0OAo8Nj5yZTA6IEV0aGVybmV0IGFkZHJlc3M6IDFjOmJk OmI5OmRlOjBkOjdkCjw2PnJlMDogbmV0bWFwIHF1ZXVlcy9zbG90czogVFggMS8yNTYsIFJY IDEvMjU2CnBjaTQ6IDxzZXJpYWwgYnVzLCBGaXJlV2lyZT4gYXQgZGV2aWNlIDMuMCAobm8g ZHJpdmVyIGF0dGFjaGVkKQppc2FiMDogPFBDSS1JU0EgYnJpZGdlPiBhdCBkZXZpY2UgMzEu MCBvbiBwY2kwCmlzYTA6IDxJU0EgYnVzPiBvbiBpc2FiMAphaGNpMDogPEludGVsIENvdWdh ciBQb2ludCBBSENJIFNBVEEgY29udHJvbGxlcj4gcG9ydCAweGYwZDAtMHhmMGQ3LDB4ZjBj MC0weGYwYzMsMHhmMGIwLTB4ZjBiNywweGYwYTAtMHhmMGEzLDB4ZjA2MC0weGYwN2YgbWVt IDB4ZmU2MjUwMDAtMHhmZTYyNTdmZiBpcnEgMTkgYXQgZGV2aWNlIDMxLjIgb24gcGNpMAph aGNpMDogQUhDSSB2MS4zMCB3aXRoIDYgNkdicHMgcG9ydHMsIFBvcnQgTXVsdGlwbGllciBu b3Qgc3VwcG9ydGVkCmFoY2ljaDA6IDxBSENJIGNoYW5uZWw+IGF0IGNoYW5uZWwgMCBvbiBh aGNpMAphaGNpY2gzOiA8QUhDSSBjaGFubmVsPiBhdCBjaGFubmVsIDMgb24gYWhjaTAKYWhj aWNoNDogPEFIQ0kgY2hhbm5lbD4gYXQgY2hhbm5lbCA0IG9uIGFoY2kwCmFoY2ljaDU6IDxB SENJIGNoYW5uZWw+IGF0IGNoYW5uZWwgNSBvbiBhaGNpMAphaGNpZW0wOiA8QUhDSSBlbmNs b3N1cmUgbWFuYWdlbWVudCBicmlkZ2U+IG9uIGFoY2kwCmFjcGlfYnV0dG9uMDogPFBvd2Vy IEJ1dHRvbj4gb24gYWNwaTAKdWFydDA6IDwxNjU1MCBvciBjb21wYXRpYmxlPiBwb3J0IDB4 M2Y4LTB4M2ZmIGlycSA0IGZsYWdzIDB4MTAgb24gYWNwaTAKb3JtMDogPElTQSBPcHRpb24g Uk9Ncz4gYXQgaW9tZW0gMHhjMDAwMC0weGNkZmZmLDB4Y2UwMDAtMHhjZWZmZiBwbnBpZCBP Uk0wMDAwIG9uIGlzYTAKYXRrYmRjMDogPEtleWJvYXJkIGNvbnRyb2xsZXIgKGk4MDQyKT4g YXQgcG9ydCAweDYwLDB4NjQgb24gaXNhMAphdGtiZDA6IDxBVCBLZXlib2FyZD4gaXJxIDEg b24gYXRrYmRjMAprYmQwIGF0IGF0a2JkMAphdGtiZDA6IFtHSUFOVC1MT0NLRURdCmF0a2Jk YzA6IG5vbi1QTlAgSVNBIGRldmljZSB3aWxsIGJlIHJlbW92ZWQgZnJvbSBHRU5FUklDIGlu IEZyZWVCU0QgMTIuCmVzdDA6IDxFbmhhbmNlZCBTcGVlZFN0ZXAgRnJlcXVlbmN5IENvbnRy b2w+IG9uIGNwdTAKWkZTIGZpbGVzeXN0ZW0gdmVyc2lvbjogNQpaRlMgc3RvcmFnZSBwb29s IHZlcnNpb246IGZlYXR1cmVzIHN1cHBvcnQgKDUwMDApClRpbWVjb3VudGVycyB0aWNrIGV2 ZXJ5IDEuMDAwIG1zZWMKaGRhY2MwOiA8UmVhbHRlayBBTEM4ODggSERBIENPREVDPiBhdCBj YWQgMiBvbiBoZGFjMApoZGFhMDogPFJlYWx0ZWsgQUxDODg4IEF1ZGlvIEZ1bmN0aW9uIEdy b3VwPiBhdCBuaWQgMSBvbiBoZGFjYzAKcGNtMDogPFJlYWx0ZWsgQUxDODg4IChSZWFyIEFu YWxvZyk+IGF0IG5pZCAyMCBhbmQgMjQsMjYgb24gaGRhYTAKcGNtMTogPFJlYWx0ZWsgQUxD ODg4IChGcm9udCBBbmFsb2cpPiBhdCBuaWQgMjcgYW5kIDI1IG9uIGhkYWEwCnBjbTI6IDxS ZWFsdGVrIEFMQzg4OCAoT25ib2FyZCBEaWdpdGFsKT4gYXQgbmlkIDMwIG9uIGhkYWEwCnBj bTM6IDxSZWFsdGVrIEFMQzg4OCAoT25ib2FyZCBBbmFsb2cgU3BlYWtlcik+IGF0IG5pZCAy MyBvbiBoZGFhMApoZGFjYzE6IDxJbnRlbCBDb3VnYXIgUG9pbnQgSERBIENPREVDPiBhdCBj YWQgMyBvbiBoZGFjMApoZGFhMTogPEludGVsIENvdWdhciBQb2ludCBBdWRpbyBGdW5jdGlv biBHcm91cD4gYXQgbmlkIDEgb24gaGRhY2MxCnBjbTQ6IDxJbnRlbCBDb3VnYXIgUG9pbnQg KEhETUkvRFAgOGNoKT4gYXQgbmlkIDYgb24gaGRhYTEKdWdlbjAuMTogPEludGVsIEVIQ0kg cm9vdCBIVUI+IGF0IHVzYnVzMAp1Z2VuMS4xOiA8MHgxMDMzIFhIQ0kgcm9vdCBIVUI+IGF0 IHVzYnVzMQp1Z2VuMi4xOiA8SW50ZWwgRUhDSSByb290IEhVQj4gYXQgdXNidXMyCnVodWIw OiA8SW50ZWwgRUhDSSByb290IEhVQiwgY2xhc3MgOS8wLCByZXYgMi4wMC8xLjAwLCBhZGRy IDE+IG9uIHVzYnVzMAp1aHViMTogPEludGVsIEVIQ0kgcm9vdCBIVUIsIGNsYXNzIDkvMCwg cmV2IDIuMDAvMS4wMCwgYWRkciAxPiBvbiB1c2J1czIKdWh1YjI6IDwweDEwMzMgWEhDSSBy b290IEhVQiwgY2xhc3MgOS8wLCByZXYgMy4wMC8xLjAwLCBhZGRyIDE+IG9uIHVzYnVzMQp1 aHViMjogNCBwb3J0cyB3aXRoIDQgcmVtb3ZhYmxlLCBzZWxmIHBvd2VyZWQKdWh1YjE6IDMg cG9ydHMgd2l0aCAzIHJlbW92YWJsZSwgc2VsZiBwb3dlcmVkCnVodWIwOiAzIHBvcnRzIHdp dGggMyByZW1vdmFibGUsIHNlbGYgcG93ZXJlZApzZXMwIGF0IGFoY2llbTAgYnVzIDAgc2Ni dXM2IHRhcmdldCAwIGx1biAwCnNlczA6IDxBSENJIFNHUElPIEVuY2xvc3VyZSAxLjAwIDAw MDE+IFNFTUIgUy1FLVMgMi4wMCBkZXZpY2UKc2VzMDogU0VNQiBTRVMgRGV2aWNlCmFkYTAg YXQgYWhjaWNoMCBidXMgMCBzY2J1czIgdGFyZ2V0IDAgbHVuIDAKYWRhMDogPEhEUzcyNTA1 MEtMQTM2MCBLMkFPQUI1QT4gQVRBLTcgU0FUQSAyLnggZGV2aWNlCmFkYTA6IFNlcmlhbCBO dW1iZXIgS1JWTjY3WkJINzBFTUYKYWRhMDogMzAwLjAwME1CL3MgdHJhbnNmZXJzIChTQVRB IDIueCwgVURNQTYsIFBJTyA4MTkyYnl0ZXMpCmFkYTA6IENvbW1hbmQgUXVldWVpbmcgZW5h YmxlZAphZGEwOiA0NzY5NDBNQiAoOTc2NzczMTY4IDUxMiBieXRlIHNlY3RvcnMpCnVnZW4y LjI6IDx2ZW5kb3IgMHg4MDg3IHByb2R1Y3QgMHgwMDI0PiBhdCB1c2J1czIKdWh1YjMgb24g dWh1YjEKdWh1YjM6IDx2ZW5kb3IgMHg4MDg3IHByb2R1Y3QgMHgwMDI0LCBjbGFzcyA5LzAs IHJldiAyLjAwLzAuMDAsIGFkZHIgMj4gb24gdXNidXMyCmNkMCBhdCBhaGNpY2gzIGJ1cyAw IHNjYnVzMyB0YXJnZXQgMCBsdW4gMApjZDA6IDxPcHRpYXJjIERWRCBSVyBBRC03MjgwUyAx LjAxPiBSZW1vdmFibGUgQ0QtUk9NIFNDU0kgZGV2aWNlCmNkMDogMTUwLjAwME1CL3MgdHJh bnNmZXJzIChTQVRBIDEueCwgVURNQTUsIEFUQVBJIDEyYnl0ZXMsIFBJTyA4MTkyYnl0ZXMp CmNkMDogQXR0ZW1wdCB0byBxdWVyeSBkZXZpY2Ugc2l6ZSBmYWlsZWQ6IE5PVCBSRUFEWSwg TWVkaXVtIG5vdCBwcmVzZW50IC0gdHJheSBjbG9zZWQKV0FSTklORzogV0lUTkVTUyBvcHRp b24gZW5hYmxlZCwgZXhwZWN0IHJlZHVjZWQgcGVyZm9ybWFuY2UuClRyeWluZyB0byBtb3Vu dCByb290IGZyb20gemZzOnovUk9PVC9oZWFkIFtdLi4uCnVnZW4wLjI6IDx2ZW5kb3IgMHg4 MDg3IHByb2R1Y3QgMHgwMDI0PiBhdCB1c2J1czAKdWh1YjQgb24gdWh1YjAKdWh1YjQ6IDx2 ZW5kb3IgMHg4MDg3IHByb2R1Y3QgMHgwMDI0LCBjbGFzcyA5LzAsIHJldiAyLjAwLzAuMDAs IGFkZHIgMj4gb24gdXNidXMwClJvb3QgbW91bnQgd2FpdGluZyBmb3I6IHVzYnVzMiB1c2J1 czAKdWh1YjQ6IDYgcG9ydHMgd2l0aCA2IHJlbW92YWJsZSwgc2VsZiBwb3dlcmVkClJvb3Qg bW91bnQgd2FpdGluZyBmb3I6IHVzYnVzMiB1c2J1czAKdWh1YjM6IDggcG9ydHMgd2l0aCA4 IHJlbW92YWJsZSwgc2VsZiBwb3dlcmVkCnVnZW4wLjM6IDx2ZW5kb3IgMHgwNGYzIHByb2R1 Y3QgMHgwMTAzPiBhdCB1c2J1czAKdWtiZDAgb24gdWh1YjQKdWtiZDA6IDx2ZW5kb3IgMHgw NGYzIHByb2R1Y3QgMHgwMTAzLCBjbGFzcyAwLzAsIHJldiAyLjAwLzEuMDcsIGFkZHIgMz4g b24gdXNidXMwCmtiZDIgYXQgdWtiZDAKPDExOD5TZXR0aW5nIGhvc3R1dWlkOiBkMDg0OGNk Yi1hN2Y0LWUwMTEtYmI1ZC0wMDBlYTY4ZjczYWQuCjwxMTg+U2V0dGluZyBob3N0aWQ6IDB4 ZmU4NjU0ZWIuCjwxMTg+U3RhcnRpbmcgZmlsZSBzeXN0ZW0gY2hlY2tzOgo8MTE4Pk1vdW50 aW5nIGxvY2FsIGZpbGVzeXN0ZW1zOi4KPDExOD5FTEYgbGRjb25maWcgcGF0aDogL2xpYiAv dXNyL2xpYiAvdXNyL2xpYi9jb21wYXQgL3Vzci9sb2NhbC9saWIgL3Vzci9sb2NhbC9saWIv Y29tcGF0IC91c3IvbG9jYWwvbGliL3Blcmw1LzUuMjYvbWFjaC9DT1JFIC91c3IvbG9jYWwv bGliL3B0aAo8MTE4PjMyLWJpdCBjb21wYXRpYmlsaXR5IGxkY29uZmlnIHBhdGg6IC91c3Iv bGliMzIgL3Vzci9sb2NhbC9saWIzMi9jb21wYXQKPDExOD5TZXR0aW5nIGhvc3RuYW1lOiBi dHItdGVzdC55YW5kZXgubmV0Lgo8MTE4PlNldHRpbmcgdXAgaGFydmVzdGluZzogW1VNQV0s W0ZTX0FUSU1FXSxTV0ksSU5URVJSVVBULE5FVF9ORyxORVRfRVRIRVIsTkVUX1RVTixNT1VT RSxLRVlCT0FSRCxBVFRBQ0gsQ0FDSEVECjwxMTg+RmVlZGluZyBlbnRyb3B5OiAuCjwxMTg+ Q3JlYXRlZCBjbG9uZSBpbnRlcmZhY2VzOiBsYWdnMC4KPDY+bG8wOiBsaW5rIHN0YXRlIGNo YW5nZWQgdG8gVVAKPDY+cmUwOiBsaW5rIHN0YXRlIGNoYW5nZWQgdG8gRE9XTgo8Nj5sYWdn MDogSVB2NiBhZGRyZXNzZXMgb24gZW0wIGhhdmUgYmVlbiByZW1vdmVkIGJlZm9yZSBhZGRp bmcgaXQgYXMgYSBtZW1iZXIgdG8gcHJldmVudCBJUHY2IGFkZHJlc3Mgc2NvcGUgdmlvbGF0 aW9uLgo8Nj5sYWdnMDogbGluayBzdGF0ZSBjaGFuZ2VkIHRvIERPV04KPDY+bGFnZzA6IElQ djYgYWRkcmVzc2VzIG9uIHJlMCBoYXZlIGJlZW4gcmVtb3ZlZCBiZWZvcmUgYWRkaW5nIGl0 IGFzIGEgbWVtYmVyIHRvIHByZXZlbnQgSVB2NiBhZGRyZXNzIHNjb3BlIHZpb2xhdGlvbi4K PDY+cmUwOiBsaW5rIHN0YXRlIGNoYW5nZWQgdG8gVVAKPDY+bGFnZzA6IGxpbmsgc3RhdGUg Y2hhbmdlZCB0byBVUAo8MTE4PlN0YXJ0aW5nIE5ldHdvcms6IGxvMCBlbTAgcmUwIGVuYzAg bGFnZzAuCjwxMTg+bG8wOiBmbGFncz04MDQ5PFVQLExPT1BCQUNLLFJVTk5JTkcsTVVMVElD QVNUPiBtZXRyaWMgMCBtdHUgMTYzODQKPDExOD4Jb3B0aW9ucz02ODAwMDM8UlhDU1VNLFRY Q1NVTSxMSU5LU1RBVEUsUlhDU1VNX0lQVjYsVFhDU1VNX0lQVjY+CjwxMTg+CWluZXQ2IDo6 MSBwcmVmaXhsZW4gMTI4IAo8MTE4PglpbmV0NiBmZTgwOjoxJWxvMCBwcmVmaXhsZW4gNjQg c2NvcGVpZCAweDMgCjwxMTg+CWluZXQgMTI3LjAuMC4xIG5ldG1hc2sgMHhmZjAwMDAwMCAK PDExOD4JZ3JvdXBzOiBsbyAKPDExOD4JbmQ2IG9wdGlvbnM9MjE8UEVSRk9STU5VRCxBVVRP X0xJTktMT0NBTD4KPDExOD5lbTA6IGZsYWdzPTg4NDM8VVAsQlJPQURDQVNULFJVTk5JTkcs U0lNUExFWCxNVUxUSUNBU1Q+IG1ldHJpYyAwIG10dSAxNTAwCjwxMTg+CW9wdGlvbnM9MjA5 YjxSWENTVU0sVFhDU1VNLFZMQU5fTVRVLFZMQU5fSFdUQUdHSU5HLFZMQU5fSFdDU1VNLFdP TF9NQUdJQz4KPDExOD4JZXRoZXIgMDA6MjI6NGQ6NmE6NWU6YjkKPDExOD4JbWVkaWE6IEV0 aGVybmV0IGF1dG9zZWxlY3QKPDExOD4Jc3RhdHVzOiBubyBjYXJyaWVyCjwxMTg+CW5kNiBv cHRpb25zPTIxPFBFUkZPUk1OVUQsQVVUT19MSU5LTE9DQUw+CjwxMTg+cmUwOiBmbGFncz04 ODQzPFVQLEJST0FEQ0FTVCxSVU5OSU5HLFNJTVBMRVgsTVVMVElDQVNUPiBtZXRyaWMgMCBt dHUgMTUwMAo8MTE4PglvcHRpb25zPTgyMDliPFJYQ1NVTSxUWENTVU0sVkxBTl9NVFUsVkxB Tl9IV1RBR0dJTkcsVkxBTl9IV0NTVU0sV09MX01BR0lDLExJTktTVEFURT4KPDExOD4JZXRo ZXIgMDA6MjI6NGQ6NmE6NWU6YjkKPDExOD4JaHdhZGRyIDFjOmJkOmI5OmRlOjBkOjdkCjwx MTg+CW1lZGlhOiBFdGhlcm5ldCBhdXRvc2VsZWN0ICgxMDAwYmFzZVQgPGZ1bGwtZHVwbGV4 PikKPDExOD4Jc3RhdHVzOiBhY3RpdmUKPDExOD4JbmQ2IG9wdGlvbnM9MjE8UEVSRk9STU5V RCxBVVRPX0xJTktMT0NBTD4KPDExOD5lbmMwOiBmbGFncz0wPD4gbWV0cmljIDAgbXR1IDE1 MzYKPDExOD4JZ3JvdXBzOiBlbmMgCjwxMTg+CW5kNiBvcHRpb25zPTIxPFBFUkZPUk1OVUQs QVVUT19MSU5LTE9DQUw+CjwxMTg+bGFnZzA6IGZsYWdzPTg4NDM8VVAsQlJPQURDQVNULFJV Tk5JTkcsU0lNUExFWCxNVUxUSUNBU1Q+IG1ldHJpYyAwIG10dSAxNTAwCjwxMTg+CW9wdGlv bnM9MjA5YjxSWENTVU0sVFhDU1VNLFZMQU5fTVRVLFZMQU5fSFdUQUdHSU5HLFZMQU5fSFdD U1VNLFdPTF9NQUdJQz4KPDExOD4JZXRoZXIgMDA6MjI6NGQ6NmE6NWU6YjkKPDExOD4JaW5l dDYgZmU4MDo6MjIyOjRkZmY6ZmU2YTo1ZWI5JWxhZ2cwIHByZWZpeGxlbiA2NCBzY29wZWlk IDB4NSAKPDExOD4JbGFnZ3Byb3RvIGZhaWxvdmVyIGxhZ2doYXNoIGwyLGwzLGw0CjwxMTg+ CWxhZ2dwb3J0OiBlbTAgZmxhZ3M9MTxNQVNURVI+CjwxMTg+CWxhZ2dwb3J0OiByZTAgZmxh Z3M9NDxBQ1RJVkU+CjwxMTg+CWdyb3VwczogbGFnZyAKPDExOD4JbWVkaWE6IEV0aGVybmV0 IGF1dG9zZWxlY3QKPDExOD4Jc3RhdHVzOiBhY3RpdmUKPDExOD4JbmQ2IG9wdGlvbnM9MjE8 UEVSRk9STU5VRCxBVVRPX0xJTktMT0NBTD4KPDExOD5TdGFydGluZyBkZXZkLgo8MTE4PlN0 YXJ0aW5nIE5ldHdvcms6IGVuYzAuCjwxMTg+ZW5jMDogZmxhZ3M9MDw+IG1ldHJpYyAwIG10 dSAxNTM2CjwxMTg+CWdyb3VwczogZW5jIAo8MTE4PgluZDYgb3B0aW9ucz0yMTxQRVJGT1JN TlVELEFVVE9fTElOS0xPQ0FMPgo8MTE4PkF1dG9sb2FkaW5nIG1vZHVsZTogdWhpZC5rbwp1 aGlkMCBvbiB1aHViNAp1aGlkMDogPHZlbmRvciAweDA0ZjMgcHJvZHVjdCAweDAxMDMsIGNs YXNzIDAvMCwgcmV2IDIuMDAvMS4wNywgYWRkciAzPiBvbiB1c2J1czAKPDExOD5TdGFydGlu ZyBkaGNsaWVudC4KPDExOD5ESENQUkVRVUVTVCBvbiBsYWdnMCB0byAyNTUuMjU1LjI1NS4y NTUgcG9ydCA2Nwo8MTE4PkRIQ1BBQ0sgZnJvbSAxMC45LjguMQpLZXJuZWwgcGFnZSBmYXVs dCB3aXRoIHRoZSBmb2xsb3dpbmcgbm9uLXNsZWVwYWJsZSBsb2NrcyBoZWxkOgpleGNsdXNp dmUgc2xlZXAgbXV0ZXggbWxkX210eCAobWxkX210eCkgciA9IDAgKDB4ZmZmZmZmZmY4MWZk YjYxOCkgbG9ja2VkIEAgL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQvc3lzL25ldGlu ZXQ2L21sZDYuYzoxMzU0CmV4Y2x1c2l2ZSBzbGVlcCBtdXRleCBpbjZfbXVsdGlfbGlzdF9t dHggKGluNl9tdWx0aV9saXN0X210eCkgciA9IDAgKDB4ZmZmZmZmZmY4MjA1MTE1MCkgbG9j a2VkIEAgL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQvc3lzL25ldGluZXQ2L21sZDYu YzoxMzUzCnNoYXJlZCBydyB2bmV0X3J3bG9jayAodm5ldF9yd2xvY2spIHIgPSAwICgweGZm ZmZmZmZmODIwNTBkODApIGxvY2tlZCBAIC9ob21lL2RldmVsL2ZyZWVic2QvYmFzZS9oZWFk L3N5cy9uZXRpbmV0Ni9tbGQ2LmM6MTMxNApzdGFjayBiYWNrdHJhY2U6CiMwIDB4ZmZmZmZm ZmY4MGMwMTY0MyBhdCB3aXRuZXNzX2RlYnVnZ2VyKzB4NzMKIzEgMHhmZmZmZmZmZjgwYzAy YTIxIGF0IHdpdG5lc3Nfd2FybisweDQ2MQojMiAweGZmZmZmZmZmODEwN2UwOTMgYXQgdHJh cF9wZmF1bHQrMHg1MwojMyAweGZmZmZmZmZmODEwN2Q2YWEgYXQgdHJhcCsweDJiYQojNCAw eGZmZmZmZmZmODEwNTdlODUgYXQgY2FsbHRyYXArMHg4CiM1IDB4ZmZmZmZmZmY4MGUwNDI2 MiBhdCBtbGRfdjFfdHJhbnNtaXRfcmVwb3J0KzB4NjIKIzYgMHhmZmZmZmZmZjgwZTAyYzRi IGF0IG1sZF9mYXN0dGltbysweGFhYgojNyAweGZmZmZmZmZmODBjMjgzYzQgYXQgcGZmYXN0 dGltbysweDU0CiM4IDB4ZmZmZmZmZmY4MGJhZjcxMCBhdCBzb2Z0Y2xvY2tfY2FsbF9jYysw eDE1MAojOSAweGZmZmZmZmZmODBiYWZhZGMgYXQgc29mdGNsb2NrKzB4N2MKIzEwIDB4ZmZm ZmZmZmY4MGI1NzM0MCBhdCBpdGhyZWFkX2xvb3ArMHgxNDAKIzExIDB4ZmZmZmZmZmY4MGI1 NDIyNCBhdCBmb3JrX2V4aXQrMHg4NAojMTIgMHhmZmZmZmZmZjgxMDU4ZTVlIGF0IGZvcmtf dHJhbXBvbGluZSsweGUKCgpGYXRhbCB0cmFwIDEyOiBwYWdlIGZhdWx0IHdoaWxlIGluIGtl cm5lbCBtb2RlCmNwdWlkID0gMDsgYXBpYyBpZCA9IDAwCmZhdWx0IHZpcnR1YWwgYWRkcmVz cwk9IDB4MWE4CmZhdWx0IGNvZGUJCT0gc3VwZXJ2aXNvciByZWFkIGRhdGEsIHBhZ2Ugbm90 IHByZXNlbnQKaW5zdHJ1Y3Rpb24gcG9pbnRlcgk9IDB4MjA6MHhmZmZmZmZmZjgwZGU2YjUy CnN0YWNrIHBvaW50ZXIJICAgICAgICA9IDB4Mjg6MHhmZmZmZmUwMDc3YmNlNzkwCmZyYW1l IHBvaW50ZXIJICAgICAgICA9IDB4Mjg6MHhmZmZmZmUwMDc3YmNlN2QwCmNvZGUgc2VnbWVu dAkJPSBiYXNlIDB4MCwgbGltaXQgMHhmZmZmZiwgdHlwZSAweDFiCgkJCT0gRFBMIDAsIHBy ZXMgMSwgbG9uZyAxLCBkZWYzMiAwLCBncmFuIDEKcHJvY2Vzc29yIGVmbGFncwk9IGludGVy cnVwdCBlbmFibGVkLCByZXN1bWUsIElPUEwgPSAwCmN1cnJlbnQgcHJvY2VzcwkJPSAxMiAo c3dpNDogY2xvY2sgKDApKQoKX19jdXJ0aHJlYWQgKCkgYXQgLi9tYWNoaW5lL3BjcHUuaDoy MzAKMjMwCQlfX2FzbSgibW92cSAlJWdzOiUxLCUwIiA6ICI9ciIgKHRkKQooa2dkYikgYnQK IzAgIF9fY3VydGhyZWFkICgpIGF0IC4vbWFjaGluZS9wY3B1Lmg6MjMwCiMxICBkb2FkdW1w ICh0ZXh0ZHVtcD0xKQogICAgYXQgL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQvc3lz L2tlcm4va2Vybl9zaHV0ZG93bi5jOjM2NgojMiAgMHhmZmZmZmZmZjgwNDNmMTBjIGluIGRi X2ZuY2FsbF9nZW5lcmljIChhZGRyPTxvcHRpbWl6ZWQgb3V0PiwgCiAgICBydj08b3B0aW1p emVkIG91dD4sIG5hcmdzPTxvcHRpbWl6ZWQgb3V0PiwgYXJncz08b3B0aW1pemVkIG91dD4p CiAgICBhdCAvaG9tZS9kZXZlbC9mcmVlYnNkL2Jhc2UvaGVhZC9zeXMvZGRiL2RiX2NvbW1h bmQuYzo2MDkKIzMgIGRiX2ZuY2FsbCAoZHVtbXkxPTxvcHRpbWl6ZWQgb3V0PiwgZHVtbXky PTxvcHRpbWl6ZWQgb3V0PiwgCiAgICBkdW1teTM9PG9wdGltaXplZCBvdXQ+LCBkdW1teTQ9 PG9wdGltaXplZCBvdXQ+KQogICAgYXQgL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQv c3lzL2RkYi9kYl9jb21tYW5kLmM6NjU3CiM0ICAweGZmZmZmZmZmODA0M2VjNDkgaW4gZGJf Y29tbWFuZCAobGFzdF9jbWRwPTxvcHRpbWl6ZWQgb3V0PiwgCiAgICBjbWRfdGFibGU9PG9w dGltaXplZCBvdXQ+LCBkb3BhZ2VyPTxvcHRpbWl6ZWQgb3V0PikKICAgIGF0IC9ob21lL2Rl dmVsL2ZyZWVic2QvYmFzZS9oZWFkL3N5cy9kZGIvZGJfY29tbWFuZC5jOjQ4MQojNSAgMHhm ZmZmZmZmZjgwNDNlOWM0IGluIGRiX2NvbW1hbmRfbG9vcCAoKQogICAgYXQgL2hvbWUvZGV2 ZWwvZnJlZWJzZC9iYXNlL2hlYWQvc3lzL2RkYi9kYl9jb21tYW5kLmM6NTM0CiM2ICAweGZm ZmZmZmZmODA0NDFiZWYgaW4gZGJfdHJhcCAodHlwZT08b3B0aW1pemVkIG91dD4sIGNvZGU9 PG9wdGltaXplZCBvdXQ+KQogICAgYXQgL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQv c3lzL2RkYi9kYl9tYWluLmM6MjUyCiM3ICAweGZmZmZmZmZmODBiZTAwZTMgaW4ga2RiX3Ry YXAgKHR5cGU9MTIsIGNvZGU9MCwgdGY9PG9wdGltaXplZCBvdXQ+KQogICAgYXQgL2hvbWUv ZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQvc3lzL2tlcm4vc3Vicl9rZGIuYzo2OTMKIzggIDB4 ZmZmZmZmZmY4MTA3ZGY4MSBpbiB0cmFwX2ZhdGFsIChmcmFtZT0weGZmZmZmZTAwNzdiY2U2 ZDAsIGV2YT00MjQpCiAgICBhdCAvaG9tZS9kZXZlbC9mcmVlYnNkL2Jhc2UvaGVhZC9zeXMv YW1kNjQvYW1kNjQvdHJhcC5jOjkwNgojOSAgMHhmZmZmZmZmZjgxMDdlMGEyIGluIHRyYXBf cGZhdWx0IChmcmFtZT0weGZmZmZmZTAwNzdiY2U2ZDAsIAogICAgdXNlcm1vZGU9PG9wdGlt aXplZCBvdXQ+KQogICAgYXQgL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQvc3lzL2Ft ZDY0L2FtZDY0L3RyYXAuYzo3NDYKIzEwIDB4ZmZmZmZmZmY4MTA3ZDZhYSBpbiB0cmFwIChm cmFtZT0weGZmZmZmZTAwNzdiY2U2ZDApCiAgICBhdCAvaG9tZS9kZXZlbC9mcmVlYnNkL2Jh c2UvaGVhZC9zeXMvYW1kNjQvYW1kNjQvdHJhcC5jOjQyNwojMTEgPHNpZ25hbCBoYW5kbGVy IGNhbGxlZD4KIzEyIGNrX3ByX21kX2xvYWRfcHRyICh0YXJnZXQ9PG9wdGltaXplZCBvdXQ+ KQogICAgYXQgL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQvc3lzL2NvbnRyaWIvY2sv aW5jbHVkZS9nY2MveDg2XzY0L2NrX3ByLmg6MTg1CiMxMyBpbjZpZmFfaWZwZm9ybGlua2xv Y2FsIChpZnA9MHgwLCBpZ25vcmVmbGFncz03KQogICAgYXQgL2hvbWUvZGV2ZWwvZnJlZWJz ZC9iYXNlL2hlYWQvc3lzL25ldGluZXQ2L2luNi5jOjE0NzQKIzE0IDB4ZmZmZmZmZmY4MGUw NDI2MiBpbiBtbGRfdjFfdHJhbnNtaXRfcmVwb3J0IChpbjZtPTB4ZmZmZmY4MDAxOTgzOTMw MCwgCiAgICB0eXBlPTEzMSkgYXQgL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQvc3lz L25ldGluZXQ2L21sZDYuYzoxODAzCiMxNSAweGZmZmZmZmZmODBlMDJjNGIgaW4gbWxkX2Zh c3R0aW1vX3ZuZXQgKCkKICAgIGF0IC9ob21lL2RldmVsL2ZyZWVic2QvYmFzZS9oZWFkL3N5 cy9uZXRpbmV0Ni9tbGQ2LmM6MTQzMwojMTYgbWxkX2Zhc3R0aW1vICgpIGF0IC9ob21lL2Rl dmVsL2ZyZWVic2QvYmFzZS9oZWFkL3N5cy9uZXRpbmV0Ni9tbGQ2LmM6MTMxNwojMTcgMHhm ZmZmZmZmZjgwYzI4M2M0IGluIHBmZmFzdHRpbW8gKGFyZz0weGZmZmZmZTAwNzdiOTlhMDAp CiAgICBhdCAvaG9tZS9kZXZlbC9mcmVlYnNkL2Jhc2UvaGVhZC9zeXMva2Vybi91aXBjX2Rv bWFpbi5jOjUyMQojMTggMHhmZmZmZmZmZjgwYmFmNzEwIGluIHNvZnRjbG9ja19jYWxsX2Nj ICgKICAgIGM9MHhmZmZmZmZmZjgxZmM0ZWQwIDxwZmZhc3RfY2FsbG91dD4sIGNjPTB4ZmZm ZmZmZmY4MjAzYjQ4MCA8Y2NfY3B1PiwgCiAgICBkaXJlY3Q9PG9wdGltaXplZCBvdXQ+KQog ICAgYXQgL2hvbWUvZGV2ZWwvZnJlZWJzZC9iYXNlL2hlYWQvc3lzL2tlcm4va2Vybl90aW1l b3V0LmM6NzMxCiMxOSAweGZmZmZmZmZmODBiYWZhZGMgaW4gc29mdGNsb2NrIChhcmc9MHhm ZmZmZmZmZjgyMDNiNDgwIDxjY19jcHU+KQogICAgYXQgL2hvbWUvZGV2ZWwvZnJlZWJzZC9i YXNlL2hlYWQvc3lzL2tlcm4va2Vybl90aW1lb3V0LmM6ODY5CiMyMCAweGZmZmZmZmZmODBi NTczNDAgaW4gaW50cl9ldmVudF9leGVjdXRlX2hhbmRsZXJzIChwPTxvcHRpbWl6ZWQgb3V0 PiwgCiAgICBpZT08b3B0aW1pemVkIG91dD4pCiAgICBhdCAvaG9tZS9kZXZlbC9mcmVlYnNk L2Jhc2UvaGVhZC9zeXMva2Vybi9rZXJuX2ludHIuYzoxMDQzCiMyMSBpdGhyZWFkX2V4ZWN1 dGVfaGFuZGxlcnMgKHA9PG9wdGltaXplZCBvdXQ+LCBpZT08b3B0aW1pemVkIG91dD4pCiAg ICBhdCAvaG9tZS9kZXZlbC9mcmVlYnNkL2Jhc2UvaGVhZC9zeXMva2Vybi9rZXJuX2ludHIu YzoxMDU2CiMyMiBpdGhyZWFkX2xvb3AgKGFyZz08b3B0aW1pemVkIG91dD4pCiAgICBhdCAv aG9tZS9kZXZlbC9mcmVlYnNkL2Jhc2UvaGVhZC9zeXMva2Vybi9rZXJuX2ludHIuYzoxMTM2 CiMyMyAweGZmZmZmZmZmODBiNTQyMjQgaW4gZm9ya19leGl0ICgKICAgIGNhbGxvdXQ9MHhm ZmZmZmZmZjgwYjU3MjAwIDxpdGhyZWFkX2xvb3A+LCBhcmc9MHhmZmZmZjgwMDAzNWU5ZjAw LCAKICAgIGZyYW1lPTB4ZmZmZmZlMDA3N2JjZWFjMCkKICAgIGF0IC9ob21lL2RldmVsL2Zy ZWVic2QvYmFzZS9oZWFkL3N5cy9rZXJuL2tlcm5fZm9yay5jOjEwNTcKIzI0IDxzaWduYWwg aGFuZGxlciBjYWxsZWQ+CihrZ2RiKSBmIDE0CiMxNCAweGZmZmZmZmZmODBlMDQyNjIgaW4g bWxkX3YxX3RyYW5zbWl0X3JlcG9ydCAoaW42bT0weGZmZmZmODAwMTk4MzkzMDAsIAogICAg dHlwZT0xMzEpIGF0IC9ob21lL2RldmVsL2ZyZWVic2QvYmFzZS9oZWFkL3N5cy9uZXRpbmV0 Ni9tbGQ2LmM6MTgwMwoxODAzCQlpYSA9IGluNmlmYV9pZnBmb3JsaW5rbG9jYWwoaWZwLCBJ TjZfSUZGX05PVFJFQURZfElONl9JRkZfQU5ZQ0FTVCk7CihrZ2RiKSBpIGxvCmlmcCA9IDB4 MAppYSA9IDxvcHRpbWl6ZWQgb3V0PgptaCA9IDxvcHRpbWl6ZWQgb3V0PgptZCA9IDxvcHRp bWl6ZWQgb3V0PgppcDYgPSA8b3B0aW1pemVkIG91dD4KbWxkID0gPG9wdGltaXplZCBvdXQ+ CihrZ2RiKSBwIGluNm0KJDEgPSAoc3RydWN0IGluNl9tdWx0aSAqKSAweGZmZmZmODAwMTk4 MzkzMDAKKGtnZGIpIHAgKmluNm0KJDIgPSB7aW42bV9hZGRyID0ge19fdTZfYWRkciA9IHsK ICAgICAgX191Nl9hZGRyOCA9ICJcMzc3XDAwMlwwMDBcMDA1XDAwMFwwMDBcMDAwXDAwMFww MDBcMDAwXDAwMFwwMDJcMzI0XDM2MVwzMDRHIiwgX191Nl9hZGRyMTYgPSB7NzY3LCAxMjgw LCAwLCAwLCAwLCA1MTIsIDYxOTA4LCAxODM3Mn0sIF9fdTZfYWRkcjMyID0gewogICAgICAg IDgzODg2ODQ3LCAwLCAzMzU1NDQzMiwgMTIwNDA4OTMwMH19fSwgaW42bV9pZnAgPSAweDAs IAogIGluNm1faWZtYSA9IDB4ZmZmZmY4MDAwM2I1MDQwMCwgaW42bV9yZWZjb3VudCA9IDAs IGluNm1fc3RhdGUgPSAzLCAKICBpbjZtX3RpbWVyID0gMCwgaW42bV9tbGkgPSAweGZmZmZm ODAwMDMwZDI4ODAsIGluNm1fbnJlbGUgPSB7CiAgICBzbGVfbmV4dCA9IDB4MH0sIGluNm1f c3JjcyA9IHtyYmhfcm9vdCA9IDB4MH0sIGluNm1fbnNyYyA9IDAsIGluNm1fc2NxID0gewog ICAgbXFfaGVhZCA9IHtzdHFoX2ZpcnN0ID0gMHgwLCBzdHFoX2xhc3QgPSAweGZmZmZmODAw MTk4MzkzNTB9LCBtcV9sZW4gPSAwLCAKICAgIG1xX21heGxlbiA9IDI0fSwgaW42bV9sYXN0 Z3NydHYgPSB7dHZfc2VjID0gMCwgdHZfdXNlYyA9IDB9LCAKICBpbjZtX3NjdGltZXIgPSAw LCBpbjZtX3NjcnYgPSAxLCBpbjZtX3N0ID0ge3tpc3NfZm1vZGUgPSAyLCBpc3NfYXNtID0g MSwgCiAgICAgIGlzc19leCA9IDEsIGlzc19pbiA9IDAsIGlzc19yZWMgPSAwfSwge2lzc19m bW9kZSA9IDIsIGlzc19hc20gPSAxLCAKICAgICAgaXNzX2V4ID0gMSwgaXNzX2luID0gMCwg aXNzX3JlYyA9IDB9fX0KKGtnZGIpIHF1aXQK --------------34A4AD5EE952CB09E8EA7BA5-- --q0rU0J4cejTfA9ikQzULQMpmVTl08wV9r-- --1skQXaHeY89nXXTruWibTpyyHVkQ4rdpm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlt2vxEACgkQAcXqBBDI oXqhNQf9E3qsGByHpUrCfhff66sLUqgPmyCQYGTU94mRJaSHnr3W7MyWduEL3tCz 4mFD0FwDnfo2K7yF7Rxbse3dqhKcaeajCAvckNvWpi667RPJj33jnDrNtVuCWmcR ANNFomf66RLT+g9w21L3X6lZ91gTfTQiRd6TqIzinulTacmnFwsyELs+W2ixja35 WIK9BvYrZ0T0AWL5GPmirnemCbGoZk225z4DRFc0br5/uYm4OI/9ElIX8DVgQU8u vLI1uO4yPSBbUlCTa8JiG761JuDHnAksSWEHGDlAkw/uGHplWARODZozrOLigt1a etzsTDNBwq5i9Yc2Y+jbEc2Y/lNc7A== =/SLJ -----END PGP SIGNATURE----- --1skQXaHeY89nXXTruWibTpyyHVkQ4rdpm-- From owner-svn-src-all@freebsd.org Fri Aug 17 12:32: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 43B4B106C58E; Fri, 17 Aug 2018 12:32:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECD8F7A98F; Fri, 17 Aug 2018 12:32:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDFA770C; Fri, 17 Aug 2018 12:32:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HCWcBd000980; Fri, 17 Aug 2018 12:32:38 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HCWc6e000979; Fri, 17 Aug 2018 12:32:38 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808171232.w7HCWc6e000979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 17 Aug 2018 12:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337962 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 337962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 12:32:39 -0000 Author: rmacklem Date: Fri Aug 17 12:32:38 2018 New Revision: 337962 URL: https://svnweb.freebsd.org/changeset/base/337962 Log: Don't set a file's size for the MDS file of a pNFS service. When a pNFS service is running, the size of the files created on the MDS are normally 0, since the data is written to the data files on the DS(s). However, without this patch, if a Setattr with a non-zero size was done by a client, the MDS file was set to that size. This was thought to be benign, but it turns out that files with a non-zero size plus extended attributes can cause a "ffs_truncate3" panic in UFS. Although the exact cause of this panic() has not been isolated, this patch avoids the panic() and leaves the MDS files in a consistent state of always having a size == 0. Note that these MDS files never store data. The patch also includes an unnecessary initialization of savsize in case some compiler or static analyser complains it might not be initialized. This patch only affects the NFS server when pNFS is enabled via the "-p" command line option on nfsd. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Aug 17 10:18:45 2018 (r337961) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Aug 17 12:32:38 2018 (r337962) @@ -442,9 +442,33 @@ int nfsvno_setattr(struct vnode *vp, struct nfsvattr *nvap, struct ucred *cred, struct thread *p, struct nfsexstuff *exp) { - int error; + u_quad_t savsize = 0; + int error, savedit; - error = VOP_SETATTR(vp, &nvap->na_vattr, cred); + /* + * If this is an exported file system and a pNFS service is running, + * don't VOP_SETATTR() of size for the MDS file system. + */ + savedit = 0; + error = 0; + if (vp->v_type == VREG && (vp->v_mount->mnt_flag & MNT_EXPORTED) != 0 && + nfsrv_devidcnt != 0 && nvap->na_vattr.va_size != VNOVAL && + nvap->na_vattr.va_size > 0) { + savsize = nvap->na_vattr.va_size; + nvap->na_vattr.va_size = VNOVAL; + if (nvap->na_vattr.va_uid != (uid_t)VNOVAL || + nvap->na_vattr.va_gid != (gid_t)VNOVAL || + nvap->na_vattr.va_mode != (mode_t)VNOVAL || + nvap->na_vattr.va_atime.tv_sec != VNOVAL || + nvap->na_vattr.va_mtime.tv_sec != VNOVAL) + savedit = 1; + else + savedit = 2; + } + if (savedit != 2) + error = VOP_SETATTR(vp, &nvap->na_vattr, cred); + if (savedit != 0) + nvap->na_vattr.va_size = savsize; if (error == 0 && (nvap->na_vattr.va_uid != (uid_t)VNOVAL || nvap->na_vattr.va_gid != (gid_t)VNOVAL || nvap->na_vattr.va_size != VNOVAL || From owner-svn-src-all@freebsd.org Fri Aug 17 12:39: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 A0098106CA3B; Fri, 17 Aug 2018 12:39:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486A77AEEF; Fri, 17 Aug 2018 12:39:01 +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 269A3715; Fri, 17 Aug 2018 12:39:01 +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 w7HCd1A2001536; Fri, 17 Aug 2018 12:39:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HCd16B001535; Fri, 17 Aug 2018 12:39:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201808171239.w7HCd16B001535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 17 Aug 2018 12:39:01 +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: r337963 - stable/11/contrib/elftoolchain/readelf X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 337963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 12:39:01 -0000 Author: emaste Date: Fri Aug 17 12:39:00 2018 New Revision: 337963 URL: https://svnweb.freebsd.org/changeset/base/337963 Log: MFC r337569: readelf: display NT_GNU_PROPERTY_TYPE_0 note name NT_GNU_PROPERTY_TYPE_0 in a .note.gnu.property section "contains a program property note which describes special handling requirements for linker and run-time loader." (from the System V Application Binary Interface - Linux Extensions") Intel CET uses two processor-specific program properties in NT_GNU_PROPERTY_TYPE_0: GNU_PROPERTY_X86_FEATURE_1_IBT to indicate that all executable sections are compatible with Indirect Branch Tracking, and GNU_PROPERTY_X86_FEATURE_1_SHSTK to indicate that sections are compatible with shadow stack. A later change should add decoding of the individual properties. Modified: stable/11/contrib/elftoolchain/readelf/readelf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- stable/11/contrib/elftoolchain/readelf/readelf.c Fri Aug 17 12:32:38 2018 (r337962) +++ stable/11/contrib/elftoolchain/readelf/readelf.c Fri Aug 17 12:39:00 2018 (r337963) @@ -1188,6 +1188,7 @@ note_type_gnu(unsigned int nt) case 2: return "NT_GNU_HWCAP (Hardware capabilities)"; case 3: return "NT_GNU_BUILD_ID (Build id set by ld(1))"; case 4: return "NT_GNU_GOLD_VERSION (GNU gold version)"; + case 5: return "NT_GNU_PROPERTY_TYPE_0"; default: return (note_type_unknown(nt)); } } From owner-svn-src-all@freebsd.org Fri Aug 17 13:02: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 40F71106D3FE; Fri, 17 Aug 2018 13:02:43 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0A487BC1A; Fri, 17 Aug 2018 13:02:42 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 2D06C185FB4; Fri, 17 Aug 2018 16:02:32 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Lt9h8hlbso-2QI0h0dT; Fri, 17 Aug 2018 16:02:26 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1534510946; bh=7XP0l/Z9sssow8FLgk/QTN0hgdhr6EdsTCb0L14lB5Y=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=G2g39/qdRJ3dWYmLfWndpZFL3k/M0EjMpmzWsBK5dJB0bI0hYd5n7yQz4jBFAIl3X LWfIK86+WUXohbo2ph1d8OTwBmU5rBDPfZoiUcO0jeFUObrTTNP8Iv1EbsTIyVSmNs xhuGTnbA3LsrznHwp/5ZuO4GGnLT/2m8OygHOmFg= Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dxIqwvmXCK-2PqqkYlm; Fri, 17 Aug 2018 16:02:25 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1534510945; bh=7XP0l/Z9sssow8FLgk/QTN0hgdhr6EdsTCb0L14lB5Y=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=G29ugQT5vhlKQtDgdmd0zktrxDQj8zzYWQo7xQClIR2MHUHYjOmTfKWKftOSf2XOj 2e3Pxi41RIa3meRJ1nbtBTwfBQ8Rkxitk/WTkZ+7MrPY7xTRvMbD+lGYyHy0L8qDus PsitORzS4p5Vr6nP41YIntj7ondS7ks8sUecPpuU= Authentication-Results: smtp4p.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r336439 - in head: share/man/man9 sys/crypto/aesni sys/crypto/armv8 sys/crypto/blake2 sys/crypto/ccp sys/crypto/via sys/dev/cesa sys/dev/cxgbe/crypto sys/dev/hifn sys/dev/safe sys/dev/s... To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807180056.w6I0uPb6000705@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <6d1d2b23-978b-af1d-4022-16d09c9a42f5@yandex.ru> Date: Fri, 17 Aug 2018 16:01:44 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201807180056.w6I0uPb6000705@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KFC0c0PSk2x6icLevvyZ2vluPp8N6284P" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 13:02:43 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KFC0c0PSk2x6icLevvyZ2vluPp8N6284P Content-Type: multipart/mixed; boundary="u4g29DgrNyLAd17BAj5hVtDf4awq8uScG"; protected-headers="v1" From: "Andrey V. Elsukov" To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <6d1d2b23-978b-af1d-4022-16d09c9a42f5@yandex.ru> Subject: Re: svn commit: r336439 - in head: share/man/man9 sys/crypto/aesni sys/crypto/armv8 sys/crypto/blake2 sys/crypto/ccp sys/crypto/via sys/dev/cesa sys/dev/cxgbe/crypto sys/dev/hifn sys/dev/safe sys/dev/s... References: <201807180056.w6I0uPb6000705@repo.freebsd.org> In-Reply-To: <201807180056.w6I0uPb6000705@repo.freebsd.org> --u4g29DgrNyLAd17BAj5hVtDf4awq8uScG Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 18.07.2018 03:56, Conrad Meyer wrote: > Author: cem > Date: Wed Jul 18 00:56:25 2018 > New Revision: 336439 > URL: https://svnweb.freebsd.org/changeset/base/336439 >=20 > Log: > OpenCrypto: Convert sessions to opaque handles instead of integers > =20 > Track session objects in the framework, and pass handles between the > framework (OCF), consumers, and drivers. Avoid redundancy and comple= xity in > individual drivers by allocating session memory in the framework and > providing it to drivers in ::newsession(). Hi, this produces WITNESS warning, since crypto_newsession() allocates memory with M_WAITOK flag while xform_init() holds mutex: uma_zalloc_arg: zone "crypto_session" with the following non-sleepable locks held: exclusive sleep mutex xforms_list (IPsec transforms list) r =3D 0 (0xffffffff81fdb840) locked @ /home/devel/freebsd/base/head/sys/netipsec/key.c:8676 stack backtrace: #0 0xffffffff80c01643 at witness_debugger+0x73 #1 0xffffffff80c02a21 at witness_warn+0x461 #2 0xffffffff80ed98a8 at uma_zalloc_arg+0x38 #3 0xffffffff80e4a0ca at crypto_newsession+0x1ea #4 0xffffffff80e3994c at esp_init+0x37c #5 0xffffffff80e31e68 at key_setsaval+0x7f8 #6 0xffffffff80e307e2 at key_newsav+0x302 #7 0xffffffff80e2ba0d at key_add+0x53d #8 0xffffffff80e263f5 at key_parse+0xac5 #9 0xffffffff80c34dc7 at sosend_generic+0x447 #10 0xffffffff80c34ffd at sosend+0x6d #11 0xffffffff80c3c170 at kern_sendit+0x240 #12 0xffffffff80c3c4be at sendit+0x19e #13 0xffffffff80c3c30d at sys_sendto+0x4d #14 0xffffffff8107e9c1 at amd64_syscall+0x281 #15 0xffffffff8105846d at fast_syscall_common+0x101 --=20 WBR, Andrey V. Elsukov --u4g29DgrNyLAd17BAj5hVtDf4awq8uScG-- --KFC0c0PSk2x6icLevvyZ2vluPp8N6284P Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlt2xzgACgkQAcXqBBDI oXrITwgAu8htJSVZzcZGwl4kyWQduUDj8Pudl+Fdy7QB+AcTM/IZ7H2nnUpoRT9M 7Z8wqoX0dkVZSXBMm4CYGM61/flWzxToKa2e2+gxKFuQV+Ln/yr5RAtfMlpzwQRM IoPqfiC2BOuwXANPm/8MUPEhHvqb5wxSwxI1RA2l+GvYOy+U/CotMyjtJyyLnLTv MF9AjZhxf4oqx1MOy+jB/EvNhAb9th2yKxc3XdkpDN8BfuGwuyA44LOMcSrlSxug +pgTmfvF1axfcgoyuM1SDKpNIfH0D1AbmPoh3XOC238H9tNy7r6XRFYbNH6zfGhT 8nUlEhY36L5vHSE8TlkxHL2ZPa+TQA== =rUKY -----END PGP SIGNATURE----- --KFC0c0PSk2x6icLevvyZ2vluPp8N6284P-- From owner-svn-src-all@freebsd.org Fri Aug 17 13:24: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 E23CF106E8DA; Fri, 17 Aug 2018 13:24:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96E397D096; Fri, 17 Aug 2018 13:24:49 +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 7823BF24; Fri, 17 Aug 2018 13:24:49 +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 w7HDOn0A026728; Fri, 17 Aug 2018 13:24:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HDOn1B026727; Fri, 17 Aug 2018 13:24:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808171324.w7HDOn1B026727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Aug 2018 13:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337964 - head/usr.bin/dtc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/dtc X-SVN-Commit-Revision: 337964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 13:24:50 -0000 Author: kevans Date: Fri Aug 17 13:24:48 2018 New Revision: 337964 URL: https://svnweb.freebsd.org/changeset/base/337964 Log: dtc(1): Update to 97d2d5715eeb45108cc60367fdf6bd5b2046b050 Notable fixes: - Overlays may now be generated properly without -@ - /__local_fixups__ were not including unit address in their structure - The error reporting a magic token was misleading, reporting "Bad magic token in header. Got d00dfeed expected 0xd00dfeed" if the token was missing. This has been split out into a separate message. MFC after: 1 week Modified: head/usr.bin/dtc/dtb.cc head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/dtb.cc ============================================================================== --- head/usr.bin/dtc/dtb.cc Fri Aug 17 12:39:00 2018 (r337963) +++ head/usr.bin/dtc/dtb.cc Fri Aug 17 13:24:48 2018 (r337964) @@ -262,9 +262,14 @@ header::write(output_writer &out) bool header::read_dtb(input_buffer &input) { - if (!(input.consume_binary(magic) && magic == 0xd00dfeed)) + if (!input.consume_binary(magic)) { - fprintf(stderr, "Missing magic token in header. Got %" PRIx32 + fprintf(stderr, "Missing magic token in header."); + return false; + } + if (magic != 0xd00dfeed) + { + fprintf(stderr, "Bad magic token in header. Got %" PRIx32 " expected 0xd00dfeed\n", magic); return false; } Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Fri Aug 17 12:39:00 2018 (r337963) +++ head/usr.bin/dtc/fdt.cc Fri Aug 17 13:24:48 2018 (r337964) @@ -1337,7 +1337,7 @@ device_tree::resolve_cross_references(uint32_t &phandl phandle_set.insert({&i.val, i}); } std::vector> sorted_phandles; - root->visit([&](node &n, node *parent) { + root->visit([&](node &n, node *) { for (auto &p : n.properties()) { for (auto &v : *p) @@ -1917,116 +1917,121 @@ device_tree::parse_dts(const string &fn, FILE *depfile symbols.push_back(prop); } root->add_child(node::create_special_node("__symbols__", symbols)); - // If this is a plugin, then we also need to create two extra nodes. - // Internal phandles will need to be renumbered to avoid conflicts with - // already-loaded nodes and external references will need to be - // resolved. - if (is_plugin) + } + // If this is a plugin, then we also need to create two extra nodes. + // Internal phandles will need to be renumbered to avoid conflicts with + // already-loaded nodes and external references will need to be + // resolved. + if (is_plugin) + { + std::vector symbols; + // Create the fixups entry. This is of the form: + // {target} = {path}:{property name}:{offset} + auto create_fixup_entry = [&](fixup &i, string target) + { + string value = i.path.to_string(); + value += ':'; + value += i.prop->get_key(); + value += ':'; + value += std::to_string(i.prop->offset_of_value(i.val)); + property_value v; + v.string_data = value; + v.type = property_value::STRING; + auto prop = std::make_shared(std::move(target)); + prop->add_value(v); + return prop; + }; + // If we have any unresolved phandle references in this plugin, + // then we must update them to 0xdeadbeef and leave a property in + // the /__fixups__ node whose key is the label and whose value is + // as described above. + if (!unresolved_fixups.empty()) { - // Create the fixups entry. This is of the form: - // {target} = {path}:{property name}:{offset} - auto create_fixup_entry = [&](fixup &i, string target) - { - string value = i.path.to_string(); - value += ':'; - value += i.prop->get_key(); - value += ':'; - value += std::to_string(i.prop->offset_of_value(i.val)); - property_value v; - v.string_data = value; - v.type = property_value::STRING; - auto prop = std::make_shared(std::move(target)); - prop->add_value(v); - return prop; - }; - // If we have any unresolved phandle references in this plugin, - // then we must update them to 0xdeadbeef and leave a property in - // the /__fixups__ node whose key is the label and whose value is - // as described above. - if (!unresolved_fixups.empty()) + for (auto &i : unresolved_fixups) { - symbols.clear(); - for (auto &i : unresolved_fixups) - { - auto &val = i.get().val; - symbols.push_back(create_fixup_entry(i, val.string_data)); - val.byte_data.push_back(0xde); - val.byte_data.push_back(0xad); - val.byte_data.push_back(0xbe); - val.byte_data.push_back(0xef); - val.type = property_value::BINARY; - } - root->add_child(node::create_special_node("__fixups__", symbols)); + auto &val = i.get().val; + symbols.push_back(create_fixup_entry(i, val.string_data)); + val.byte_data.push_back(0xde); + val.byte_data.push_back(0xad); + val.byte_data.push_back(0xbe); + val.byte_data.push_back(0xef); + val.type = property_value::BINARY; } - symbols.clear(); - // If we have any resolved phandle references in this plugin, then - // we must create a child in the __local_fixups__ node whose path - // matches the node path from the root and whose value contains the - // location of the reference within a property. - - // Create a local_fixups node that is initially empty. - node_ptr local_fixups = node::create_special_node("__local_fixups__", symbols); - for (auto &i : fixups) + root->add_child(node::create_special_node("__fixups__", symbols)); + } + symbols.clear(); + // If we have any resolved phandle references in this plugin, then + // we must create a child in the __local_fixups__ node whose path + // matches the node path from the root and whose value contains the + // location of the reference within a property. + + // Create a local_fixups node that is initially empty. + node_ptr local_fixups = node::create_special_node("__local_fixups__", symbols); + for (auto &i : fixups) + { + if (!i.val.is_phandle()) { - if (!i.val.is_phandle()) + continue; + } + node *n = local_fixups.get(); + for (auto &p : i.path) + { + // Skip the implicit root + if (p.first.empty()) { continue; } - node *n = local_fixups.get(); - for (auto &p : i.path) + bool found = false; + for (auto &c : n->child_nodes()) { - // Skip the implicit root - if (p.first.empty()) + if (c->name == p.first) { - continue; - } - bool found = false; - for (auto &c : n->child_nodes()) - { - if (c->name == p.first) + string path = p.first; + if (!(p.second.empty())) { - n = c.get(); - found = true; - break; + path += '@'; + path += p.second; } - } - if (!found) - { - n->add_child(node::create_special_node(p.first, symbols)); + n->add_child(node::create_special_node(path, symbols)); n = (--n->child_end())->get(); } } - assert(n); - property_value pv; - push_big_endian(pv.byte_data, static_cast(i.prop->offset_of_value(i.val))); - pv.type = property_value::BINARY; - auto key = i.prop->get_key(); - property_ptr prop = n->get_property(key); - // If we don't have an existing property then create one and - // use this property value - if (!prop) + if (!found) { - prop = std::make_shared(std::move(key)); - n->add_property(prop); - prop->add_value(pv); + n->add_child(node::create_special_node(p.first, symbols)); + n = (--n->child_end())->get(); } - else - { - // If we do have an existing property value, try to append - // this value. - property_value &old_val = *(--prop->end()); - if (!old_val.try_to_merge(pv)) - { - prop->add_value(pv); - } - } } - // We've iterated over all fixups, but only emit the - // __local_fixups__ if we found some that were resolved internally. - if (local_fixups->child_begin() != local_fixups->child_end()) + assert(n); + property_value pv; + push_big_endian(pv.byte_data, static_cast(i.prop->offset_of_value(i.val))); + pv.type = property_value::BINARY; + auto key = i.prop->get_key(); + property_ptr prop = n->get_property(key); + // If we don't have an existing property then create one and + // use this property value + if (!prop) { - root->add_child(std::move(local_fixups)); + prop = std::make_shared(std::move(key)); + n->add_property(prop); + prop->add_value(pv); } + else + { + // If we do have an existing property value, try to append + // this value. + property_value &old_val = *(--prop->end()); + if (!old_val.try_to_merge(pv)) + { + prop->add_value(pv); + } + } + } + // We've iterated over all fixups, but only emit the + // __local_fixups__ if we found some that were resolved internally. + if (local_fixups->child_begin() != local_fixups->child_end()) + { + root->add_child(std::move(local_fixups)); } } } From owner-svn-src-all@freebsd.org Fri Aug 17 13:32: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 16D24106EF6B; Fri, 17 Aug 2018 13:32:35 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BF017DAB5; Fri, 17 Aug 2018 13:32:34 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 2C07E42A3D; Fri, 17 Aug 2018 16:32:24 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback5o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 06lcY2JVz5-WOT0WL72; Fri, 17 Aug 2018 16:32:24 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1534512744; bh=zdie6jliTcyJQp3eAUYpT6TzyPbLoK/jfZsvL66Gn/Q=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=FdTYYIXbdPPfjj+ciVSdhdHxkgx+B6QoBWj4xI2IRZFQ7S8/q90Pwqms0rR/N1DpD qPcBQz9mvAQkG5b7ux/fwgKdCHkvaY99VaY4I4kT4AK+ES7MzOVNvvExEzbJLrWPFK fPFz0eaAnDlePN0buBkISUQTHksupQmdZ4djntYQ= Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id UmD847jquE-WNLmRgUq; Fri, 17 Aug 2018 16:32:23 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1534512743; bh=zdie6jliTcyJQp3eAUYpT6TzyPbLoK/jfZsvL66Gn/Q=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=bT4qMoxMI9a2DHEUNq7a6AViEnup6owXEkBFK2bi4HhU0ar3afoQJe395scJXf7kV xOB0xsFHZefvSEHOG/pnRSICJn7DAseyPo95qs4got+AomePuQiakU95Vv/oxMCUUd 8lDBBo5zitsxBB0spLER19a/x6raru1AweYIiG5M= Authentication-Results: smtp1o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337736 - in head/sys: netinet netinet6 To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808140754.w7E7sEFs018313@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Fri, 17 Aug 2018 16:31:42 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mWWUn5o6axP8hW17d53NkBOxTUpMH7w5a" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 13:32:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mWWUn5o6axP8hW17d53NkBOxTUpMH7w5a Content-Type: multipart/mixed; boundary="HvPTNh4d52KObrDfnjB1dOnRmmXZU4SJz"; protected-headers="v1" From: "Andrey V. Elsukov" To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r337736 - in head/sys: netinet netinet6 References: <201808140754.w7E7sEFs018313@repo.freebsd.org> In-Reply-To: --HvPTNh4d52KObrDfnjB1dOnRmmXZU4SJz Content-Type: multipart/mixed; boundary="------------39C66C75E0503693ED0220C5" Content-Language: en-US This is a multi-part message in MIME format. --------------39C66C75E0503693ED0220C5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 16.08.2018 21:34, Alan Somers wrote: > On Tue, Aug 14, 2018 at 1:54 AM, Andrey V. Elsukov > wrote: >=20 > Author: ae > Date: Tue Aug 14 07:54:14 2018 > New Revision: 337736 > URL: https://svnweb.freebsd.org/changeset/base/337736 > >=20 > Log: > =C2=A0 Restore ability to send ICMP and ICMPv6 redirects. >=20 > =C2=A0 It was lost when tryforward appeared. Now ip[6]_tryforward w= ill be > enabled > =C2=A0 only when sending redirects for corresponding IP version is > disabled via > =C2=A0 sysctl. Otherwise will be used default forwarding function. >=20 > =C2=A0 PR:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0221137 >=20 > This change broke the sys/netipsec/tunnel tests.=C2=A0 I don't know if = it's a > limitation of the tests, or a genuine kernel bug, but I bisected the > regression down to this change.=C2=A0 Can you please fix it? >=20 > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/8630/testReport/sys.= netipsec.tunnel/empty/v4/ I think it is because IPv4 tests use broadcast addresses in some places. The attached patch fixes the test for me. --=20 WBR, Andrey V. Elsukov --------------39C66C75E0503693ED0220C5 Content-Type: text/x-patch; name="ipsec.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ipsec.diff" Index: tests/sys/netipsec/tunnel/utils.subr =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tests/sys/netipsec/tunnel/utils.subr (revision 337961) +++ tests/sys/netipsec/tunnel/utils.subr (working copy) @@ -57,8 +57,8 @@ ist_v4_setup () jexec ipsecA ifconfig ${epair_LAN_A}b 192.0.2.2/30 up jexec ipsecA ifconfig ${epair_PUB_A}a 198.51.100.2/30 up jexec router ifconfig ${epair_PUB_A}b 198.51.100.1/30 up - jexec router ifconfig ${epair_PUB_B}b 198.51.100.6/30 up - jexec ipsecB ifconfig ${epair_PUB_B}a 198.51.100.7/30 up + jexec router ifconfig ${epair_PUB_B}b 198.51.100.5/30 up + jexec ipsecB ifconfig ${epair_PUB_B}a 198.51.100.6/30 up jexec ipsecB ifconfig ${epair_LAN_B}b 203.0.113.2/30 up jexec hostB ifconfig ${epair_LAN_B}a 203.0.113.1/30 up jexec ipsecA sysctl net.inet.ip.forwarding=3D1 @@ -66,7 +66,7 @@ ist_v4_setup () jexec ipsecB sysctl net.inet.ip.forwarding=3D1 jexec hostA route add default 192.0.2.2 jexec ipsecA route add default 198.51.100.1 - jexec ipsecB route add default 198.51.100.6 + jexec ipsecB route add default 198.51.100.5 jexec hostB route add default 203.0.113.2 } =20 @@ -109,7 +109,7 @@ ist_setkey() SRC_LAN=3D"192.0.2.0/24" DST_LAN=3D"203.0.113.0/24" SRC_GW=3D"198.51.100.2" - DST_GW=3D"198.51.100.7" + DST_GW=3D"198.51.100.6" else SRC_LAN=3D"2001:db8:1::/64" DST_LAN=3D"2001:db8:45::/64" --------------39C66C75E0503693ED0220C5-- --HvPTNh4d52KObrDfnjB1dOnRmmXZU4SJz-- --mWWUn5o6axP8hW17d53NkBOxTUpMH7w5a Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlt2zj4ACgkQAcXqBBDI oXpXKgf/c1DcFBelAdXHV780rjVq7+8u9umfEehVd4ulPRfASj4y+A+EQF3aeShT JrQg8D6yrGVBJE7A5iX7QWHb8N26n2MCZTYgmMw5hSni20yAE1F01I21RTWKuOHz AZ5k+ZD17VVj5021kgZC/CdBomXYAtdr64sfQJWsnsqB7mY1s/I9vgTuWrCOGAi5 Y6pmonfitSQOEKtXfDaw5A3KKlY3Y71guI5JhsKn8hAwcY5kCY8blcQE8naIj93h Nv6UBpRRRC+F8fuYffyGk01WXdpaSqOZmTcbYqFhb8E3icejBxXRX1X0UIfLuDrf Mur/6RcELUxfbuHpaUkvKIf+guTIiQ== =pFQf -----END PGP SIGNATURE----- --mWWUn5o6axP8hW17d53NkBOxTUpMH7w5a-- From owner-svn-src-all@freebsd.org Fri Aug 17 14:35: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 8E1801070B38; Fri, 17 Aug 2018 14:35:11 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44761808FF; Fri, 17 Aug 2018 14:35:11 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21A741AC9; Fri, 17 Aug 2018 14:35:11 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HEZAVR063395; Fri, 17 Aug 2018 14:35:10 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HEZAGs063394; Fri, 17 Aug 2018 14:35:10 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201808171435.w7HEZAGs063394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 17 Aug 2018 14:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337965 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 14:35:11 -0000 Author: oshogbo Date: Fri Aug 17 14:35:10 2018 New Revision: 337965 URL: https://svnweb.freebsd.org/changeset/base/337965 Log: capsicum: allow the setproctitle(3) function in capability mode Capsicum in past allowed to change the process title. This was broken with r335939. PR: 230584 Submitted by: Yuichiro NAITO Reported by: ian@niw.com.au MFC after: 1 week Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Aug 17 13:24:48 2018 (r337964) +++ head/sys/kern/kern_exec.c Fri Aug 17 14:35:10 2018 (r337965) @@ -123,7 +123,7 @@ static int do_execve(struct thread *td, struct image_a /* XXX This should be vm_size_t. */ SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD| - CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_ps_strings, "LU", ""); + CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_ps_strings, "LU", ""); /* XXX This should be vm_size_t. */ SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD| From owner-svn-src-all@freebsd.org Fri Aug 17 14:37: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 199341070BF4; Fri, 17 Aug 2018 14:37:14 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C201780A7B; Fri, 17 Aug 2018 14:37:13 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EF411ACB; Fri, 17 Aug 2018 14:37:13 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HEbDmS063536; Fri, 17 Aug 2018 14:37:13 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HEbDW3063535; Fri, 17 Aug 2018 14:37:13 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201808171437.w7HEbDW3063535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 17 Aug 2018 14:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337966 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 337966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 14:37:14 -0000 Author: oshogbo Date: Fri Aug 17 14:37:13 2018 New Revision: 337966 URL: https://svnweb.freebsd.org/changeset/base/337966 Log: Fix style nits. Modified: head/lib/libc/gen/setproctitle.c Modified: head/lib/libc/gen/setproctitle.c ============================================================================== --- head/lib/libc/gen/setproctitle.c Fri Aug 17 14:35:10 2018 (r337965) +++ head/lib/libc/gen/setproctitle.c Fri Aug 17 14:37:13 2018 (r337966) @@ -72,7 +72,7 @@ setproctitle_internal(const char *fmt, va_list ap) if (buf == NULL) { buf = malloc(SPT_BUFSIZE); - if (buf == NULL) + if (buf == NULL) return (NULL); nargv[0] = buf; } @@ -98,13 +98,13 @@ setproctitle_internal(const char *fmt, va_list ap) } /* print the argument string */ - (void) vsnprintf(buf + len, SPT_BUFSIZE - len, fmt, ap); + (void)vsnprintf(buf + len, SPT_BUFSIZE - len, fmt, ap); nargvp = nargv; nargc = 1; kbuf = buf; } else if (*obuf != '\0') { - /* Idea from NetBSD - reset the title on fmt == NULL */ + /* Idea from NetBSD - reset the title on fmt == NULL */ nargvp = oargv; nargc = oargc; kbuf = obuf; From owner-svn-src-all@freebsd.org Fri Aug 17 14:47:22 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 5C73B1070FEC; Fri, 17 Aug 2018 14:47:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1233681114; Fri, 17 Aug 2018 14:47:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E791A1C82; Fri, 17 Aug 2018 14:47:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HElLSO068862; Fri, 17 Aug 2018 14:47:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HElLm3068859; Fri, 17 Aug 2018 14:47:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808171447.w7HElLm3068859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 17 Aug 2018 14:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337967 - in head/sys: amd64/conf arm64/conf i386/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: amd64/conf arm64/conf i386/conf X-SVN-Commit-Revision: 337967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 14:47:22 -0000 Author: imp Date: Fri Aug 17 14:47:21 2018 New Revision: 337967 URL: https://svnweb.freebsd.org/changeset/base/337967 Log: GPT is standard in x86 and arm64 land. Add it to DEFAULTS with the others. Differential Revision: https://reviews.freebsd.org/D16740 Modified: head/sys/amd64/conf/DEFAULTS head/sys/arm64/conf/DEFAULTS head/sys/i386/conf/DEFAULTS Modified: head/sys/amd64/conf/DEFAULTS ============================================================================== --- head/sys/amd64/conf/DEFAULTS Fri Aug 17 14:37:13 2018 (r337966) +++ head/sys/amd64/conf/DEFAULTS Fri Aug 17 14:47:21 2018 (r337967) @@ -20,5 +20,6 @@ options GEOM_PART_BSD options GEOM_PART_EBR options GEOM_PART_EBR_COMPAT options GEOM_PART_MBR +options GEOM_PART_GPT options NEW_PCIB Modified: head/sys/arm64/conf/DEFAULTS ============================================================================== --- head/sys/arm64/conf/DEFAULTS Fri Aug 17 14:37:13 2018 (r337966) +++ head/sys/arm64/conf/DEFAULTS Fri Aug 17 14:47:21 2018 (r337967) @@ -11,5 +11,6 @@ device mem # Memory and kernel memory devices # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_MBR +options GEOM_PART_GPT options NEW_PCIB Modified: head/sys/i386/conf/DEFAULTS ============================================================================== --- head/sys/i386/conf/DEFAULTS Fri Aug 17 14:37:13 2018 (r337966) +++ head/sys/i386/conf/DEFAULTS Fri Aug 17 14:47:21 2018 (r337967) @@ -21,6 +21,7 @@ options GEOM_PART_BSD options GEOM_PART_EBR options GEOM_PART_EBR_COMPAT options GEOM_PART_MBR +options GEOM_PART_GPT # enable support for native hardware device atpic From owner-svn-src-all@freebsd.org Fri Aug 17 14:53: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 9EF3A10714B7 for ; Fri, 17 Aug 2018 14:53:50 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F9AB817E9 for ; Fri, 17 Aug 2018 14:53:50 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 52b94285-a22d-11e8-aff6-0b9b8210da61 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 52b94285-a22d-11e8-aff6-0b9b8210da61; Fri, 17 Aug 2018 14:53:39 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7HErbHd080560; Fri, 17 Aug 2018 08:53:37 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534517617.27158.11.camel@freebsd.org> Subject: Re: svn commit: r337944 - head/sys/arm/conf From: Ian Lepore To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 17 Aug 2018 08:53:37 -0600 In-Reply-To: <201808170104.w7H142P8048034@repo.freebsd.org> References: <201808170104.w7H142P8048034@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 14:53:50 -0000 On Fri, 2018-08-17 at 01:04 +0000, Conrad Meyer wrote: > Author: cem > Date: Fri Aug 17 01:04:02 2018 > New Revision: 337944 > URL: https://svnweb.freebsd.org/changeset/base/337944 > > Log: >   arm: Define crypto option on platforms that include IPsec >    >   Missed in r337940. >    >   (It's not like there are any crypto files IPsec doesn't pull in, so it is >   unclear what not defining the crypto option was supposed to achieve.) >    >   Reported by: np@ > > Modified: >   head/sys/arm/conf/std.armv6 >   head/sys/arm/conf/std.armv7 > > Modified: head/sys/arm/conf/std.armv6 > ============================================================================== > --- head/sys/arm/conf/std.armv6 Fri Aug 17 01:03:23 2018 (r337943) > +++ head/sys/arm/conf/std.armv6 Fri Aug 17 01:04:02 2018 (r337944) > @@ -9,6 +9,7 @@ options  VIMAGE # Subsystem virtualization, e.g. VNE >  options  INET # InterNETworking >  options  INET6 # IPv6 communications protocols >  options  TCP_HHOOK # hhook(9) framework for TCP > +device crypto # IPSec && !crypto is nonsensical >  options  IPSEC # IP (v4/v6) security >  options  SCTP # Stream Control Transmission Protocol >  options  FFS # Berkeley Fast Filesystem > > Modified: head/sys/arm/conf/std.armv7 > ============================================================================== > --- head/sys/arm/conf/std.armv7 Fri Aug 17 01:03:23 2018 (r337943) > +++ head/sys/arm/conf/std.armv7 Fri Aug 17 01:04:02 2018 (r337944) > @@ -9,6 +9,7 @@ options  VIMAGE # Subsystem virtualization, e.g. VNE >  options  INET # InterNETworking >  options  INET6 # IPv6 communications protocols >  options  TCP_HHOOK # hhook(9) framework for TCP > +device crypto # IPSec && !crypto is nonsensical >  options  IPSEC # IP (v4/v6) security >  options  SCTP # Stream Control Transmission Protocol >  options  FFS # Berkeley Fast Filesystem > What problem were you trying to solve with this change? Aside from putting a device statement into a file that, by design, only contains options, and besides adding it with a snarky comment rather than the canononical comment associated with that device from sys/conf/NOTES, I can't see offhand how this changes anything. Virtually everything that is dependent on the crypto device is actually specified as crypto | ipsec | ipsec_support, which seems like the correct way to implement "option IPSEC implies device crypto". -- Ian From owner-svn-src-all@freebsd.org Fri Aug 17 14:57: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 C4454107166F; Fri, 17 Aug 2018 14:57:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74C4481A88; Fri, 17 Aug 2018 14:57:14 +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 4D8D01E34; Fri, 17 Aug 2018 14:57:14 +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 w7HEvESY073832; Fri, 17 Aug 2018 14:57:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HEvEx1073831; Fri, 17 Aug 2018 14:57:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808171457.w7HEvEx1073831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 17 Aug 2018 14:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337968 - head/sbin/init X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/init X-SVN-Commit-Revision: 337968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 14:57:14 -0000 Author: trasz Date: Fri Aug 17 14:57:13 2018 New Revision: 337968 URL: https://svnweb.freebsd.org/changeset/base/337968 Log: Consistently use NULL to terminate the argv; no functional changes. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Fri Aug 17 14:47:21 2018 (r337967) +++ head/sbin/init/init.c Fri Aug 17 14:57:13 2018 (r337968) @@ -974,7 +974,7 @@ single_user(void) char name[] = "-sh"; argv[0] = name; - argv[1] = 0; + argv[1] = NULL; execv(shell, argv); emergency("can't exec %s for single user: %m", shell); execv(_PATH_BSHELL, argv); @@ -1134,7 +1134,7 @@ run_script(const char *script) argv[0] = _sh; argv[1] = __DECONST(char *, script); argv[2] = runcom_mode == AUTOBOOT ? _autoboot : 0; - argv[3] = 0; + argv[3] = NULL; execute_script(argv); sleep(STALL_TIMEOUT); @@ -1478,10 +1478,10 @@ start_window_system(session_t *sp) strcpy(term, "TERM="); strlcat(term, sp->se_type, sizeof(term)); env[0] = term; - env[1] = 0; + env[1] = NULL; } else - env[0] = 0; + env[0] = NULL; execve(sp->se_window_argv[0], sp->se_window_argv, env); stall("can't exec window system '%s' for port %s: %m", sp->se_window_argv[0], sp->se_device); @@ -1542,9 +1542,9 @@ start_getty(session_t *sp) strcpy(term, "TERM="); strlcat(term, sp->se_type, sizeof(term)); env[0] = term; - env[1] = 0; + env[1] = NULL; } else - env[0] = 0; + env[0] = NULL; execve(sp->se_getty_argv[0], sp->se_getty_argv, env); stall("can't exec getty '%s' for port %s: %m", sp->se_getty_argv[0], sp->se_device); @@ -1928,7 +1928,7 @@ runshutdown(void) argv[0] = _sh; argv[1] = _path_rundown; argv[2] = Reboot ? _reboot : _single; - argv[3] = 0; + argv[3] = NULL; execute_script(argv); _exit(1); /* force single user mode */ From owner-svn-src-all@freebsd.org Fri Aug 17 15:00: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 162131071770; Fri, 17 Aug 2018 15:00:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C11A381C40; Fri, 17 Aug 2018 15:00:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 898FB1E3F; Fri, 17 Aug 2018 15:00:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HF0AZL074066; Fri, 17 Aug 2018 15:00:10 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HF0AU6074065; Fri, 17 Aug 2018 15:00:10 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808171500.w7HF0AU6074065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 17 Aug 2018 15:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337969 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 337969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:00:11 -0000 Author: kp Date: Fri Aug 17 15:00:10 2018 New Revision: 337969 URL: https://svnweb.freebsd.org/changeset/base/337969 Log: pf: Limit the maximum number of fragments per packet Similar to the network stack issue fixed in r337782 pf did not limit the number of fragments per packet, which could be exploited to generate high CPU loads with a crafted series of packets. Limit each packet to no more than 64 fragments. This should be sufficient on typical networks to allow maximum-sized IP frames. This addresses the issue for both IPv4 and IPv6. MFC after: 3 days Security: CVE-2018-5391 Sponsored by: Klara Systems Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Fri Aug 17 14:57:13 2018 (r337968) +++ head/sys/netpfil/pf/pf_norm.c Fri Aug 17 15:00:10 2018 (r337969) @@ -91,8 +91,10 @@ struct pf_fragment { TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; uint16_t fr_maxlen; /* maximum length of single fragment */ + uint16_t fr_entries; /* Total number of pf_fragment entries */ TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; }; +#define PF_MAX_FRENT_PER_FRAGMENT 64 struct pf_fragment_tag { uint16_t ft_hdrlen; /* header length of reassembled pkt */ @@ -384,6 +386,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct *(struct pf_fragment_cmp *)frag = *key; frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; + frag->fr_entries = 0; TAILQ_INIT(&frag->fr_queue); RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); @@ -395,6 +398,9 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct return (frag); } + if (frag->fr_entries >= PF_MAX_FRENT_PER_FRAGMENT) + goto bad_fragment; + KASSERT(!TAILQ_EMPTY(&frag->fr_queue), ("!TAILQ_EMPTY()->fr_queue")); /* Remember maximum fragment len for refragmentation. */ @@ -466,6 +472,8 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); else TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); + + frag->fr_entries++; return (frag); From owner-svn-src-all@freebsd.org Fri Aug 17 15:00: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 F3DA510717BB; Fri, 17 Aug 2018 15:00:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA31F81DA6; Fri, 17 Aug 2018 15:00:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BDA21E48; Fri, 17 Aug 2018 15:00:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HF0fQD074134; Fri, 17 Aug 2018 15:00:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HF0fGG074133; Fri, 17 Aug 2018 15:00:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201808171500.w7HF0fGG074133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 17 Aug 2018 15:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337970 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:00:42 -0000 Author: mav Date: Fri Aug 17 15:00:41 2018 New Revision: 337970 URL: https://svnweb.freebsd.org/changeset/base/337970 Log: 9738 Fix third block copy allocations, broken at 9112. Use METASLAB_WEIGHT_CLAIM weight to allocate tertiary blocks. Previous use of METASLAB_WEIGHT_SECONDARY for that caused errors later on metaslab_activate_allocator() call, leading to massive load of unneeded metaslabs and write freezes. Reviewed by: Paul Dagnelie Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Aug 17 15:00:10 2018 (r337969) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Aug 17 15:00:41 2018 (r337970) @@ -3081,7 +3081,6 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ metaslab_t *msp = NULL; uint64_t offset = -1ULL; uint64_t activation_weight; - boolean_t tertiary = B_FALSE; activation_weight = METASLAB_WEIGHT_PRIMARY; for (int i = 0; i < d; i++) { @@ -3090,7 +3089,7 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ activation_weight = METASLAB_WEIGHT_SECONDARY; } else if (activation_weight == METASLAB_WEIGHT_SECONDARY && DVA_GET_VDEV(&dva[i]) == mg->mg_vd->vdev_id) { - tertiary = B_TRUE; + activation_weight = METASLAB_WEIGHT_CLAIM; break; } } @@ -3099,10 +3098,8 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ * If we don't have enough metaslabs active to fill the entire array, we * just use the 0th slot. */ - if (mg->mg_ms_ready < mg->mg_allocators * 2) { - tertiary = B_FALSE; + if (mg->mg_ms_ready < mg->mg_allocators * 3) allocator = 0; - } ASSERT3U(mg->mg_vd->vdev_ms_count, >=, 2); @@ -3128,7 +3125,7 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ msp = mg->mg_primaries[allocator]; was_active = B_TRUE; } else if (activation_weight == METASLAB_WEIGHT_SECONDARY && - mg->mg_secondaries[allocator] != NULL && !tertiary) { + mg->mg_secondaries[allocator] != NULL) { msp = mg->mg_secondaries[allocator]; was_active = B_TRUE; } else { @@ -3171,7 +3168,8 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_ continue; } - if (msp->ms_weight & METASLAB_WEIGHT_CLAIM) { + if (msp->ms_weight & METASLAB_WEIGHT_CLAIM && + activation_weight != METASLAB_WEIGHT_CLAIM) { metaslab_passivate(msp, msp->ms_weight & ~METASLAB_WEIGHT_CLAIM); mutex_exit(&msp->ms_lock); From owner-svn-src-all@freebsd.org Fri Aug 17 15:02: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 026E11071A20; Fri, 17 Aug 2018 15:02:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D6CE82193; Fri, 17 Aug 2018 15:02:58 +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 7B0151FE2; Fri, 17 Aug 2018 15:02:58 +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 w7HF2wON078649; Fri, 17 Aug 2018 15:02:58 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HF2wSq078648; Fri, 17 Aug 2018 15:02:58 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808171502.w7HF2wSq078648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 17 Aug 2018 15:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337971 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 337971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:02:59 -0000 Author: kp Date: Fri Aug 17 15:02:58 2018 New Revision: 337971 URL: https://svnweb.freebsd.org/changeset/base/337971 Log: pf tests: Verify that pf limits the number of fragments per packet Test the limitation on number of frames per packet introduced in pf in r337969. Sponsored by: Klara Systems Modified: head/tests/sys/netpfil/pf/fragmentation.sh Modified: head/tests/sys/netpfil/pf/fragmentation.sh ============================================================================== --- head/tests/sys/netpfil/pf/fragmentation.sh Fri Aug 17 15:00:41 2018 (r337970) +++ head/tests/sys/netpfil/pf/fragmentation.sh Fri Aug 17 15:02:58 2018 (r337971) @@ -2,6 +2,49 @@ . $(atf_get_srcdir)/utils.subr +atf_test_case "too_many_fragments" "cleanup" + +too_many_fragments_head() +{ + atf_set descr 'IPv4 fragment limitation test' + atf_set require.user root +} + +too_many_fragments_body() +{ + pft_init + + epair=$(pft_mkepair) + pft_mkjail alcatraz ${epair}a + + ifconfig ${epair}b inet 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}a 192.0.2.2/24 up + + ifconfig ${epair}b mtu 200 + jexec alcatraz ifconfig ${epair}a mtu 200 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "scrub all fragment reassemble" + + # So we know pf is limiting things + jexec alcatraz sysctl net.inet.ip.maxfragsperpacket=1024 + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + # We can ping with < 64 fragments + atf_check -s exit:0 -o ignore ping -c 1 -s 800 192.0.2.2 + + # Too many fragments should fail + atf_check -s exit:2 -o ignore ping -c 1 -s 20000 192.0.2.2 +} + +too_many_fragments_cleanup() +{ + pft_cleanup +} + atf_test_case "v6" "cleanup" v6_head() { @@ -70,5 +113,6 @@ v6_cleanup() atf_init_test_cases() { + atf_add_test_case "too_many_fragments" atf_add_test_case "v6" } From owner-svn-src-all@freebsd.org Fri Aug 17 15:17: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 70BF11071F15; Fri, 17 Aug 2018 15:17:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8A3582B42; Fri, 17 Aug 2018 15:17:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9048B219E; Fri, 17 Aug 2018 15:17:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HFH9Bd084276; Fri, 17 Aug 2018 15:17:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HFH9uk084275; Fri, 17 Aug 2018 15:17:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201808171517.w7HFH9uk084275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 17 Aug 2018 15:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337972 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 337972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:17:10 -0000 Author: mav Date: Fri Aug 17 15:17:09 2018 New Revision: 337972 URL: https://svnweb.freebsd.org/changeset/base/337972 Log: 9751 Allocation throttling misplacing ditto blocks Relax allocation throttling for ditto blocks. Due to random imbalances in allocation it tends to push block copies to one vdev, that looks slightly better at the moment. Slightly less strict policy allows both improve data security and surprisingly write performance, since we don't need to touch extra metaslabs on each vdev to respect the min distance. Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Aug 17 15:02:58 2018 (r337971) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Aug 17 15:17:09 2018 (r337972) @@ -1081,7 +1081,7 @@ metaslab_group_fragmentation(metaslab_group_t *mg) */ static boolean_t metaslab_group_allocatable(metaslab_group_t *mg, metaslab_group_t *rotor, - uint64_t psize, int allocator) + uint64_t psize, int allocator, int d) { spa_t *spa = mg->mg_vd->vdev_spa; metaslab_class_t *mc = mg->mg_class; @@ -1122,6 +1122,13 @@ metaslab_group_allocatable(metaslab_group_t *mg, metas if (mg->mg_no_free_space) return (B_FALSE); + /* + * Relax allocation throttling for ditto blocks. Due to + * random imbalances in allocation it tends to push copies + * to one vdev, that looks a bit better at the moment. + */ + qmax = qmax * (4 + d) / 4; + qdepth = refcount_count(&mg->mg_alloc_queue_depth[allocator]); /* @@ -1142,7 +1149,7 @@ metaslab_group_allocatable(metaslab_group_t *mg, metas */ for (mgp = mg->mg_next; mgp != rotor; mgp = mgp->mg_next) { qmax = mgp->mg_cur_max_alloc_queue_depth[allocator]; - + qmax = qmax * (4 + d) / 4; qdepth = refcount_count( &mgp->mg_alloc_queue_depth[allocator]); @@ -3424,7 +3431,7 @@ top: */ if (allocatable && !GANG_ALLOCATION(flags) && !try_hard) { allocatable = metaslab_group_allocatable(mg, rotor, - psize, allocator); + psize, allocator, d); } if (!allocatable) { From owner-svn-src-all@freebsd.org Fri Aug 17 15:18: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 AE7341071FAB; Fri, 17 Aug 2018 15:18:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6229E82E62; Fri, 17 Aug 2018 15:18:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F7EC219F; Fri, 17 Aug 2018 15:18:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HFIw4o084394; Fri, 17 Aug 2018 15:18:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HFIwPf084393; Fri, 17 Aug 2018 15:18:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808171518.w7HFIwPf084393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 17 Aug 2018 15:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337973 - head/etc X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 337973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:18:58 -0000 Author: asomers Date: Fri Aug 17 15:18:57 2018 New Revision: 337973 URL: https://svnweb.freebsd.org/changeset/base/337973 Log: Add Modbus Application Protocol to /etc/services IANA reassigned ports 502 and 802 on 2014-06-10 PR: 213276 Submitted by: Mark.Martinec@ijs.si MFC after: 2 weeks Modified: head/etc/services Modified: head/etc/services ============================================================================== --- head/etc/services Fri Aug 17 15:17:09 2018 (r337972) +++ head/etc/services Fri Aug 17 15:18:57 2018 (r337973) @@ -873,8 +873,8 @@ isakmp 500/tcp isakmp 500/udp stmf 501/tcp stmf 501/udp -asa-appl-proto 502/tcp -asa-appl-proto 502/udp +mbap 502/tcp # Modbus Application Protocol +mbap 502/udp # Modbus Application Protocol intrinsa 503/tcp intrinsa 503/udp citadel 504/tcp @@ -1414,6 +1414,8 @@ mdbs_daemon 800/tcp mdbs_daemon 800/udp device 801/tcp device 801/udp +mbap-s 802/tcp # Modbus Application Protocol Secure +mbap-s 802/udp # Modbus Application Protocol Secure fcp-udp 810/tcp #FCP fcp-udp 810/udp #FCP Datagram itm-mcell-s 828/tcp From owner-svn-src-all@freebsd.org Fri Aug 17 15:24: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 9C6CD107224E; Fri, 17 Aug 2018 15:24:42 +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 CD31783314; Fri, 17 Aug 2018 15:24:41 +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 w7HFOdeV059799; Fri, 17 Aug 2018 08:24:39 -0700 (PDT) (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 w7HFOdQi059798; Fri, 17 Aug 2018 08:24:39 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808171524.w7HFOdQi059798@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337956 - in head: . bin/ls In-Reply-To: <201808170415.w7H4Fp7D046775@repo.freebsd.org> To: Kyle Evans Date: Fri, 17 Aug 2018 08:24:39 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:24:42 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: kevans > Date: Fri Aug 17 04:15:51 2018 > New Revision: 337956 > URL: https://svnweb.freebsd.org/changeset/base/337956 > > Log: > ls(1): Add --color=when > > --color may be set to one of: 'auto', 'always', and 'never'. > > 'auto' is the default behavior- output colors only if -G or COLORTERM are Why different than coreutils ls? Default for coreutils is none. > set, and only if stdout is a tty. > > 'always' is a new behavior- output colors always. termcap(5) will be > consulted unless TERM is unset or not a recognized terminal, in which case > ls(1) will fall back to explicitly outputting ANSI escape sequences. > > 'never' to turn off any environment variable and -G usage. Why different than core utils? Coreutils uses none. > > Reviewed by: cem, 0mp (both modulo last-minute manpage changes > Differential Revision: https://reviews.freebsd.org/D16741 > > Modified: > head/UPDATING > head/bin/ls/extern.h > head/bin/ls/ls.1 > head/bin/ls/ls.c > head/bin/ls/print.c > head/bin/ls/util.c > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Fri Aug 17 04:11:10 2018 (r337955) > +++ head/UPDATING Fri Aug 17 04:15:51 2018 (r337956) > @@ -35,9 +35,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > ls(1) now respects the COLORTERM environment variable used in other > systems and software to indicate that a colored terminal is both > supported and desired. If ls(1) is suddenly emitting colors, they may > - be disabled again by removing the unwanted COLORTERM from your > - environment. The ls(1) specific CLICOLOR may not be observed in a > - future release. > + be disabled again by either removing the unwanted COLORTERM from your > + environment, or using `ls --color=never`. The ls(1) specific CLICOLOR > + may not be observed in a future release. > > 20180808: > The default pager for most commands has been changed to "less". To > > Modified: head/bin/ls/extern.h > ============================================================================== > --- head/bin/ls/extern.h Fri Aug 17 04:11:10 2018 (r337955) > +++ head/bin/ls/extern.h Fri Aug 17 04:15:51 2018 (r337956) > @@ -32,6 +32,8 @@ > * $FreeBSD$ > */ > > +#include > + > int acccmp(const FTSENT *, const FTSENT *); > int revacccmp(const FTSENT *, const FTSENT *); > int birthcmp(const FTSENT *, const FTSENT *); > @@ -64,5 +66,12 @@ extern char *ansi_bgcol; > extern char *ansi_coloff; > extern char *attrs_off; > extern char *enter_bold; > + > +extern int colorflag; > +extern bool explicitansi; > + > +#define COLORFLAG_NEVER 0 > +#define COLORFLAG_AUTO 1 > +#define COLORFLAG_ALWAYS 2 > #endif > extern int termwidth; > > Modified: head/bin/ls/ls.1 > ============================================================================== > --- head/bin/ls/ls.1 Fri Aug 17 04:11:10 2018 (r337955) > +++ head/bin/ls/ls.1 Fri Aug 17 04:15:51 2018 (r337956) > @@ -32,7 +32,7 @@ > .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 > .\" $FreeBSD$ > .\" > -.Dd August 8, 2018 > +.Dd August 16, 2018 > .Dt LS 1 > .Os > .Sh NAME > @@ -41,6 +41,7 @@ > .Sh SYNOPSIS > .Nm > .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, > +.Op Fl -color Ns = Ns Ar when > .Op Fl D Ar format > .Op Ar > .Sh DESCRIPTION > @@ -210,6 +211,47 @@ This option is not defined in > .St -p1003.1-2001 . > .It Fl c > Use time when file status was last changed for sorting or printing. > +.It Fl -color Ns = Ns Ar when > +Output colored escape sequences based on > +.Ar when , > +which may be set to either > +.Cm always , > +.Cm auto > +(default), or > +.Cm never . > +.Pp > +.Cm always > +will make > +.Nm > +always output color. > +If > +.Ev TERM > +is unset or set to an invalid terminal, then > +.Nm > +will fall back to explicit > +.Tn ANSI > +escape sequences without the help of > +.Xr termcap 5 . > +.Cm always > +is the default if > +.Fl -color > +is specified without an argument. > +.Pp > +.Cm auto > +will make > +.Nm > +output escape sequences based on > +.Xr termcap 5 , > +but only if > +.Dv stdout > +is a tty and either the > +.Fl G > +flag is specified or the > +.Ev COLORTERM > +environment variable is set and not empty. > +.Pp > +.Cm never > +will disable color regardless of environment variables. > .It Fl d > Directories are listed as plain files (not searched recursively). > .It Fl f > @@ -620,7 +662,10 @@ Colorization > is silently disabled if the output is not directed to a terminal > unless the > .Ev CLICOLOR_FORCE > -variable is defined. > +variable is defined or > +.Fl -color > +is set to > +.Dq always . > .It Ev CLICOLOR_FORCE > Color sequences are normally disabled if the output is not directed to > a terminal. > > Modified: head/bin/ls/ls.c > ============================================================================== > --- head/bin/ls/ls.c Fri Aug 17 04:11:10 2018 (r337955) > +++ head/bin/ls/ls.c Fri Aug 17 04:15:51 2018 (r337956) > @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -99,6 +100,16 @@ static void display(const FTSENT *, FTSENT *, int); > static int mastercmp(const FTSENT * const *, const FTSENT * const *); > static void traverse(int, char **, int); > > +#define COLOR_OPT (CHAR_MAX + 1) > + > +static const struct option long_opts[] = > +{ > +#ifdef COLORLS > + {"color", optional_argument, NULL, COLOR_OPT}, > +#endif > + {NULL, no_argument, NULL, 0} > +}; > + > static void (*printfcn)(const DISPLAY *); > static int (*sortfcn)(const FTSENT *, const FTSENT *); > > @@ -140,10 +151,10 @@ static int f_stream; /* stream the output, separate w > static int f_timesort; /* sort by time vice name */ > int f_type; /* add type character for non-regular files */ > static int f_whiteout; /* show whiteout entries */ > - > #ifdef COLORLS > + int colorflag = COLORFLAG_AUTO; /* passed in colorflag */ > int f_color; /* add type in color for non-regular files */ > - > + bool explicitansi; /* Explicit ANSI sequences, no termcap(5) */ > char *ansi_bgcol; /* ANSI sequence to set background colour */ > char *ansi_fgcol; /* ANSI sequence to set foreground colour */ > char *ansi_coloff; /* ANSI sequence to reset colours */ > @@ -176,6 +187,19 @@ do_color_from_env(void) > (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))); > } > > +static bool > +do_color(void) > +{ > + > +#ifdef COLORLS > + if (colorflag == COLORFLAG_NEVER) > + return (false); > + else if (colorflag == COLORFLAG_ALWAYS) > + return (true); > +#endif > + return (do_color_from_env()); > +} > + > int > main(int argc, char *argv[]) > { > @@ -187,7 +211,7 @@ main(int argc, char *argv[]) > #ifdef COLORLS > char termcapbuf[1024]; /* termcap definition buffer */ > char tcapbuf[512]; /* capability buffer */ > - char *bp = tcapbuf; > + char *bp = tcapbuf, *term; > #endif > > (void)setlocale(LC_ALL, ""); > @@ -215,8 +239,9 @@ main(int argc, char *argv[]) > fts_options = FTS_PHYSICAL; > if (getenv("LS_SAMESORT")) > f_samesort = 1; > - while ((ch = getopt(argc, argv, > - "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { > + while ((ch = getopt_long(argc, argv, > + "+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts, > + NULL)) != -1) { > switch (ch) { > /* > * The -1, -C, -x and -l options all override each other so > @@ -379,6 +404,19 @@ main(int argc, char *argv[]) > case 'y': > f_samesort = 1; > break; > +#ifdef COLORLS > + case COLOR_OPT: > + if (optarg == NULL || strcmp(optarg, "always") == 0) > + colorflag = COLORFLAG_ALWAYS; > + else if (strcmp(optarg, "auto") == 0) > + colorflag = COLORFLAG_AUTO; > + else if (strcmp(optarg, "never") == 0) > + colorflag = COLORFLAG_NEVER; > + else > + errx(2, "unsupported --color value '%s' (must be always, auto, or never)", > + optarg); > + break; > +#endif > default: > case '?': > usage(); > @@ -391,10 +429,14 @@ main(int argc, char *argv[]) > if (!f_listdot && getuid() == (uid_t)0 && !f_noautodot) > f_listdot = 1; > > - /* Enabling of colours is conditional on the environment. */ > - if (do_color_from_env()) > + /* > + * Enabling of colours is conditional on the environment in conjunction > + * with the --color and -G arguments, if supplied. > + */ > + if (do_color()) { > #ifdef COLORLS > - if (tgetent(termcapbuf, getenv("TERM")) == 1) { > + if ((term = getenv("TERM")) != NULL && > + tgetent(termcapbuf, term) == 1) { > ansi_fgcol = tgetstr("AF", &bp); > ansi_bgcol = tgetstr("AB", &bp); > attrs_off = tgetstr("me", &bp); > @@ -408,10 +450,19 @@ main(int argc, char *argv[]) > ansi_coloff = tgetstr("oc", &bp); > if (ansi_fgcol && ansi_bgcol && ansi_coloff) > f_color = 1; > + } else if (colorflag == COLORFLAG_ALWAYS) { > + /* > + * If we're *always* doing color but we don't have > + * a functional TERM supplied, we'll fallback to > + * outputting raw ANSI sequences. > + */ > + f_color = 1; > + explicitansi = true; > } > #else > warnx("color support not compiled in"); > #endif /*COLORLS*/ > + } > > #ifdef COLORLS > if (f_color) { > > Modified: head/bin/ls/print.c > ============================================================================== > --- head/bin/ls/print.c Fri Aug 17 04:11:10 2018 (r337955) > +++ head/bin/ls/print.c Fri Aug 17 04:15:51 2018 (r337956) > @@ -73,6 +73,8 @@ static void printtime(time_t); > static int printtype(u_int); > static void printsize(size_t, off_t); > #ifdef COLORLS > +static void endcolor_termcap(int); > +static void endcolor_ansi(void); > static void endcolor(int); > static int colortype(mode_t); > #endif > @@ -540,7 +542,7 @@ writech(int c) > } > > static void > -printcolor(Colors c) > +printcolor_termcap(Colors c) > { > char *ansiseq; > > @@ -560,10 +562,53 @@ printcolor(Colors c) > } > > static void > -endcolor(int sig) > +printcolor_ansi(Colors c) > { > + > + printf("\033["); > + > + if (colors[c].bold) > + printf("1"); > + if (colors[c].num[0] != -1) > + printf(";3%d", colors[c].num[0]); > + if (colors[c].num[1] != -1) > + printf(";4%d", colors[c].num[1]); > + printf("m"); > +} > + > +static void > +printcolor(Colors c) > +{ > + > + if (explicitansi) > + printcolor_ansi(c); > + else > + printcolor_termcap(c); > +} > + > +static void > +endcolor_termcap(int sig) > +{ > + > tputs(ansi_coloff, 1, sig ? writech : putch); > tputs(attrs_off, 1, sig ? writech : putch); > +} > + > +static void > +endcolor_ansi(void) > +{ > + > + printf("\33[m"); > +} > + > +static void > +endcolor(int sig) > +{ > + > + if (explicitansi) > + endcolor_ansi(); > + else > + endcolor_termcap(sig); > } > > static int > > Modified: head/bin/ls/util.c > ============================================================================== > --- head/bin/ls/util.c Fri Aug 17 04:11:10 2018 (r337955) > +++ head/bin/ls/util.c Fri Aug 17 04:15:51 2018 (r337956) > @@ -227,7 +227,7 @@ usage(void) > { > (void)fprintf(stderr, > #ifdef COLORLS > - "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" > + "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [--color=when] [-D format]" > #else > "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" > #endif > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Aug 17 15:25: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 6FD0010722DC; Fri, 17 Aug 2018 15:25:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) (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 D0FB183480; Fri, 17 Aug 2018 15:25:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-x241.google.com with SMTP id q127-v6so6660733ljq.11; Fri, 17 Aug 2018 08:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=G4LW74zrJE7mlyLluMeRQpprUwyf2BIFJY8Z8EOB2PY=; b=rExdc22awBqLph+4WE2aq5bGgW49W1JwhPzmPxtAf8ILldVUB04nMvJdlQvhnjyw7+ Qna/oUbzFYXL2ybW7pqzl1gJg0+AIbxpaYRAr9EhbSAJe+r/NXN27wJOAj3xN3WpkO0D 13wX+rvfnIOY+o7lBj1Gk4DyYn9ARRgm6uHo7PWE2nWYQJzD8bX8edOYKYVghjFUN/o5 bUH7nA/6XitpkTKDcrJ/CaU1NWAmeb26+bGaMtMHGe+kIWVP0LGf1RPnWH5putEqU0W3 osjyDCfpX1gQe4+5a8LYGb0B5iADQ+k3DVHS0184TBblPEODHryhBOYr3daUclfmp1gA R6vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=G4LW74zrJE7mlyLluMeRQpprUwyf2BIFJY8Z8EOB2PY=; b=HJBipU7FRNXy4sJWZyj7i2mItF64gxXtiEEKQSg977wR/FQ0pdYlhahJ+F7Jh0AJX3 XwKJQH1JbE2Xp7cs0Wr9spb3828JJQhIIJyc9IsG7Bv/dE3VtYyvKL/BMNYpr8JzntvU YKHatvNVWtQNUQ6Bd3EcugUeFCwL7/JQkRqnwykwCTbpJi0zxITVrDwgaIsswimVH+Ua OnwJbjm4ru9wILXUhvWY6lKbS8Xx03t3+2fqBIv5bprAp5jC+j49kfAAJQxdOPgR4eyZ r7f7HnPuYM0jOJru4+THRLhwnpBxwF2URcpZEX6e1Sj7z/4pJV2hotO1YtleKn0TJBej qfZA== X-Gm-Message-State: AOUpUlGrq7OV4F4Cu1Zz09S0TMM8o2BjO7ug/bKM4grekrzZS0KQaj5j LlktQvJtzfHb3s5UcWdB/xQ6WLF2TuM4eTFwj+7t/A== X-Google-Smtp-Source: AA+uWPzkxBr9XzGA4iquz677SRNnRYMDSf1JhF6jhAJMpO5iCVfVYC0tPOfnDWZxZDmZF7gJn0N17t+elSToNIbj6Do= X-Received: by 2002:a2e:87da:: with SMTP id v26-v6mr23974673ljj.69.1534519533329; Fri, 17 Aug 2018 08:25:33 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 2002:ab3:7851:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 08:25:32 -0700 (PDT) In-Reply-To: References: <201808140754.w7E7sEFs018313@repo.freebsd.org> From: Alan Somers Date: Fri, 17 Aug 2018 09:25:32 -0600 X-Google-Sender-Auth: jFT0QTymParWI8yVFp_HGqIyfng Message-ID: Subject: Re: svn commit: r337736 - in head/sys: netinet netinet6 To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:25:35 -0000 On Fri, Aug 17, 2018 at 7:31 AM, Andrey V. Elsukov wrote: > On 16.08.2018 21:34, Alan Somers wrote: > > On Tue, Aug 14, 2018 at 1:54 AM, Andrey V. Elsukov > > wrote: > > > > Author: ae > > Date: Tue Aug 14 07:54:14 2018 > > New Revision: 337736 > > URL: https://svnweb.freebsd.org/changeset/base/337736 > > > > > > Log: > > Restore ability to send ICMP and ICMPv6 redirects. > > > > It was lost when tryforward appeared. Now ip[6]_tryforward will be > > enabled > > only when sending redirects for corresponding IP version is > > disabled via > > sysctl. Otherwise will be used default forwarding function. > > > > PR: 221137 > > > > This change broke the sys/netipsec/tunnel tests. I don't know if it's a > > limitation of the tests, or a genuine kernel bug, but I bisected the > > regression down to this change. Can you please fix it? > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/8630/ > testReport/sys.netipsec.tunnel/empty/v4/ > > I think it is because IPv4 tests use broadcast addresses in some places. > The attached patch fixes the test for me. > > -- > WBR, Andrey V. Elsukov > Hm, it certainly is weird to use broadcast addresses in this context. But why did that work before your commit and not after? From owner-svn-src-all@freebsd.org Fri Aug 17 15:26: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 05FC01072396; Fri, 17 Aug 2018 15:26:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEF3383610; Fri, 17 Aug 2018 15:26:32 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4C995278E6; Fri, 17 Aug 2018 15:26:32 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f178.google.com with SMTP id y17-v6so6663782ljy.8; Fri, 17 Aug 2018 08:26:32 -0700 (PDT) X-Gm-Message-State: AOUpUlGntqZI/uzACsj874Mwj7HR1ZnIBmoC6VAHpQYMe1Zgn7JkXySG dFQhl2VoQp8BJ8poMwFDu84a6aC1zDOmnblHzqI= X-Google-Smtp-Source: AA+uWPyJh2mNHnoRsXMU1PNCF7DVU9ys5G0HXPNxyuO6WFmMVQTOakEIRDhvMq64tXibzZfBK0Hrjwkgrlrdylj+UTo= X-Received: by 2002:a2e:144f:: with SMTP id 15-v6mr25839124lju.122.1534519590831; Fri, 17 Aug 2018 08:26:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 08:26:10 -0700 (PDT) In-Reply-To: <201808171524.w7HFOdQi059798@pdx.rh.CN85.dnsmgr.net> References: <201808170415.w7H4Fp7D046775@repo.freebsd.org> <201808171524.w7HFOdQi059798@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Fri, 17 Aug 2018 10:26:10 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337956 - in head: . bin/ls To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:26:33 -0000 On Fri, Aug 17, 2018 at 10:24 AM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: kevans >> Date: Fri Aug 17 04:15:51 2018 >> New Revision: 337956 >> URL: https://svnweb.freebsd.org/changeset/base/337956 >> >> Log: >> ls(1): Add --color=when >> >> --color may be set to one of: 'auto', 'always', and 'never'. >> >> 'auto' is the default behavior- output colors only if -G or COLORTERM are > > Why different than coreutils ls? Default for coreutils is none. I guess this was worded poorly and you skipped both the review and reading the diff... this is still contingent on environment variables or -G being specified. >> set, and only if stdout is a tty. >> >> 'always' is a new behavior- output colors always. termcap(5) will be >> consulted unless TERM is unset or not a recognized terminal, in which case >> ls(1) will fall back to explicitly outputting ANSI escape sequences. >> >> 'never' to turn off any environment variable and -G usage. > Why different than core utils? Coreutils uses none. I guess this was worded poorly and you skipped both the review and reading the diff... this is still contingent on environment variables or -G being specified. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Fri Aug 17 15:29: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 9C2FE10724F6; Fri, 17 Aug 2018 15:29:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C39A837DF; Fri, 17 Aug 2018 15:29:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C2821278E7; Fri, 17 Aug 2018 15:28:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f170.google.com with SMTP id u7-v6so6691398lji.3; Fri, 17 Aug 2018 08:28:59 -0700 (PDT) X-Gm-Message-State: AOUpUlFgqM1+jpFFDdMRwek8VRpGLDdt1TtF0Vr8pX04mDFpjAWsz/zL ozYx/1Apn6bDjC3EcEP40eSnggvcsZXt7WXA0t0= X-Google-Smtp-Source: AA+uWPzyYcFx674KlBojF5aoynp06qROf2QCry3dg+GGz62h3NMOUGcZa/bbGluvf/DA5yrYsvBq3Fd1bk87lF5bKHo= X-Received: by 2002:a2e:4055:: with SMTP id n82-v6mr22201257lja.99.1534519738281; Fri, 17 Aug 2018 08:28:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 08:28:37 -0700 (PDT) In-Reply-To: References: <201808170415.w7H4Fp7D046775@repo.freebsd.org> <201808171524.w7HFOdQi059798@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Fri, 17 Aug 2018 10:28:37 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337956 - in head: . bin/ls To: Kyle Evans Cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:29:00 -0000 On Fri, Aug 17, 2018 at 10:26 AM, Kyle Evans wrote: > On Fri, Aug 17, 2018 at 10:24 AM, Rodney W. Grimes > wrote: >> [ Charset UTF-8 unsupported, converting... ] >>> Author: kevans >>> Date: Fri Aug 17 04:15:51 2018 >>> New Revision: 337956 >>> URL: https://svnweb.freebsd.org/changeset/base/337956 >>> >>> Log: >>> ls(1): Add --color=when >>> >>> --color may be set to one of: 'auto', 'always', and 'never'. >>> >>> 'auto' is the default behavior- output colors only if -G or COLORTERM are >> >> Why different than coreutils ls? Default for coreutils is none. > > I guess this was worded poorly and you skipped both the review and > reading the diff... this is still contingent on environment variables > or -G being specified. > >>> set, and only if stdout is a tty. >>> >>> 'always' is a new behavior- output colors always. termcap(5) will be >>> consulted unless TERM is unset or not a recognized terminal, in which case >>> ls(1) will fall back to explicitly outputting ANSI escape sequences. >>> >>> 'never' to turn off any environment variable and -G usage. >> Why different than core utils? Coreutils uses none. > > I guess this was worded poorly and you skipped both the review and > reading the diff... this is still contingent on environment variables > or -G being specified. > ... copy-paste-o. The version of coreutils ls(1) that I have uses 'never' for this. There is no valid 'none' value. From owner-svn-src-all@freebsd.org Fri Aug 17 15:41:02 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 632391072D7E; Fri, 17 Aug 2018 15:41:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16FF983FFC; Fri, 17 Aug 2018 15:41:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB0612524; Fri, 17 Aug 2018 15:41:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HFf1LJ098548; Fri, 17 Aug 2018 15:41:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HFf13I098547; Fri, 17 Aug 2018 15:41:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808171541.w7HFf13I098547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 17 Aug 2018 15:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337974 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:41:02 -0000 Author: markj Date: Fri Aug 17 15:41:01 2018 New Revision: 337974 URL: https://svnweb.freebsd.org/changeset/base/337974 Log: Add INVARIANTS-only fences around lockless vnode refcount updates. Some internal KASSERTs access the v_iflag field without the vnode interlock held after such a refcount update. The fences are needed for the assertions to be correct in the face of store reordering. Reported and tested by: jhibbits Reviewed by: kib, mjg MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16756 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Aug 17 15:18:57 2018 (r337973) +++ head/sys/kern/vfs_subr.c Fri Aug 17 15:41:01 2018 (r337974) @@ -118,6 +118,22 @@ static void vnlru_return_batches(struct vfsops *mnt_op static void destroy_vpollinfo(struct vpollinfo *vi); /* + * These fences are intended for cases where some synchronization is + * needed between access of v_iflags and lockless vnode refcount (v_holdcnt + * and v_usecount) updates. Access to v_iflags is generally synchronized + * by the interlock, but we have some internal assertions that check vnode + * flags * without acquiring the lock. Thus, these fences are INVARIANTS-only + * for now. + */ +#ifdef INVARIANTS +#define VNODE_REFCOUNT_FENCE_ACQ() atomic_thread_fence_acq() +#define VNODE_REFCOUNT_FENCE_REL() atomic_thread_fence_rel() +#else +#define VNODE_REFCOUNT_FENCE_ACQ() +#define VNODE_REFCOUNT_FENCE_REL() +#endif + +/* * Number of vnodes in existence. Increased whenever getnewvnode() * allocates a new vnode, decreased in vdropl() for VI_DOOMED vnode. */ @@ -1018,6 +1034,7 @@ vnlru_free_locked(int count, struct vfsops *mnt_op) */ freevnodes--; vp->v_iflag &= ~VI_FREE; + VNODE_REFCOUNT_FENCE_REL(); refcount_acquire(&vp->v_holdcnt); mtx_unlock(&vnode_free_list_mtx); @@ -2495,6 +2512,7 @@ v_incr_usecount(struct vnode *vp) if (vp->v_type != VCHR && refcount_acquire_if_not_zero(&vp->v_usecount)) { + VNODE_REFCOUNT_FENCE_ACQ(); VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, ("vnode with usecount and VI_OWEINACT set")); } else { @@ -2593,6 +2611,7 @@ vget(struct vnode *vp, int flags, struct thread *td) } else { oweinact = 1; vp->v_iflag &= ~VI_OWEINACT; + VNODE_REFCOUNT_FENCE_REL(); } refcount_acquire(&vp->v_usecount); v_incr_devcount(vp); @@ -2807,6 +2826,7 @@ _vhold(struct vnode *vp, bool locked) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if (!locked) { if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) { + VNODE_REFCOUNT_FENCE_ACQ(); VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, ("_vhold: vnode with holdcnt is free")); return; From owner-svn-src-all@freebsd.org Fri Aug 17 15:48: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 D48CA10730BF; Fri, 17 Aug 2018 15:48:08 +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 45D99845AD; Fri, 17 Aug 2018 15:48:08 +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 w7HFm52L059917; Fri, 17 Aug 2018 08:48:05 -0700 (PDT) (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 w7HFm5xA059916; Fri, 17 Aug 2018 08:48:05 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808171548.w7HFm5xA059916@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337956 - in head: . bin/ls In-Reply-To: To: Kyle Evans Date: Fri, 17 Aug 2018 08:48:05 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:48:09 -0000 > On Fri, Aug 17, 2018 at 10:24 AM, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> Author: kevans > >> Date: Fri Aug 17 04:15:51 2018 > >> New Revision: 337956 > >> URL: https://svnweb.freebsd.org/changeset/base/337956 > >> > >> Log: > >> ls(1): Add --color=when > >> > >> --color may be set to one of: 'auto', 'always', and 'never'. > >> > >> 'auto' is the default behavior- output colors only if -G or COLORTERM are > > > > Why different than coreutils ls? Default for coreutils is none. > > I guess this was worded poorly and you skipped both the review and > reading the diff... this is still contingent on environment variables > or -G being specified. The review lasted for less time than I had to respond, it was also evolving with changes from 0mp and cem. I can not typically respond to any review in less than 24 hours, and usually need more like 48. > > >> set, and only if stdout is a tty. > >> > >> 'always' is a new behavior- output colors always. termcap(5) will be > >> consulted unless TERM is unset or not a recognized terminal, in which case > >> ls(1) will fall back to explicitly outputting ANSI escape sequences. > >> > >> 'never' to turn off any environment variable and -G usage. > > Why different than core utils? Coreutils uses none. > > I guess this was worded poorly and you skipped both the review and > reading the diff... this is still contingent on environment variables > or -G being specified. Is the word never or none? It looks prettyh clear to me in the diff: else if (strcmp(optarg, "never") == 0) 414 colorflag = COLORFLAG_NEVER; 415 else Let me repeat, coreutils ls uses color==none not color==never, the default in coreutils ls is color==none this is NOT depedent on any environment variables. Can we please bring our ls into conformance with: https://www.gnu.org/software/coreutils/manual/html_node/General-output-formatting.html in respect to how --color works? IMHO, doing anything different is a huge POLA issue. > Thanks, > Kyle Evans Thanks, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Aug 17 15:49: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 9FBC5107319F; Fri, 17 Aug 2018 15:49:42 +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 F22F98473D; Fri, 17 Aug 2018 15:49:41 +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 w7HFndLG059933; Fri, 17 Aug 2018 08:49:39 -0700 (PDT) (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 w7HFndsp059932; Fri, 17 Aug 2018 08:49:39 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808171549.w7HFndsp059932@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337956 - in head: . bin/ls In-Reply-To: To: Kyle Evans Date: Fri, 17 Aug 2018 08:49:39 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 15:49:42 -0000 > On Fri, Aug 17, 2018 at 10:26 AM, Kyle Evans wrote: > > On Fri, Aug 17, 2018 at 10:24 AM, Rodney W. Grimes > > wrote: > >> [ Charset UTF-8 unsupported, converting... ] > >>> Author: kevans > >>> Date: Fri Aug 17 04:15:51 2018 > >>> New Revision: 337956 > >>> URL: https://svnweb.freebsd.org/changeset/base/337956 > >>> > >>> Log: > >>> ls(1): Add --color=when > >>> > >>> --color may be set to one of: 'auto', 'always', and 'never'. > >>> > >>> 'auto' is the default behavior- output colors only if -G or COLORTERM are > >> > >> Why different than coreutils ls? Default for coreutils is none. > > > > I guess this was worded poorly and you skipped both the review and > > reading the diff... this is still contingent on environment variables > > or -G being specified. > > > >>> set, and only if stdout is a tty. > >>> > >>> 'always' is a new behavior- output colors always. termcap(5) will be > >>> consulted unless TERM is unset or not a recognized terminal, in which case > >>> ls(1) will fall back to explicitly outputting ANSI escape sequences. > >>> > >>> 'never' to turn off any environment variable and -G usage. > >> Why different than core utils? Coreutils uses none. > > > > I guess this was worded poorly and you skipped both the review and > > reading the diff... this is still contingent on environment variables > > or -G being specified. > > > > ... copy-paste-o. The version of coreutils ls(1) that I have uses > 'never' for this. There is no valid 'none' value. Oh boy, we need to investiage that then, cause it seems as if the official page says none. Does your say it has a different default value too? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Aug 17 16:01:41 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 E77781073889; Fri, 17 Aug 2018 16:01:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com [209.85.214.47]) (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 8A51084FC1; Fri, 17 Aug 2018 16:01:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f47.google.com with SMTP id d10-v6so11906201itj.5; Fri, 17 Aug 2018 09:01:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=j6WhRwLBc8OntFCtuSbgyC41CNs/HiuFhLw+nN1eerw=; b=qfiv4ZWlEtMl51x54lNZ5wgK3H6vpINJBTWId7zpq7YKYpby5VcF03zx4qHlpk04eK UTUBWy6iz2w+WkiYVfMSHsmtuseBkRLbYdUnM1T5rBAqUha8kZeIrfHAZMl4iwUAr5rZ T5maIv0w4cd4J047u85UC1g0fI3f1+B2mz0yhfZlhjnp+3lRaK+dUxd0AUU/3rMxe3hf s+3eitXu5iyQ+FV/Mma60Ga+kzxpW/NsD7D99Vm/wtfzJxbsNFEa+xhbnvJTeXxKZEuh 2FXloPT4TQjxfgcN6+Jwmm1ILhwxjwbDpKxwrkO1iWaPbbgzP7wu1C0y9l9QW60txAws cJPQ== X-Gm-Message-State: AOUpUlFLqcb/HLBNh7rOCxsvtnvJhDabAftXl3kNCl61r75LnEZDBiyD +GsxQJA4zNSVf+3Rwjlon5RXQa9t X-Google-Smtp-Source: AA+uWPzz/wHjkvQBcvpFK+BGC+TYlHFtgc68oXw/HnKYyQeVronwh5dvCTIpjGILRITIMhp+eailWg== X-Received: by 2002:a24:8a42:: with SMTP id v63-v6mr1971589itd.26.1534521693989; Fri, 17 Aug 2018 09:01:33 -0700 (PDT) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id c2-v6sm1003725iob.41.2018.08.17.09.01.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 09:01:33 -0700 (PDT) Received: by mail-it0-f49.google.com with SMTP id 72-v6so11922744itw.3; Fri, 17 Aug 2018 09:01:33 -0700 (PDT) X-Received: by 2002:a02:10c6:: with SMTP id 189-v6mr32057524jay.54.1534521693097; Fri, 17 Aug 2018 09:01:33 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:b472:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 09:01:32 -0700 (PDT) In-Reply-To: <6d1d2b23-978b-af1d-4022-16d09c9a42f5@yandex.ru> References: <201807180056.w6I0uPb6000705@repo.freebsd.org> <6d1d2b23-978b-af1d-4022-16d09c9a42f5@yandex.ru> From: Conrad Meyer Date: Fri, 17 Aug 2018 09:01:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r336439 - in head: share/man/man9 sys/crypto/aesni sys/crypto/armv8 sys/crypto/blake2 sys/crypto/ccp sys/crypto/via sys/dev/cesa sys/dev/cxgbe/crypto sys/dev/hifn sys/dev/safe sys/dev/s... To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:01:41 -0000 Please file a PR and we can track it there. The first suggestion that comes to mind is that the XFORMS_LOCK protects modification of the xforms list =E2=80=94 not the lifetime of obje= cts in it =E2=80=94 so drop the list lock over xf_init(). It does not appear t= hat xform_init can race with xform_detach with the lock dropped. xform_init is called only by key_setsaval, which is called in two places: key_newsav, and key_update. In key_newsav, it is used on sav's that are not yet linked in to a sah. In key_update, it is on larbal sav's only (i.e., linked in to savtree_larval list but not savtree_alive list). xform_detach -> key_delete_xform only enumerates over the sahtree looking for sah's with sav's present in savtree_alive with matching xform. Since neither key_newsav nor key_update insert the sav into the sah savtree_alive list until after setsaval -> xform_init, there is no race between xform_init and xform_detach (protected by SAHTREE_WLOCK). I think this patch may be safe, and would remove the OOM-induced deadlock condition: --- netipsec/key.c (revision 337955) +++ netipsec/key.c (working copy) @@ -8676,11 +8676,13 @@ XFORMS_LOCK(); LIST_FOREACH(entry, &xforms, chain) { if (entry->xf_type =3D=3D xftype) { + XFORMS_UNLOCK(); ret =3D (*entry->xf_init)(sav, entry); - break; + goto out; } } XFORMS_UNLOCK(); +out: return (ret); } Best, Conrad On Fri, Aug 17, 2018 at 6:01 AM, Andrey V. Elsukov wrot= e: > On 18.07.2018 03:56, Conrad Meyer wrote: >> Author: cem >> Date: Wed Jul 18 00:56:25 2018 >> New Revision: 336439 >> URL: https://svnweb.freebsd.org/changeset/base/336439 >> >> Log: >> OpenCrypto: Convert sessions to opaque handles instead of integers >> >> Track session objects in the framework, and pass handles between the >> framework (OCF), consumers, and drivers. Avoid redundancy and complex= ity in >> individual drivers by allocating session memory in the framework and >> providing it to drivers in ::newsession(). > > Hi, > > this produces WITNESS warning, since crypto_newsession() allocates > memory with M_WAITOK flag while xform_init() holds mutex: > > uma_zalloc_arg: zone "crypto_session" with the following non-sleepable > locks held: > exclusive sleep mutex xforms_list (IPsec transforms list) r =3D 0 > (0xffffffff81fdb840) locked @ > /home/devel/freebsd/base/head/sys/netipsec/key.c:8676 > stack backtrace: > #0 0xffffffff80c01643 at witness_debugger+0x73 > #1 0xffffffff80c02a21 at witness_warn+0x461 > #2 0xffffffff80ed98a8 at uma_zalloc_arg+0x38 > #3 0xffffffff80e4a0ca at crypto_newsession+0x1ea > #4 0xffffffff80e3994c at esp_init+0x37c > #5 0xffffffff80e31e68 at key_setsaval+0x7f8 > #6 0xffffffff80e307e2 at key_newsav+0x302 > #7 0xffffffff80e2ba0d at key_add+0x53d > #8 0xffffffff80e263f5 at key_parse+0xac5 > #9 0xffffffff80c34dc7 at sosend_generic+0x447 > #10 0xffffffff80c34ffd at sosend+0x6d > #11 0xffffffff80c3c170 at kern_sendit+0x240 > #12 0xffffffff80c3c4be at sendit+0x19e > #13 0xffffffff80c3c30d at sys_sendto+0x4d > #14 0xffffffff8107e9c1 at amd64_syscall+0x281 > #15 0xffffffff8105846d at fast_syscall_common+0x101 > > -- > WBR, Andrey V. Elsukov > From owner-svn-src-all@freebsd.org Fri Aug 17 16:01: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 0B56010738AD; Fri, 17 Aug 2018 16:01:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 A5A9C85105; Fri, 17 Aug 2018 16:01:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from dhcp-10-248-112-19.eduroam.wireless.private.cam.ac.uk (global-5-143.nat-2.net.cam.ac.uk [131.111.5.143]) by mail.baldwin.cx (Postfix) with ESMTPSA id 7984B10AFCD; Fri, 17 Aug 2018 12:01:48 -0400 (EDT) Subject: Re: svn commit: r337944 - head/sys/arm/conf To: Ian Lepore , Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808170104.w7H142P8048034@repo.freebsd.org> <1534517617.27158.11.camel@freebsd.org> From: John Baldwin Message-ID: <3cc50b11-5670-9cc1-fcf8-840e407995b4@FreeBSD.org> Date: Fri, 17 Aug 2018 17:01:47 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1534517617.27158.11.camel@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); Fri, 17 Aug 2018 12:01:49 -0400 (EDT) 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.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:01:57 -0000 On 8/17/18 3:53 PM, Ian Lepore wrote: > On Fri, 2018-08-17 at 01:04 +0000, Conrad Meyer wrote: >> Author: cem >> Date: Fri Aug 17 01:04:02 2018 >> New Revision: 337944 >> URL: https://svnweb.freebsd.org/changeset/base/337944 >> >> Log: >>   arm: Define crypto option on platforms that include IPsec >>    >>   Missed in r337940. >>    >>   (It's not like there are any crypto files IPsec doesn't pull in, so it is >>   unclear what not defining the crypto option was supposed to achieve.) >>    >>   Reported by: np@ >> >> Modified: >>   head/sys/arm/conf/std.armv6 >>   head/sys/arm/conf/std.armv7 >> >> Modified: head/sys/arm/conf/std.armv6 >> ============================================================================== >> --- head/sys/arm/conf/std.armv6 Fri Aug 17 01:03:23 2018 (r337943) >> +++ head/sys/arm/conf/std.armv6 Fri Aug 17 01:04:02 2018 (r337944) >> @@ -9,6 +9,7 @@ options  VIMAGE # Subsystem virtualization, e.g. VNE >>  options  INET # InterNETworking >>  options  INET6 # IPv6 communications protocols >>  options  TCP_HHOOK # hhook(9) framework for TCP >> +device crypto # IPSec && !crypto is nonsensical >>  options  IPSEC # IP (v4/v6) security >>  options  SCTP # Stream Control Transmission Protocol >>  options  FFS # Berkeley Fast Filesystem >> >> Modified: head/sys/arm/conf/std.armv7 >> ============================================================================== >> --- head/sys/arm/conf/std.armv7 Fri Aug 17 01:03:23 2018 (r337943) >> +++ head/sys/arm/conf/std.armv7 Fri Aug 17 01:04:02 2018 (r337944) >> @@ -9,6 +9,7 @@ options  VIMAGE # Subsystem virtualization, e.g. VNE >>  options  INET # InterNETworking >>  options  INET6 # IPv6 communications protocols >>  options  TCP_HHOOK # hhook(9) framework for TCP >> +device crypto # IPSec && !crypto is nonsensical >>  options  IPSEC # IP (v4/v6) security >>  options  SCTP # Stream Control Transmission Protocol >>  options  FFS # Berkeley Fast Filesystem >> > > What problem were you trying to solve with this change? Aside from > putting a device statement into a file that, by design, only contains > options, and besides adding it with a snarky comment rather than the > canononical comment associated with that device from sys/conf/NOTES, I > can't see offhand how this changes anything. Virtually everything that > is dependent on the crypto device is actually specified as crypto | > ipsec | ipsec_support, which seems like the correct way to implement > "option IPSEC implies device crypto". In other kernel config files we include crypto explicitly, but with a less snarky comment (and in the device section), e.g. amd64's GENERIC: # The crypto framework is required by IPSEC device crypto # Required by IPSEC That said, I think it would be better to instead move this up into the existing list of pseudo devices that includes 'device ether', etc. I've put a strawman up at https://reviews.freebsd.org/D16775 -- John Baldwin From owner-svn-src-all@freebsd.org Fri Aug 17 16:04: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 B2B411073A22; Fri, 17 Aug 2018 16:04: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65F6585462; Fri, 17 Aug 2018 16:04: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 4702E2A19; Fri, 17 Aug 2018 16:04: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 w7HG4Lm9009800; Fri, 17 Aug 2018 16:04:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HG4KKC009797; Fri, 17 Aug 2018 16:04:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808171604.w7HG4KKC009797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 17 Aug 2018 16:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337975 - in stable/11/sys: kern sys X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: kern sys X-SVN-Commit-Revision: 337975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:04:21 -0000 Author: markj Date: Fri Aug 17 16:04:20 2018 New Revision: 337975 URL: https://svnweb.freebsd.org/changeset/base/337975 Log: MFC r337328: Don't check rcv sockbuf limits when sending on a unix stream socket. PR: 181741, 212812 Modified: stable/11/sys/kern/uipc_sockbuf.c stable/11/sys/kern/uipc_usrreq.c stable/11/sys/sys/sockbuf.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/11/sys/kern/uipc_sockbuf.c Fri Aug 17 15:41:01 2018 (r337974) +++ stable/11/sys/kern/uipc_sockbuf.c Fri Aug 17 16:04:20 2018 (r337975) @@ -888,21 +888,14 @@ sbappendaddr(struct sockbuf *sb, const struct sockaddr return (retval); } -int +void sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0, struct mbuf *control) { - struct mbuf *m, *n, *mlast; - int space; + struct mbuf *m, *mlast; - SOCKBUF_LOCK_ASSERT(sb); - - space = m_length(control, &n) + m_length(m0, NULL); - - if (space > sbspace(sb)) - return (0); m_clrprotoflags(m0); - n->m_next = m0; /* concatenate data to control */ + m_last(control)->m_next = m0; SBLASTRECORDCHK(sb); @@ -916,18 +909,15 @@ sbappendcontrol_locked(struct sockbuf *sb, struct mbuf SBLASTMBUFCHK(sb); SBLASTRECORDCHK(sb); - return (1); } -int +void sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, struct mbuf *control) { - int retval; SOCKBUF_LOCK(sb); - retval = sbappendcontrol_locked(sb, m0, control); + sbappendcontrol_locked(sb, m0, control); SOCKBUF_UNLOCK(sb); - return (retval); } /* Modified: stable/11/sys/kern/uipc_usrreq.c ============================================================================== --- stable/11/sys/kern/uipc_usrreq.c Fri Aug 17 15:41:01 2018 (r337974) +++ stable/11/sys/kern/uipc_usrreq.c Fri Aug 17 16:04:20 2018 (r337975) @@ -981,16 +981,22 @@ uipc_send(struct socket *so, int flags, struct mbuf *m unp2->unp_flags &= ~UNP_WANTCRED; control = unp_addsockcred(td, control); } + /* - * Send to paired receive port, and then reduce send buffer - * hiwater marks to maintain backpressure. Wake up readers. + * Send to paired receive port and wake up readers. Don't + * check for space available in the receive buffer if we're + * attaching ancillary data; Unix domain sockets only check + * for space in the sending sockbuf, and that check is + * performed one level up the stack. At that level we cannot + * precisely account for the amount of buffer space used + * (e.g., because control messages are not yet internalized). */ switch (so->so_type) { case SOCK_STREAM: if (control != NULL) { - if (sbappendcontrol_locked(&so2->so_rcv, m, - control)) - control = NULL; + sbappendcontrol_locked(&so2->so_rcv, m, + control); + control = NULL; } else sbappend_locked(&so2->so_rcv, m, flags); break; @@ -999,14 +1005,8 @@ uipc_send(struct socket *so, int flags, struct mbuf *m const struct sockaddr *from; from = &sun_noname; - /* - * Don't check for space available in so2->so_rcv. - * Unix domain sockets only check for space in the - * sending sockbuf, and that check is performed one - * level up the stack. - */ if (sbappendaddr_nospacecheck_locked(&so2->so_rcv, - from, m, control)) + from, m, control)) control = NULL; break; } Modified: stable/11/sys/sys/sockbuf.h ============================================================================== --- stable/11/sys/sys/sockbuf.h Fri Aug 17 15:41:01 2018 (r337974) +++ stable/11/sys/sys/sockbuf.h Fri Aug 17 16:04:20 2018 (r337975) @@ -146,9 +146,9 @@ int sbappendaddr_locked(struct sockbuf *sb, const stru struct mbuf *m0, struct mbuf *control); int sbappendaddr_nospacecheck_locked(struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control); -int sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, +void sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, struct mbuf *control); -int sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0, +void sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0, struct mbuf *control); void sbappendrecord(struct sockbuf *sb, struct mbuf *m0); void sbappendrecord_locked(struct sockbuf *sb, struct mbuf *m0); From owner-svn-src-all@freebsd.org Fri Aug 17 16:04: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 43DE01073A71; Fri, 17 Aug 2018 16:04:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com [209.85.223.177]) (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 D4D098573E; Fri, 17 Aug 2018 16:04:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f177.google.com with SMTP id l7-v6so7299877iok.6; Fri, 17 Aug 2018 09:04:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=eQ6D8Mo+PaSdzMK2elaaNYiKoFndagbsKqFXRe9tq6Q=; b=O4PeBL0JX9HjGvWCkeF73Fm2uOzRKR7tivgyzu8F+z9lf8TJQoyQQDuyA5YopITaaD unedrtMCZB+pwmuJTY3cHsM2CTBVlRQ5p6fl+H2buO4xT0wS1a8VIzUIWSeaLjkWoOn4 foum0uHMm2RGntoNBwvZofd7OQp5AAtEzDil+D+upJ51v6lD8jSNovdkKANCxvJLLSPx th3R/1txUst2iNvP+LXAjnwl71qkODOvOh/8lbQLP33cUMSLSZDLCJUd5fUZSAJretvQ gM6iCQJIYAYRI2OK36ejlx3MHFYEWGw2yy8b70xAVkY1QfVTlCUyshWBSa8FuAAwEjRM gfLg== X-Gm-Message-State: AOUpUlFzZ0GgVG6w3lkfSQvlcQvevTPJWHf+4QgE+iQWK1rPynOmwbg6 LXSzc2byq7+giW9pIb2tkT4bNszu X-Google-Smtp-Source: AA+uWPxE6b1TvjUhyGRynJxSdNVsPFjZSjQM7rHN04Sipu42N3WEwcitDsuDxr76S1FDUuAhtDPG5A== X-Received: by 2002:a6b:9415:: with SMTP id w21-v6mr31574500iod.290.1534521889866; Fri, 17 Aug 2018 09:04:49 -0700 (PDT) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id t187-v6sm2154403ita.28.2018.08.17.09.04.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 09:04:49 -0700 (PDT) Received: by mail-it0-f48.google.com with SMTP id j81-v6so11939692ite.0; Fri, 17 Aug 2018 09:04:49 -0700 (PDT) X-Received: by 2002:a24:715:: with SMTP id f21-v6mr24918866itf.92.1534521889397; Fri, 17 Aug 2018 09:04:49 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:b472:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 09:04:48 -0700 (PDT) In-Reply-To: <201808170503.w7H53GR9023607@slippy.cwsent.com> References: <201808170023.w7H0Np0H027296@repo.freebsd.org> <201808170503.w7H53GR9023607@slippy.cwsent.com> From: Conrad Meyer Date: Fri, 17 Aug 2018 09:04:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... To: Cy Schubert Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:04:57 -0000 On Thu, Aug 16, 2018 at 10:03 PM, Cy Schubert wrote: > In message <201808170023.w7H0Np0H027296@repo.freebsd.org>, Conrad Meyer > writes: >> Author: cem >> Date: Fri Aug 17 00:23:50 2018 >> New Revision: 337936 >> URL: https://svnweb.freebsd.org/changeset/base/337936 >> >> Log: >> Bring in libsodium to sys/contrib >> ... > > Why wasn't this imported into vendor-sys first? Especially if we intend > on tailoring it over time. We don't intent on tailoring it at all. (P.S., if you are going to bottom-post, please trim unnecessary context.) Best, Conrad From owner-svn-src-all@freebsd.org Fri Aug 17 16:05: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 873CA1073AAA; Fri, 17 Aug 2018 16:05:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C45985758; Fri, 17 Aug 2018 16:05:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B9C62A1D; Fri, 17 Aug 2018 16:05:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HG4xCV009909; Fri, 17 Aug 2018 16:04:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HG4xRN009908; Fri, 17 Aug 2018 16:04:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808171604.w7HG4xRN009908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 17 Aug 2018 16:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337976 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 337976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:05:00 -0000 Author: markj Date: Fri Aug 17 16:04:59 2018 New Revision: 337976 URL: https://svnweb.freebsd.org/changeset/base/337976 Log: MFC r337230: Verify that each frame pointer lies within the thread's kstack. Modified: stable/11/sys/x86/x86/stack_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/stack_machdep.c ============================================================================== --- stable/11/sys/x86/x86/stack_machdep.c Fri Aug 17 16:04:20 2018 (r337975) +++ stable/11/sys/x86/x86/stack_machdep.c Fri Aug 17 16:04:59 2018 (r337976) @@ -82,16 +82,16 @@ stack_capture(struct thread *td, struct stack *st, reg stack_zero(st); frame = (x86_frame_t)fp; while (1) { - if (!INKERNEL((long)frame)) + if ((vm_offset_t)frame < td->td_kstack || + (vm_offset_t)frame >= td->td_kstack + + td->td_kstack_pages * PAGE_SIZE) break; callpc = frame->f_retaddr; if (!INKERNEL(callpc)) break; if (stack_put(st, callpc) == -1) break; - if (frame->f_frame <= frame || - (vm_offset_t)frame->f_frame >= td->td_kstack + - td->td_kstack_pages * PAGE_SIZE) + if (frame->f_frame <= frame) break; frame = frame->f_frame; } @@ -106,7 +106,7 @@ stack_nmi_handler(struct trapframe *tf) if (nmi_stack == NULL || curthread != nmi_pending) return (0); - if (INKERNEL(TF_PC(tf)) && (TF_FLAGS(tf) & PSL_I) != 0) + if (!TRAPF_USERMODE(tf) && (TF_FLAGS(tf) & PSL_I) != 0) stack_capture(curthread, nmi_stack, TF_FP(tf)); else /* We were running in usermode or had interrupts disabled. */ From owner-svn-src-all@freebsd.org Fri Aug 17 16:07: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 914781073CD7; Fri, 17 Aug 2018 16:07:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48AA885B7E; Fri, 17 Aug 2018 16:07: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 29DA02A25; Fri, 17 Aug 2018 16:07: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 w7HG77Yg010054; Fri, 17 Aug 2018 16:07:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HG77I8010053; Fri, 17 Aug 2018 16:07:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808171607.w7HG77I8010053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 17 Aug 2018 16:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337977 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:07:07 -0000 Author: markj Date: Fri Aug 17 16:07:06 2018 New Revision: 337977 URL: https://svnweb.freebsd.org/changeset/base/337977 Log: Typo. X-MFC with: r337974 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Aug 17 16:04:59 2018 (r337976) +++ head/sys/kern/vfs_subr.c Fri Aug 17 16:07:06 2018 (r337977) @@ -122,7 +122,7 @@ static void destroy_vpollinfo(struct vpollinfo *vi); * needed between access of v_iflags and lockless vnode refcount (v_holdcnt * and v_usecount) updates. Access to v_iflags is generally synchronized * by the interlock, but we have some internal assertions that check vnode - * flags * without acquiring the lock. Thus, these fences are INVARIANTS-only + * flags without acquiring the lock. Thus, these fences are INVARIANTS-only * for now. */ #ifdef INVARIANTS From owner-svn-src-all@freebsd.org Fri Aug 17 16:08: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 C779E1073EB7; Fri, 17 Aug 2018 16:08:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (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 4257485E8D; Fri, 17 Aug 2018 16:08:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x243.google.com with SMTP id a4-v6so423406plm.13; Fri, 17 Aug 2018 09:08:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dNw0F6CpOOO0XNG34khiFP1LvuXu2vk+jeahS8J4MFI=; b=IabKL996A/3kAF31EnBuKXO1neaDQnRH5a/d4/cQJDzyd09+KekmWHmRxj5QDhn7Dm AquSngpBmFylJ71SjOXVsu0b8GXQRs5dIFMvIkyz9kveIol4dv2zXbmgnJCFS+xAF3Kw e2LGjuWBHyAOwghViHPDiSwk5XlgTDg/+PinCzkw3uJ0a4ZqPjQcA1mYWsQcAXkbdiNy VL99tYARUbLc+Ut/+g5WPLvC/6z3haB9d7OTBL1/Q7M8P8yKfum7akRQWYJ8NPaevM05 wUqu6yYql2tGDIVMfDPazuqrLw63GqeUQr8YfNzK4zRoRJtPHmyYgdXSxsNJG0o8nm+H 1gDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=dNw0F6CpOOO0XNG34khiFP1LvuXu2vk+jeahS8J4MFI=; b=b8ZrygiIM2sceF8l9qWZighJolvkg++z/mnFmzqk1/T6UWIFxuZ2sdmCvF2erp1fZT OQGqdTkHevku1XwYI85LnbUGaby0TA1gYXJgkbUxe5ahGwPac6ZeSbGQWq94mezi46ef eu+HM7ue8179XhPN9iGGcou7tXlsJjtaJ/8RfR4D70GZ+qrvMKFb9cw4tXI12fRxFLBX t3AN5sfO/eq8ywh6FwXV5MGA+oFQxlIXrSdxn9iPuIShnK3kDVdnbqqn5z4omm8C51Pf DTMpFN92GBLPZBPQEW0rA2YAYfKVap1CW3VevbyIdFx1zhwAYVsRr/ZQpEHboMGO4jC1 VMhQ== X-Gm-Message-State: AOUpUlGmgOkjPvBJvbCIuX1nwO+a9SR6ePmoAw9Mh90Wj5wn9fVIIdKI dB2CT/JkSpmE+mJqD1JY8br3f4SY X-Google-Smtp-Source: AA+uWPzwxk18GiDfmZOAwdBfoOpnGPd95JZDOWsX5OTn/tvlSoR40cx20o/hJUf0c3pV0W0Mg663eQ== X-Received: by 2002:a17:902:6b05:: with SMTP id o5-v6mr34022704plk.338.1534522107017; Fri, 17 Aug 2018 09:08:27 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id 1-v6sm5577243pfk.134.2018.08.17.09.08.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 09:08:26 -0700 (PDT) Sender: Mark Johnston Date: Fri, 17 Aug 2018 12:08:20 -0400 From: Mark Johnston To: Bryan Drewery Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334708 - head/sys/kern Message-ID: <20180817160820.GA13168@raichu> References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> <20180608173755.GJ2450@kib.kiev.ua> <20180608183010.GC65388@pesky> <20180608183732.GK2450@kib.kiev.ua> <0b128417-7107-5090-e65a-afa94fd1aed6@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b128417-7107-5090-e65a-afa94fd1aed6@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:08:29 -0000 On Thu, Jul 19, 2018 at 12:09:21PM -0700, Bryan Drewery wrote: > Did this issue get resolved? It's fixed by r337974. > On 6/8/2018 11:37 AM, Konstantin Belousov wrote: > > On Fri, Jun 08, 2018 at 02:30:10PM -0400, Mark Johnston wrote: > >> On Fri, Jun 08, 2018 at 08:37:55PM +0300, Konstantin Belousov wrote: > >>> On Thu, Jun 07, 2018 at 11:02:29PM -0700, Ryan Libby wrote: > >>>> On Thu, Jun 7, 2018 at 10:03 PM, Mateusz Guzik wrote: > >>>>> Checking it without any locks is perfectly valid in this case. It is done > >>>>> after v_holdcnt gets bumped from a non-zero value. So at that time it > >>>>> is at least two. Of course that result is stale as an arbitrary number of > >>>>> other threads could have bumped and dropped the ref past that point. > >>>>> The minimum value is 1 since we hold the ref. But this means the > >>>>> vnode must not be on the free list and that's what the assertion is > >>>>> verifying. > >>>>> > >>>>> The problem is indeed lack of ordering against the code clearing the > >>>>> flag for the case where 2 threads to vhold and one does the 0->1 > >>>>> transition. > >>>>> > >>>>> That said, the fence is required for the assertion to work. > >>>>> > >>>> > >>>> Yeah, I agree with this logic. What I mean is that reordering between > >>>> v_holdcnt 0->1 and v_iflag is normally settled by the release and > >>>> acquisition of the vnode interlock, which we are supposed to hold for > >>>> v_*i*flag. A quick scan seems to show all of the checks of VI_FREE that > >>>> are not asserts do hold the vnode interlock. So, I'm just saying that I > >>>> don't think the possible reordering affects them. > >>> But do we know that only VI_FREE checks are affected ? > >>> > >>> My concern is that users of _vhold() rely on seeing up to date state of the > >>> vnode, and VI_FREE is only an example of the problem. Most likely, the > >>> code which fetched the vnode pointer before _vhold() call, should guarantee > >>> visibility. > >> > >> Wouldn't this be a problem only if we permit lockless accesses of vnode > >> state outside of _vhold() and other vnode subroutines? The current > >> protocol requires that the interlock be held, and this synchronizes with > >> code which performs 0->1 and 1->0 transitions of the hold count. If this > >> requirement is relaxed in the future, then fences would indeed be > >> needed. > > > > I do not claim that my concern is a real problem. I stated it as a > > thing to look at when deciding whether the fences should be added > > (unconditionally ?). > > > > If you argument is that the only current lock-less protocol for the > > struct vnode state is the v_holdcnt transitions for > 1, then I can > > agree with it. > > > > > -- > Regards, > Bryan Drewery > From owner-svn-src-all@freebsd.org Fri Aug 17 16:11:20 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 045B01074031; Fri, 17 Aug 2018 16:11:20 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (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 8A0DA8613F; Fri, 17 Aug 2018 16:11:19 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it0-x234.google.com with SMTP id d9-v6so11972385itf.2; Fri, 17 Aug 2018 09:11:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U+e70Y/AP7AyYvmE3BrA52dIUGIBFEUCjzdn68NGifY=; b=OpdRcBxdm1eNj6Uu6+ej4nq/zPXYQ9bnFtyzwylC5yjPM1s2sgvE0x5syoF7peyKkI 3w+3XMAfGRZH0f+wFayhU8rXibbeVqnYe+iuPIkTHKYNAa+wGPBy/OPRH0ujgtmjxUio N+4TYZYn5TaeDcv98bOeLFx2QceoidEgWceA6BODMIp3QrWaUlJJFQgMAQRL7p/CA4vy HbD7oEa1Mx0m1OKN4b5kBiEIFtyQs9VTah9Pz7xcit8ehb6GDVf7Wg1bQ5hOD5g0iV8T Z2eQvln2/u8Cs2y1b5+/aKfi/cmCR3MEUigPg/pBDbHxJ18lc4LW+ibeP0CBnEZYVH28 vy/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U+e70Y/AP7AyYvmE3BrA52dIUGIBFEUCjzdn68NGifY=; b=VpBVMC95LWG+YtQ2O8kiXVx2daesAKKPfcEBuSFHzDvdJZZVP6tExHc58LrdxpNLDr jZoWKoFt5/ha67MSjCxQZCdAlMHd5gc15mGTOvYBTpCowaJnCPXhxwyrcLCVX6066yHo 5iKmuLd3ZWbB2w1z4sAJM9umlF/Utzcr27k0IvFx2Zof/tzbpwQD+qDsEagajO6ABVnK 4Agz7wpKEKLOLPnAVYMA6LWrwnuXl01X2M1rNOn8ZqiElDHJgf++KOTQcpWd7SVi2eN3 2gFO051T3oYDEeKZ6rTUB9m0DlgDpK6TkdpAzr0vWfR58UrUpjimMtaIa43TGr7KaQ64 03yQ== X-Gm-Message-State: AOUpUlGx+tf6pGgWNTpOB1xx85yEVkwoB5MdHu9zHDfcYaSVWGlPFfU5 AoFxYLIkDxKsZslhIZKwmtSM+0uHRGPm2A== X-Google-Smtp-Source: AA+uWPywJWwYV55C6qDqJL7HRPKaKOWUil1v5tbh3c2PTwb3VWT6y/QMok3tOymANgHe0bL89XElMA== X-Received: by 2002:a24:8787:: with SMTP id f129-v6mr21339845ite.33.1534522278507; Fri, 17 Aug 2018 09:11:18 -0700 (PDT) Received: from ralga.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id o22-v6sm799903iob.20.2018.08.17.09.11.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Aug 2018 09:11:18 -0700 (PDT) Date: Fri, 17 Aug 2018 11:11:14 -0500 From: Justin Hibbits To: Mark Johnston Cc: Bryan Drewery , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334708 - head/sys/kern Message-ID: <20180817111114.7da9ec9f@ralga.knownspace> In-Reply-To: <20180817160820.GA13168@raichu> References: <201806061257.w56CvCwq089369@repo.freebsd.org> <20180606140311.GU2450@kib.kiev.ua> <20180608033242.GA54099@pesky> <20180608173755.GJ2450@kib.kiev.ua> <20180608183010.GC65388@pesky> <20180608183732.GK2450@kib.kiev.ua> <0b128417-7107-5090-e65a-afa94fd1aed6@FreeBSD.org> <20180817160820.GA13168@raichu> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; powerpc64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:11:20 -0000 On Fri, 17 Aug 2018 12:08:20 -0400 Mark Johnston wrote: > On Thu, Jul 19, 2018 at 12:09:21PM -0700, Bryan Drewery wrote: > > Did this issue get resolved? > > It's fixed by r337974. Thanks Mark! - Justin From owner-svn-src-all@freebsd.org Fri Aug 17 16:12: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 488B01074207 for ; Fri, 17 Aug 2018 16:12:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (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 D0A158647C for ; Fri, 17 Aug 2018 16:12:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22b.google.com with SMTP id d70-v6so1949137ith.1 for ; Fri, 17 Aug 2018 09:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TAVx+/72HhHOJ5Rnkmcf5SYRDzTTqXXUMrLwRJXgmdY=; b=lVQRZutzYIDWHyPnRcTgKNU8AGmgTgGuZwxDyOLxvieCGzdVtDP5xvTeYL0kt2/36k LjCVloSufROWnluaPF7dBwiEl0vEsYMvSmP/ZjBkPfQF69xelxkIWudvKFMFd4IwlJoN G5/grLZ+iagaWQPAkvSheR1gBRY/yD+eM2Pu7xFioYfgXgNFRpZS7spcfY+lNWHHIK2+ cj2UVFGHBanhk6Tc4ZdmaEYUXp1Au8hoaXgNGchJ4W8PmHDhBPLIG9kHZNcpQUK4iHQO OZvr1FJ3ZXlXzRw0IDKeInISExAD3MxNNbXDkFhGnCa4/BtX+Em7Q2WUmlSzrzbEoKg2 ZX0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TAVx+/72HhHOJ5Rnkmcf5SYRDzTTqXXUMrLwRJXgmdY=; b=NuK50GNDv8q1oTbg94a2eFuEUPzZuP9tphZYhmBkPBfVqmOhAdOQL9yHOB4On6XBm0 Nz7KkH7E7l2cB8He1VSWdVL4fXipSScC6Z6hYiSJix7rb08jinmgrJE6ryOKKCPAA7Vw S0s7daRAH89xNsR6C3i8wOgNpm3PGfnzVfmLD917bGqPw7R50sFu+nXzYUilDYcYEGxg aIQZEliMlOLQw8393XqeqZiS/waVdKBxEAuq6GXaH+5q4OBqy9adZf/jeuhN/A1ZaSIl y3kEJjXdDAs9gWtvW7c1Ty3bhCn2elddlUscKg42ZiYQHpQ9L/x+LOanKMfO0L/VOIH9 EeUw== X-Gm-Message-State: AOUpUlHlEZeDS0RYtqJiGwgrf+SLLawRp8j+vC8x3btz0QAg7WV1A9uG eC5ixQHpKtBq/U4hUvNSJ8y+b1KPYZzkMjA48su0rg== X-Google-Smtp-Source: AA+uWPyEU3272QtyO569xHwdYaPeG7Cufjc1AwfmutVKBAS/0b3vT0lVW8G5uOEn/NsoWIRQ8QZWWrVL9fm9QRLbwho= X-Received: by 2002:a24:d2:: with SMTP id 201-v6mr4862721ita.60.1534522361152; Fri, 17 Aug 2018 09:12:41 -0700 (PDT) MIME-Version: 1.0 References: <201808170023.w7H0Np0H027296@repo.freebsd.org> <201808170503.w7H53GR9023607@slippy.cwsent.com> In-Reply-To: From: Warner Losh Date: Fri, 17 Aug 2018 10:12:30 -0600 Message-ID: Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... To: "Conrad E. Meyer" Cc: Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:12:42 -0000 On Fri, Aug 17, 2018, 10:05 AM Conrad Meyer wrote: > On Thu, Aug 16, 2018 at 10:03 PM, Cy Schubert > wrote: > > In message <201808170023.w7H0Np0H027296@repo.freebsd.org>, Conrad Meyer > > writes: > >> Author: cem > >> Date: Fri Aug 17 00:23:50 2018 > >> New Revision: 337936 > >> URL: https://svnweb.freebsd.org/changeset/base/337936 > >> > >> Log: > >> Bring in libsodium to sys/contrib > >> ... > > > > Why wasn't this imported into vendor-sys first? Especially if we intend > > on tailoring it over time. > > We don't intent on tailoring it at all. > We don't document such an exception... history tells me this belief may be optimistic.. Warner > From owner-svn-src-all@freebsd.org Fri Aug 17 16:13: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 C695A1074234; Fri, 17 Aug 2018 16:13:03 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (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 6993F865AB; Fri, 17 Aug 2018 16:13:03 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f53.google.com with SMTP id 72-v6so11975810itw.3; Fri, 17 Aug 2018 09:13:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=VLkhEGUVPz15PQNZQ+mGWWZeaKaxZt6lwOQtBi6DSXM=; b=luqQHstXxopJjNhD4V7mKQSqIUe9a8Ec1wQwgtafgfdrMdml+vzRC+Y6iYWv0YEMln h6YoocWojH02IaaOeyf7ErlTLXWSZgOo0x30qWY1v8PpYNr2YF7R67WBuV3ZMzK1mHeI l1rQ68VLbvg9mnK3RcPzEg3NNul9lu9Y/m3IXqLNNRun0+XOWxtHnYnRPtXvlWTs6cc0 +NTE8rU4YiwjIB0/VA4jbXCr6U6O9laBtNWA5F+6MaCYMrZ3fVm+664dTQqfMvTPfW/5 3L2zIiL3Sg21gMtcZPPl38M+6WMQrQqCpIMzwSRu8Ko1PAoBiRhqFqNPe8klnsSlo4ub K+xg== X-Gm-Message-State: AOUpUlFP9NX+iUmFXvcLUvzzJNLY8/Evg67CDzrMkBQHAv3YzY3Ziiy9 /vYnJdk1FR5kKrNZ1g+UX8OFGnHf X-Google-Smtp-Source: AA+uWPySSoJYy3IswFmEIfw0y69fAuNtd2Uo5ez4fQKf6DGb41xIKs7q+ek4xNKnptP6I1MPmT3vYg== X-Received: by 2002:a24:1013:: with SMTP id 19-v6mr4695361ity.141.1534522377558; Fri, 17 Aug 2018 09:12:57 -0700 (PDT) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com. [209.85.214.46]) by smtp.gmail.com with ESMTPSA id o201-v6sm2023947ito.41.2018.08.17.09.12.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 09:12:57 -0700 (PDT) Received: by mail-it0-f46.google.com with SMTP id v71-v6so12429783itb.3; Fri, 17 Aug 2018 09:12:57 -0700 (PDT) X-Received: by 2002:a24:144:: with SMTP id 65-v6mr4535226itk.62.1534522377318; Fri, 17 Aug 2018 09:12:57 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:b472:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 09:12:56 -0700 (PDT) In-Reply-To: <3ffeebe7-07c5-bab2-d8c6-45d48adf662f@FreeBSD.org> References: <201808170023.w7H0Np0H027296@repo.freebsd.org> <3ffeebe7-07c5-bab2-d8c6-45d48adf662f@FreeBSD.org> From: Conrad Meyer Date: Fri, 17 Aug 2018 09:12:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:13:04 -0000 Hi John, On Thu, Aug 16, 2018 at 11:26 PM, John Baldwin wrote: > On 8/17/18 1:23 AM, Conrad Meyer wrote: >> Author: cem >> Date: Fri Aug 17 00:23:50 2018 >> New Revision: 337936 >> URL: https://svnweb.freebsd.org/changeset/base/337936 >> >> Log: >> Bring in libsodium to sys/contrib >> ... > > Can you import this into the vendor area and then do a bootstrap of > mergeinfo to sys/contrib? To what benefit? Our vendor process doubles or triples the work required to update vanilla 3rd party sources like this. > This permits future updates to use svn to > merge instead of doing it by hand. What merge? Simply svn delete the directory, copy in the new one, svn add it, and commit. svn merges may be helpful if we plan on carrying a diff, but we don't today, I do not plan to, and I hope we can avoid doing so. > It also permits future imports to > be done by other developers following our standard, documented process > for working with third-party code. As-is, future imports can be done by other developers without having to reference a document and perform 3 different SVN commits. Just drop it in and go. If someone wants to figure out the vendor glue to have that match this, great, but I'm not really seeing the benefit. Best regards, Conrad From owner-svn-src-all@freebsd.org Fri Aug 17 16:15: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 DD8001074314; Fri, 17 Aug 2018 16:15:30 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::22a]) (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 6DA818678A; Fri, 17 Aug 2018 16:15:30 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x22a.google.com with SMTP id k12-v6so14865427oiw.8; Fri, 17 Aug 2018 09:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aytufWtPhzQOKXoiTp/xqguVQw5AoseV98v3W2WY0eA=; b=BHkfvaznlp1lf7eEfp3hQ38ZsDUMFb2Ta6NOaNJfvbJQJglhN2+8+cLtf3kNTpKkte Ppefa7f9CZ7u3oEKU0ULYjbMcRhSqnS3vBtJS7vS9fd3zekuvfXfnK7IKK3aqE81dIS2 xGcKyRFt4KaIY3by4ZlqZ2rIjVgOT5Vp0ZQRSBDjduclHMEHmAB0RDm8pXnM/5Go6z0x 3SuYtxJVh+6F+l7mBboLu2gIsPHAh5jo+g+4XX5fhnBVfpkj1i2qd+dBeHLGsI/s5/hO e6UsP9enNCq90wNqeUTwcQc9Zwe71L6IFEsgR81ZR+I66Hxeyx/tbkCs1etuiSdc5T4J WY9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aytufWtPhzQOKXoiTp/xqguVQw5AoseV98v3W2WY0eA=; b=LVeOVJnzRpkpJzzW9F5Ulya5NF0HNR91d6mnMNUxVpCgiyrMYNsF3lp6Uy3sUynRuz C7NI/vCoPk8sNz6PkEap0h88O8FbDw+yn8Ux6NQa8p5F/X/SoJyvx/j/Dm4F499I05mT egtq2Gxb1B283yvXVDpmDbut0m3iMHz1PVeKnevFtmJNE40+kWh9dtONRHB38SgBnlwD 0N/TtxcEoPrayQ8fPrrsgkrV8tGhpF+rpMGfPdwp/knOTQ8sHKW8woZkuakU0ca5kwsk 5Ct/4owsv7XoMpqGwCSNTsL6YR7gbCUQrWgz5sXIaOgxkHRBeqEyILUF8lSVPoIl78cP CQ7g== X-Gm-Message-State: AOUpUlFaUyqHFTDuS4tn8To+MdOHYKCx2gZB4iEiZpb0Rsst0nMieWRQ T6HIZHik6maVFejHtJUDEC/WHVP9Ds1FsTCDoXgGnsiT X-Google-Smtp-Source: AA+uWPxMu2nH4n68OKjg/AI2xRW1D3+M7qVXvtOhiXOUfNzOG2QbUaIzjPMZuNPUufW6/7FVQi/sY5sAoXddrbY/S5U= X-Received: by 2002:aca:3985:: with SMTP id g127-v6mr3320119oia.267.1534522529690; Fri, 17 Aug 2018 09:15:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:3bb6:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 09:15:29 -0700 (PDT) In-Reply-To: References: <201808170023.w7H0Np0H027296@repo.freebsd.org> <201808170503.w7H53GR9023607@slippy.cwsent.com> From: Benjamin Kaduk Date: Fri, 17 Aug 2018 11:15:29 -0500 Message-ID: Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... To: "cem@FreeBSD.org" Cc: Cy Schubert , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:15:31 -0000 On Fri, Aug 17, 2018 at 11:04 AM, Conrad Meyer wrote: > On Thu, Aug 16, 2018 at 10:03 PM, Cy Schubert > wrote: > > In message <201808170023.w7H0Np0H027296@repo.freebsd.org>, Conrad Meyer > > writes: > >> Author: cem > >> Date: Fri Aug 17 00:23:50 2018 > >> New Revision: 337936 > >> URL: https://svnweb.freebsd.org/changeset/base/337936 > >> > >> Log: > >> Bring in libsodium to sys/contrib > >> ... > > > > Why wasn't this imported into vendor-sys first? Especially if we intend > > on tailoring it over time. > > We don't intent on tailoring it at all. > Sorry, who is "we"? I did not find any "discussed with" or "reviewed by" or similar in the commit message (nor an indication of what intended uses in the base system were already known). -Ben From owner-svn-src-all@freebsd.org Fri Aug 17 16:18: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 D676210743F5; Fri, 17 Aug 2018 16:18:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (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 6DC628692D; Fri, 17 Aug 2018 16:18:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f178.google.com with SMTP id m4-v6so7360184iop.3; Fri, 17 Aug 2018 09:18:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=xyTHSq6kPNtlgVFJ+tb/wA/pvYJolklyMrGqfxrDrds=; b=OT7wAvU7PSczh7A8SkAlRY0+5UUFeQvR5xXTEY+bhpWpvpAQjYCKJKVhehOff0UxgU E2dxJlSf96L+TP9YTenHwrinsE0Nayi89Z/bPqyDiu+UbdVRnn+1wGcORb0QknlKR+Eh /XgdGxQAodRfkl81YgRQt+pz3iPON5fWoXbbCgHsrKg+EdY5ADxXLi6EozHMM7K81GrH RHEaDOhJS1WgfQOjvmin/EzkykiwkO4uA6O5PiqqbZqxPcBMT0Byi5kY0S/YQcXndY0n 7axSfua7GcxkBO7XraKBkc98iiRidZ1mWqDfETqTVUQT9i+q1wyMYOUewnwhBVLV9EYB 12FA== X-Gm-Message-State: APzg51BDmaN4qqp3Hyi88sSocKSyrHeqEO4IixmsO6OTbZ18QdSQxvct RHWn7paBg1uR1U7IyOTTM99LBvHK X-Google-Smtp-Source: ANB0VdbDRUvlVyKt9bggKaUXJM8XakdERqdpver6O+Mh/OY63EGOelIiwO/FMcl4FnojaKBtjaGvdw== X-Received: by 2002:a6b:e508:: with SMTP id y8-v6mr7928502ioc.285.1534522679630; Fri, 17 Aug 2018 09:17:59 -0700 (PDT) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id z6-v6sm1552965iti.19.2018.08.17.09.17.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 09:17:59 -0700 (PDT) Received: by mail-it0-f42.google.com with SMTP id s7-v6so11980601itb.4; Fri, 17 Aug 2018 09:17:58 -0700 (PDT) X-Received: by 2002:a24:f945:: with SMTP id l66-v6mr1946385ith.6.1534522678858; Fri, 17 Aug 2018 09:17:58 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:b472:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 09:17:58 -0700 (PDT) In-Reply-To: References: <201808170023.w7H0Np0H027296@repo.freebsd.org> <201808170503.w7H53GR9023607@slippy.cwsent.com> From: Conrad Meyer Date: Fri, 17 Aug 2018 09:17:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:18:06 -0000 On Fri, Aug 17, 2018 at 9:12 AM, Warner Losh wrote: > > On Fri, Aug 17, 2018, 10:05 AM Conrad Meyer wrote: >> We don't intend[sic] on tailoring it at all. > > We don't document such an exception... history tells me this belief may be > optimistic.. I think it is a generally understood convention re: contrib code. I called out intent in the commit message for the directory, and anyway it is generally frowned upon in the project to modify contrib code for non-abandoned upstreams. E.g., there was quite a bit of resistance modifying top(1) until it was deemed dead upstream and moved out of contrib. Hope that helps, Conrad From owner-svn-src-all@freebsd.org Fri Aug 17 16:19: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 7F14010744DB; Fri, 17 Aug 2018 16:19:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 291FB86ADC; Fri, 17 Aug 2018 16:19:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E077D2BBF; Fri, 17 Aug 2018 16:19:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HGJmDK015262; Fri, 17 Aug 2018 16:19:48 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HGJlZe015255; Fri, 17 Aug 2018 16:19:47 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201808171619.w7HGJlZe015255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 Aug 2018 16:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337978 - in head/libexec/rtld-elf: . aarch64 arm mips powerpc powerpc64 riscv X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/libexec/rtld-elf: . aarch64 arm mips powerpc powerpc64 riscv X-SVN-Commit-Revision: 337978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:19:49 -0000 Author: brooks Date: Fri Aug 17 16:19:47 2018 New Revision: 337978 URL: https://svnweb.freebsd.org/changeset/base/337978 Log: Rework rtld's TLS Variant I implementation to match r326794 The above commit fixed handling overaligned TLS segments in libc's TLS Variant I implementation, but rtld provides its own implementation for dynamically-linked executables which lacks these fixes. Thus, port these changes to rtld. Submitted by: James Clarke Reviewed by: kbowling Testing byL kbowling (powerpc64), br (riscv), kevans (armv7) Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16510 Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h head/libexec/rtld-elf/arm/rtld_machdep.h head/libexec/rtld-elf/mips/rtld_machdep.h head/libexec/rtld-elf/powerpc/rtld_machdep.h head/libexec/rtld-elf/powerpc64/rtld_machdep.h head/libexec/rtld-elf/riscv/rtld_machdep.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_machdep.h Fri Aug 17 16:07:06 2018 (r337977) +++ head/libexec/rtld-elf/aarch64/rtld_machdep.h Fri Aug 17 16:19:47 2018 (r337978) @@ -69,6 +69,8 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr targe #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) \ + round(TLS_TCB_SIZE, align) - TLS_TCB_SIZE #define TLS_TCB_SIZE 16 typedef struct { Modified: head/libexec/rtld-elf/arm/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/arm/rtld_machdep.h Fri Aug 17 16:07:06 2018 (r337977) +++ head/libexec/rtld-elf/arm/rtld_machdep.h Fri Aug 17 16:19:47 2018 (r337978) @@ -69,6 +69,8 @@ typedef struct { #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) \ + round(TLS_TCB_SIZE, align) - TLS_TCB_SIZE extern void *__tls_get_addr(tls_index *ti); Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Fri Aug 17 16:07:06 2018 (r337977) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Fri Aug 17 16:19:47 2018 (r337978) @@ -64,10 +64,11 @@ typedef struct { #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(TLS_TCB_SIZE, align) + TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) 0 extern void *__tls_get_addr(tls_index *ti); Modified: head/libexec/rtld-elf/powerpc/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_machdep.h Fri Aug 17 16:07:06 2018 (r337977) +++ head/libexec/rtld-elf/powerpc/rtld_machdep.h Fri Aug 17 16:19:47 2018 (r337978) @@ -74,10 +74,11 @@ void _rtld_powerpc_pltcall(void); #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(8, align) + TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) 0 typedef struct { unsigned long ti_module; Modified: head/libexec/rtld-elf/powerpc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc64/rtld_machdep.h Fri Aug 17 16:07:06 2018 (r337977) +++ head/libexec/rtld-elf/powerpc64/rtld_machdep.h Fri Aug 17 16:19:47 2018 (r337978) @@ -66,10 +66,11 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr targe #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(16, align) + TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) 0 typedef struct { unsigned long ti_module; Modified: head/libexec/rtld-elf/riscv/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/riscv/rtld_machdep.h Fri Aug 17 16:07:06 2018 (r337977) +++ head/libexec/rtld-elf/riscv/rtld_machdep.h Fri Aug 17 16:19:47 2018 (r337978) @@ -89,10 +89,11 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr targe #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(16, align) + TLS_TCB_SIZE #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) +#define calculate_tls_post_size(align) 0 typedef struct { unsigned long ti_module; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Aug 17 16:07:06 2018 (r337977) +++ head/libexec/rtld-elf/rtld.c Fri Aug 17 16:19:47 2018 (r337978) @@ -4693,47 +4693,87 @@ tls_get_addr_common(Elf_Addr **dtvp, int index, size_t defined(__powerpc__) || defined(__riscv) /* + * Return pointer to allocated TLS block + */ +static void * +get_tls_block_ptr(void *tcb, size_t tcbsize) +{ + size_t extra_size, post_size, pre_size, tls_block_size; + size_t tls_init_align; + + tls_init_align = MAX(obj_main->tlsalign, 1); + + /* Compute fragments sizes. */ + extra_size = tcbsize - TLS_TCB_SIZE; + post_size = calculate_tls_post_size(tls_init_align); + tls_block_size = tcbsize + post_size; + pre_size = roundup2(tls_block_size, tls_init_align) - tls_block_size; + + return ((char *)tcb - pre_size - extra_size); +} + +/* * Allocate Static TLS using the Variant I method. + * + * For details on the layout, see lib/libc/gen/tls.c. + * + * NB: rtld's tls_static_space variable includes TLS_TCB_SIZE and post_size as + * it is based on tls_last_offset, and TLS offsets here are really TCB + * offsets, whereas libc's tls_static_space is just the executable's static + * TLS segment. */ void * allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) { Obj_Entry *obj; - char *tcb; - Elf_Addr **tls; - Elf_Addr *dtv; + char *tls_block; + Elf_Addr *dtv, **tcb; Elf_Addr addr; int i; + size_t extra_size, maxalign, post_size, pre_size, tls_block_size; + size_t tls_init_align; if (oldtcb != NULL && tcbsize == TLS_TCB_SIZE) return (oldtcb); assert(tcbsize >= TLS_TCB_SIZE); - tcb = xcalloc(1, tls_static_space - TLS_TCB_SIZE + tcbsize); - tls = (Elf_Addr **)(tcb + tcbsize - TLS_TCB_SIZE); + maxalign = MAX(tcbalign, tls_static_max_align); + tls_init_align = MAX(obj_main->tlsalign, 1); + /* Compute fragmets sizes. */ + extra_size = tcbsize - TLS_TCB_SIZE; + post_size = calculate_tls_post_size(tls_init_align); + tls_block_size = tcbsize + post_size; + pre_size = roundup2(tls_block_size, tls_init_align) - tls_block_size; + tls_block_size += pre_size + tls_static_space - TLS_TCB_SIZE - post_size; + + /* Allocate whole TLS block */ + tls_block = malloc_aligned(tls_block_size, maxalign); + tcb = (Elf_Addr **)(tls_block + pre_size + extra_size); + if (oldtcb != NULL) { - memcpy(tls, oldtcb, tls_static_space); - free(oldtcb); + memcpy(tls_block, get_tls_block_ptr(oldtcb, tcbsize), + tls_static_space); + free_aligned(get_tls_block_ptr(oldtcb, tcbsize)); /* Adjust the DTV. */ - dtv = tls[0]; + dtv = tcb[0]; for (i = 0; i < dtv[1]; i++) { if (dtv[i+2] >= (Elf_Addr)oldtcb && dtv[i+2] < (Elf_Addr)oldtcb + tls_static_space) { - dtv[i+2] = dtv[i+2] - (Elf_Addr)oldtcb + (Elf_Addr)tls; + dtv[i+2] = dtv[i+2] - (Elf_Addr)oldtcb + (Elf_Addr)tcb; } } } else { dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); - tls[0] = dtv; + tcb[0] = dtv; dtv[0] = tls_dtv_generation; dtv[1] = tls_max_index; for (obj = globallist_curr(objs); obj != NULL; obj = globallist_next(obj)) { if (obj->tlsoffset > 0) { - addr = (Elf_Addr)tls + obj->tlsoffset; + addr = (Elf_Addr)tcb + obj->tlsoffset; if (obj->tlsinitsize > 0) memcpy((void*) addr, obj->tlsinit, obj->tlsinitsize); if (obj->tlssize > obj->tlsinitsize) @@ -4752,14 +4792,19 @@ free_tls(void *tcb, size_t tcbsize, size_t tcbalign) { Elf_Addr *dtv; Elf_Addr tlsstart, tlsend; - int dtvsize, i; + size_t post_size; + size_t dtvsize, i, tls_init_align; assert(tcbsize >= TLS_TCB_SIZE); + tls_init_align = MAX(obj_main->tlsalign, 1); - tlsstart = (Elf_Addr)tcb + tcbsize - TLS_TCB_SIZE; - tlsend = tlsstart + tls_static_space; + /* Compute fragments sizes. */ + post_size = calculate_tls_post_size(tls_init_align); - dtv = *(Elf_Addr **)tlsstart; + tlsstart = (Elf_Addr)tcb + TLS_TCB_SIZE + post_size; + tlsend = (Elf_Addr)tcb + tls_static_space; + + dtv = *(Elf_Addr **)tcb; dtvsize = dtv[1]; for (i = 0; i < dtvsize; i++) { if (dtv[i+2] && (dtv[i+2] < tlsstart || dtv[i+2] >= tlsend)) { @@ -4767,7 +4812,7 @@ free_tls(void *tcb, size_t tcbsize, size_t tcbalign) } } free(dtv); - free(tcb); + free_aligned(get_tls_block_ptr(tcb, tcbsize)); } #endif From owner-svn-src-all@freebsd.org Fri Aug 17 16:31: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 1B7521074AD9; Fri, 17 Aug 2018 16:31:06 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C29F288C68; Fri, 17 Aug 2018 16:31:05 +0000 (UTC) (envelope-from kevans@freebsd.org) 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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5FF2B27F00; Fri, 17 Aug 2018 16:31:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f45.google.com with SMTP id v22-v6so6293303lfe.8; Fri, 17 Aug 2018 09:31:05 -0700 (PDT) X-Gm-Message-State: AOUpUlG7VzALOflOVK57RhHdYO72vYGzS4yjsYIMekfrqpUjeNMFmBGq HK+fhcB8ih/7piLXbu1m6bwr1eHXa5lnphTzPfw= X-Google-Smtp-Source: AA+uWPwABCARoEZEQgvoeGB8ev0Ja65U/HLCLing6/qNeg5229pmiGIp0E7/ShRQHEG9Hv3ZMHF5c17Af+ZDDIzyhdc= X-Received: by 2002:a19:53d6:: with SMTP id h83-v6mr7672553lfl.15.1534523463778; Fri, 17 Aug 2018 09:31:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 09:30:42 -0700 (PDT) In-Reply-To: <201808171549.w7HFndsp059932@pdx.rh.CN85.dnsmgr.net> References: <201808171549.w7HFndsp059932@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Fri, 17 Aug 2018 11:30:42 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337956 - in head: . bin/ls To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:31:06 -0000 On Fri, Aug 17, 2018 at 10:49 AM, Rodney W. Grimes wrote: >> On Fri, Aug 17, 2018 at 10:26 AM, Kyle Evans wrote: >> > On Fri, Aug 17, 2018 at 10:24 AM, Rodney W. Grimes >> > wrote: >> >> [ Charset UTF-8 unsupported, converting... ] >> >>> Author: kevans >> >>> Date: Fri Aug 17 04:15:51 2018 >> >>> New Revision: 337956 >> >>> URL: https://svnweb.freebsd.org/changeset/base/337956 >> >>> >> >>> Log: >> >>> ls(1): Add --color=3Dwhen >> >>> >> >>> --color may be set to one of: 'auto', 'always', and 'never'. >> >>> >> >>> 'auto' is the default behavior- output colors only if -G or COLORT= ERM are >> >> >> >> Why different than coreutils ls? Default for coreutils is none. >> > >> > I guess this was worded poorly and you skipped both the review and >> > reading the diff... this is still contingent on environment variables >> > or -G being specified. >> > >> >>> set, and only if stdout is a tty. >> >>> >> >>> 'always' is a new behavior- output colors always. termcap(5) will = be >> >>> consulted unless TERM is unset or not a recognized terminal, in wh= ich case >> >>> ls(1) will fall back to explicitly outputting ANSI escape sequence= s. >> >>> >> >>> 'never' to turn off any environment variable and -G usage. >> >> Why different than core utils? Coreutils uses none. >> > >> > I guess this was worded poorly and you skipped both the review and >> > reading the diff... this is still contingent on environment variables >> > or -G being specified. >> > >> >> ... copy-paste-o. The version of coreutils ls(1) that I have uses >> 'never' for this. There is no valid 'none' value. > > Oh boy, we need to investiage that then, cause it seems > as if the official page says none. Does your say it > has a different default value too? > For the record, the man page available on all of the Debian systems we have claim to be "GNU coreutils 8.28" from October 2017 and includes this verbiage: [start] ... --color[=3DWHEN] colorize the output; WHEN can be 'always' (default if omitted), 'auto', or 'never'; more info below ... Using color to distinguish file types is disabled both by default and with --color=3Dnever. With --color=3Dauto, ls emits color codes only when standard output is connected to a terminal. The LS_COLORS environment variable can change the set=E2=80=90 tings. Use the dircolors command to set it. ... [end] To join this thread back into one... I think the problem is that I've worded things terrible, so you misunderstand. The default value is --color=3Dauto *if you've requested colors* (-G/environment), and --color=3Dnever otherwise. Doing otherwise is, IMO, a POLA violation in itself, because FreeBSD turns on colors with environment variables and has for 18 years now. From owner-svn-src-all@freebsd.org Fri Aug 17 16:35: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 4794E1074E91; Fri, 17 Aug 2018 16:35:31 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x235.google.com (mail-pl0-x235.google.com [IPv6:2607:f8b0:400e:c01::235]) (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 BA24B89206; Fri, 17 Aug 2018 16:35:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x235.google.com with SMTP id p4-v6so396756pll.8; Fri, 17 Aug 2018 09:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yraYnkRXBB7w2mCKKFDiNRCKZp2xNQVJmHUbSx0jOzM=; b=RzIKYZPeOW8iLAB3usN3JM5ZA+wDd2gk6S88v7P3k5Eb68+3hLqxZzWjup5dIq05Qm 5e72C85/1wU5dQg1JhPUP/pmj2VosCQ+Sg19uIsR9YNNjxq5qDkBPXU1jV9YKdgSHrtN WSq10nZuDBsvUyYsjN6OEh31GkzWYEG1PUPE4htrd40li9LqQeD7eR1dKM7fon3ocQUZ CrGBdBwJpTvmnz+En5bVxDZctnlImzG8TelHMcU9dpKrfwTUhGRpGn3hX1iVXlxD7ZaX +uwLoIrAiyhjX3E8e1SYgTW0PJTbQkOIZT3F0uCxZSsweFzOwIiqIHvtkWjwiGnBvPry jZUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=yraYnkRXBB7w2mCKKFDiNRCKZp2xNQVJmHUbSx0jOzM=; b=GPmKd2ZwvmeG97xEhM7KWrc53Kf0vhpQLCWNoQ6+5bqe+Ll1R25mpU2Mlay64tL1sC Ffi76xMJsdOAls7wjs6EK4Uzkz2ZmzVb8TDHn7YejWcRkWMFCcbBiqq2dWdzjrJ5ShkR B1LgGHhaQ/6lWs7CaY0jhn3QaeXf3R3ChNpQV7BApskttbAPGnR4bJcdnPwgPIrxUm+v AOezuRSCpEvEM5m9XbT2NfTxC0ARv7Fj9LwRSmupNWyX5PuZ38D+vb2M9CTkIasshy3N UpPmVLQ5iP3EI768UPimnZ0JQjNueNvQIBt41sPiVn0hgcDV3X9Mqg1dOt+7NWenvkcj LSnQ== X-Gm-Message-State: AOUpUlHmO/OVs66P9GcKRaHcQ1agSkzKDsevwVDtjHYTa1DZI5T9S4Oc FXIg6E1sPikmvYM4lBiF17fip5sb X-Google-Smtp-Source: AA+uWPybKtFpOYpNSY6BCyfsyebapgRLXdyNwxQ9Y5dMdUoEIneBVFhbu+wcvzzwPouszvz5lrJL6w== X-Received: by 2002:a17:902:14e:: with SMTP id 72-v6mr34109816plb.299.1534523729486; Fri, 17 Aug 2018 09:35:29 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id 16-v6sm5180375pfo.164.2018.08.17.09.35.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 09:35:28 -0700 (PDT) Sender: Mark Johnston Date: Fri, 17 Aug 2018 12:35:25 -0400 From: Mark Johnston To: Conrad Meyer Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... Message-ID: <20180817163525.GB13168@raichu> References: <201808170023.w7H0Np0H027296@repo.freebsd.org> <201808170503.w7H53GR9023607@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:35:31 -0000 On Fri, Aug 17, 2018 at 09:17:58AM -0700, Conrad Meyer wrote: > On Fri, Aug 17, 2018 at 9:12 AM, Warner Losh wrote: > > > > On Fri, Aug 17, 2018, 10:05 AM Conrad Meyer wrote: > >> We don't intend[sic] on tailoring it at all. > > > > We don't document such an exception... history tells me this belief may be > > optimistic.. > > I think it is a generally understood convention re: contrib code. I > called out intent in the commit message for the directory, and anyway > it is generally frowned upon in the project to modify contrib code for > non-abandoned upstreams. E.g., there was quite a bit of resistance > modifying top(1) until it was deemed dead upstream and moved out of > contrib. Rather, I'd say it shouldn't be done gratuitously: every commit to contrib code adds to our cumulative technical debt until it is reconciled with upstream. Sometimes, however, that's the right tradeoff to make (or it's simply necessary for some reason). In that case having a vendor branch is important, and one should be created preemptively even if there is no current intention to modify the imported code. From owner-svn-src-all@freebsd.org Fri Aug 17 16:53:45 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 B92F6107575E; Fri, 17 Aug 2018 16:53:45 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BABB89C19; Fri, 17 Aug 2018 16:53:45 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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)) (Authenticated sender: olivier/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1BCC6828E; Fri, 17 Aug 2018 16:53:45 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: by mail-pg1-f176.google.com with SMTP id k3-v6so3833938pgq.5; Fri, 17 Aug 2018 09:53:45 -0700 (PDT) X-Gm-Message-State: AOUpUlEOK6Y6rhJivYJq6DVu4eB/QAzXVOBfbvlx0DMlOjMGulvgr/Sk bTZpc85LonrjJOjj/q/IJKNlhJvbjdn9W2Pfsrk= X-Google-Smtp-Source: AA+uWPwx6Dlp+dt3LuTKVr8MPJoTdFamD5ngVDXj+U/3tawH1Uc8xRvgl3YKMrURpHnyY2Pi0niiLAyc05kz6ZE9DPg= X-Received: by 2002:a62:45d2:: with SMTP id n79-v6mr37363549pfi.137.1534524823982; Fri, 17 Aug 2018 09:53:43 -0700 (PDT) MIME-Version: 1.0 References: <201808140754.w7E7sEFs018313@repo.freebsd.org> In-Reply-To: From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Fri, 17 Aug 2018 18:53:33 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337736 - in head/sys: netinet netinet6 To: "Andrey V. Elsukov" Cc: Alan Somers , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 16:53:45 -0000 On Fri, Aug 17, 2018 at 3:33 PM Andrey V. Elsukov wrote: > > I think it is because IPv4 tests use broadcast addresses in some places. > The attached patch fixes the test for me. > > I confirm it was a typo from me, and I never intend to badly use these broadcast addresses. The patch correctly fix it. From owner-svn-src-all@freebsd.org Fri Aug 17 17:06: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 177FA1075B2F for ; Fri, 17 Aug 2018 17:06:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (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 986778A2DF for ; Fri, 17 Aug 2018 17:06:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id d9-v6so12211475itf.2 for ; Fri, 17 Aug 2018 10:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2qPP0Q3iCRZmT467+2Lpw+NjrxawjrKpaUM/xMOAsdA=; b=g0y2go0xCqJN+No5lhYj+K+IEdc8uPJciLUy4v9n2txSeeigz7ndY8mnqHLHL7CCJf p7Mq66mjPyWbCRMG2DIfhZBxTY0Qeqip0YEUqH278Qo92byvPOyUu5c8sMKdlom8ecUC gqYDTsPMX3Zi9inCz50zR5ZX0Hqe4uwJJubDEBkzQSm+mRZG1nuPNoy6rXJCzG8eMtXl R0irRlnPWU29yMcOK2JnJF2qL3bSWFthgyYsZP0axXGDLDrYEX3Wyr8Ydnzql1p0iG3N l45Ho/1mKfk6A4GiOyq6a03aaukRnBowWSnSD3pQwRHJeJAbcbStXtbs61JTquyojMoc jLcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2qPP0Q3iCRZmT467+2Lpw+NjrxawjrKpaUM/xMOAsdA=; b=gGgNEzxR0Cvm7N1hV/YV8h9b7eGn7kuGudfnYZ2Fqabo6Khv2okts5B1M9qRQUk1O8 9rHmVel+GoQnzTDpdWvHYSqeQ/OrifBwBJ1Gue42JJVFPdcn1uL2NI5cJ4jg7m9BnK/t gfdRoF89ZiACYZN8GMTxhRjLiWljV35ibaAX0/d2WDCWSWH6G6HojFJ0IqUk4LXeRguP 3JNQdiQGUHSeGVBuKeJXMPXR01urV7nJZnUCIG0wN90iAibSS2xxCl2vKm2WGpVRffSO QOVdsR7zQW/oy3Ap8cHbq91CDNnbLkOb2lBIs2qRJSzcUs620bZSTFh2S/ZCWWdEgRrb lqFg== X-Gm-Message-State: AOUpUlHhLTm90SKNz0oMF9O8qJVKjyQYWoDhglitAkfndLSK3E3NNFwO GPhKhkaQVUtBkoBtdgMLx+TlnMSGm2THjrdP1JMPig== X-Google-Smtp-Source: AA+uWPxkqF06sxy4j8J62KokTE73DX8rzY4+/YSyhBNQ+VcGEfdSsPfESYK6DrfHkkeVp7ObywH5QJmEY8JalOkwnXo= X-Received: by 2002:a24:d2:: with SMTP id 201-v6mr5030023ita.60.1534525587920; Fri, 17 Aug 2018 10:06:27 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:85c2:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 10:06:27 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808170023.w7H0Np0H027296@repo.freebsd.org> <201808170503.w7H53GR9023607@slippy.cwsent.com> From: Warner Losh Date: Fri, 17 Aug 2018 11:06:27 -0600 X-Google-Sender-Auth: SuJ8nHHbDOD6inRWtYhG_Of5PQQ Message-ID: Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 17:06:29 -0000 On Fri, Aug 17, 2018 at 10:17 AM, Conrad Meyer wrote: > On Fri, Aug 17, 2018 at 9:12 AM, Warner Losh wrote: > > > > On Fri, Aug 17, 2018, 10:05 AM Conrad Meyer wrote: > >> We don't intend[sic] on tailoring it at all. > > > > We don't document such an exception... history tells me this belief may > be > > optimistic.. > > I think it is a generally understood convention re: contrib code. I > called out intent in the commit message for the directory, and anyway > it is generally frowned upon in the project to modify contrib code for > non-abandoned upstreams. E.g., there was quite a bit of resistance > modifying top(1) until it was deemed dead upstream and moved out of > contrib. > I don't understand this answer. It makes no sense to me. It certainly doesn't justify flaunting established project guidelines for dubious reasons. Warner From owner-svn-src-all@freebsd.org Fri Aug 17 17:09:22 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 5ACA61075C3C for ; Fri, 17 Aug 2018 17:09:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (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 D4D998A48D for ; Fri, 17 Aug 2018 17:09:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id p81-v6so12651807itp.1 for ; Fri, 17 Aug 2018 10:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=vc/4Y4fHcB3/MZuDJFgsL1927wU/97ozSgfbRh7bmjk=; b=NcS/olJv3fzDt7ou+h5ZSRbdV+8F/5pqNAmmdQWndbhXVgd08LnlqHOKWamktmRlEu AJSC0Ne9F6RhT2kNVHGLsk35VMiRcjjLtm/9lYwRPN3lCMp8brfsGui96hb+aR75VnHh xJIUEa+NYhT5/qrNhIZMUWWN3dOaaoX2waAXjkS0unp9IsHO/tKNs36icZCzhmB8hV3c oDNnM85zD5RYqNRSSCBiSAzz1R45E7/2lxRvFDksj0em1cXmX3q6b42NOgzfcQyRVZcC 4kYMHHBQ9qOsDjmzuIKAu3SI3Mefk0O3iZEuPKpfDDHsJswaKS6AZpl9psKveSooh240 dG/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=vc/4Y4fHcB3/MZuDJFgsL1927wU/97ozSgfbRh7bmjk=; b=tUzhhrsxZGvR9QzarkKXGq20RThlIM++HCZQNcEml+1w9JTNzL/EQwAmHMfT1u4y8N QK9ynOhInFSzY7LCCo71bU7hH6X+r0fP9AkMgexeUxrWKd4K9OMQs6YRTUnRcXRccRUZ f3TzEYa8kwW3T2LxZqKB07FkV3Bosc0eAaF96U3wVDQs4WBNb4ghaku4+WT0J1Via7KE JSJLajMpXKfnraWgk2LVFzWaDHpnvFBl8aKboMyCJr6w4MjVkOic61Z9fLgqhAJ9vGj+ pX2qrXEUKhlAnO+HmavVvXn5rwdcTpjzY6nu3578cIMExfS7Ul+GZn9WulGzzikKgDVl oi+A== X-Gm-Message-State: AOUpUlEzHDiekuPLFWCs7Xmk1puI/tH6lbNNLQLScL5JAOE/LFIiKsdy 3YGAEKeUOw9oA5q8JV1Tm56Mv1KCbRjnpYhzhyuUrg== X-Google-Smtp-Source: AA+uWPxiEbutDLTfoHeN8cgYVb3A4RV95dMZOJ2PnoLZgMlXmxY9r8sFVlKQ2wdKvEBV1i6WWi6y3ywx1eYCtcmtzFg= X-Received: by 2002:a24:d2:: with SMTP id 201-v6mr5038483ita.60.1534525761206; Fri, 17 Aug 2018 10:09:21 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:85c2:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 10:09:20 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808170023.w7H0Np0H027296@repo.freebsd.org> <3ffeebe7-07c5-bab2-d8c6-45d48adf662f@FreeBSD.org> From: Warner Losh Date: Fri, 17 Aug 2018 11:09:20 -0600 X-Google-Sender-Auth: tXGpdjLtu6xJ7lpbv0lDX6H1B6s Message-ID: Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... To: "Conrad E. Meyer" Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 17:09:22 -0000 On Fri, Aug 17, 2018 at 10:12 AM, Conrad Meyer wrote: > Hi John, > > On Thu, Aug 16, 2018 at 11:26 PM, John Baldwin wrote: > > On 8/17/18 1:23 AM, Conrad Meyer wrote: > >> Author: cem > >> Date: Fri Aug 17 00:23:50 2018 > >> New Revision: 337936 > >> URL: https://svnweb.freebsd.org/changeset/base/337936 > >> > >> Log: > >> Bring in libsodium to sys/contrib > >> ... > > > > Can you import this into the vendor area and then do a bootstrap of > > mergeinfo to sys/contrib? > > To what benefit? Our vendor process doubles or triples the work > required to update vanilla 3rd party sources like this. Unmodified imports are literally two additional svn commands, which hardly is a burden. > This permits future updates to use svn to > > merge instead of doing it by hand. > > What merge? Simply svn delete the directory, copy in the new one, svn > add it, and commit. > > svn merges may be helpful if we plan on carrying a diff, but we don't > today, I do not plan to, and I hope we can avoid doing so. Hope. The history of the project that has imported upstream stuff in the hope it never gets modified is littered with examples where it does. > It also permits future imports to > > be done by other developers following our standard, documented process > > for working with third-party code. > > As-is, future imports can be done by other developers without having > to reference a document and perform 3 different SVN commits. Just > drop it in and go. > > If someone wants to figure out the vendor glue to have that match > this, great, but I'm not really seeing the benefit. > This really isn't a 'playing nice with other' sort of answer. I don't think it's within the cultural norms of the project.You should reconsider this hostile attitude. Warner From owner-svn-src-all@freebsd.org Fri Aug 17 17:16: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 615D51075FE8; Fri, 17 Aug 2018 17:16:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 177438A9C4; Fri, 17 Aug 2018 17:16:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E811B38DC; Fri, 17 Aug 2018 17:16:38 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HHGcrJ045850; Fri, 17 Aug 2018 17:16:38 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HHGcr0045847; Fri, 17 Aug 2018 17:16:38 GMT (envelope-from des@FreeBSD.org) Message-Id: <201808171716.w7HHGcr0045847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 17 Aug 2018 17:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337980 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 337980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 17:16:39 -0000 Author: des Date: Fri Aug 17 17:16:38 2018 New Revision: 337980 URL: https://svnweb.freebsd.org/changeset/base/337980 Log: Add a man page for ratecheck(9) and ppsratecheck(9). Added: head/share/man/man9/ratecheck.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/share/man/man9/counter.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Aug 17 16:25:59 2018 (r337979) +++ head/share/man/man9/Makefile Fri Aug 17 17:16:38 2018 (r337980) @@ -270,6 +270,7 @@ MAN= accept_filter.9 \ psignal.9 \ random.9 \ random_harvest.9 \ + ratecheck.9 \ redzone.9 \ refcount.9 \ resettodr.9 \ @@ -1674,6 +1675,7 @@ MLINKS+=random.9 arc4rand.9 \ MLINKS+=random_harvest.9 random_harvest_direct.9 \ random_harvest.9 random_harvest_fast.9 \ random_harvest.9 random_harvest_queue.9 +MLINKS+=ratecheck.9 ppsratecheck.9 MLINKS+=refcount.9 refcount_acquire.9 \ refcount.9 refcount_init.9 \ refcount.9 refcount_release.9 Modified: head/share/man/man9/counter.9 ============================================================================== --- head/share/man/man9/counter.9 Fri Aug 17 16:25:59 2018 (r337979) +++ head/share/man/man9/counter.9 Fri Aug 17 17:16:38 2018 (r337980) @@ -132,7 +132,7 @@ Clear the counter and set it to zero. .It Fn counter_ratecheck cr limit The function is a multiprocessor-friendly version of -.Fn ppsratecheck , +.Fn ppsratecheck which uses .Nm internally. @@ -243,6 +243,7 @@ SYSCTL_COUNTER_U64_ARRAY(_debug, OID_AUTO, counter_arr .Xr critical 9 , .Xr locking 9 , .Xr malloc 9 , +.Xr ratecheck 9 , .Xr sysctl 9 , .Xr uma 9 .Sh HISTORY Added: head/share/man/man9/ratecheck.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/ratecheck.9 Fri Aug 17 17:16:38 2018 (r337980) @@ -0,0 +1,93 @@ +.\"- +.\" Copyright (c) 2017 Dag-Erling Smørgrav +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 25, 2017 +.Dt RATECHECK 9 +.Os +.Sh NAME +.Nm ratecheck , +.Nm ppsratecheck +.Nd "event rate limiting" +.Sh SYNOPSIS +.In sys/time.h +.Ft int +.Fn ratecheck "struct timeval *lasttime" "struct timeval *mininterval" +.Ft int +.Fn ppsratecheck "struct timeval *lasttime" "int *curpps" "int maxpps" +.Sh DESCRIPTION +The +.Nm ratecheck +and +.Nm ppsratecheck +functions facilitate rate-limiting of arbitrary events. +The former enforces a minimum interval between events while the latter +enforces a maximum number of events per second. +.Pp +The +.Nm ratecheck +function compares the current time to the value pointed to by +.Fa lasttime . +If the difference is equal to or greater than +.Fa mininterval , +it returns a non-zero value and updates +.Fa lasttime +to the current time. +Otherwise, it returns zero. +.Pp +The +.Nm ppsratecheck +function first compares the current time +to +.Fa lasttime . +If at least a full second has passed, the value pointed to by the +.Fa curpps +argument is reset to 1 and +.Fa lasttime +is updated to the current time. +Otherwise, +.Fa curpps +is incremented and +.Fa lasttime +is left untouched. +In either case, +.Nm ppsratecheck +returns a non-zero value if and only if the updated +.Fa curpps +is less than or equal to +.Fa maxpps +or +.Fa maxpps +is negative. +.Sh SEE ALSO +.Xr counter 9 +.Sh HISTORY +The +.Nm ratecheck +and +.Nm ppsratecheck +functions first appeared in +.Fx 5.1 . From owner-svn-src-all@freebsd.org Fri Aug 17 18:24: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 4B5C71077B4E; Fri, 17 Aug 2018 18:24:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA1088CF80; Fri, 17 Aug 2018 18:24:11 +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 C78C54581; Fri, 17 Aug 2018 18:24:11 +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 w7HIOB1S081735; Fri, 17 Aug 2018 18:24:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HIOBc4081734; Fri, 17 Aug 2018 18:24:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808171824.w7HIOBc4081734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 Aug 2018 18:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337981 - head/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 337981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 18:24:12 -0000 Author: kib Date: Fri Aug 17 18:24:11 2018 New Revision: 337981 URL: https://svnweb.freebsd.org/changeset/base/337981 Log: Reorder alphabetically. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16702 Modified: head/include/pthread_np.h Modified: head/include/pthread_np.h ============================================================================== --- head/include/pthread_np.h Fri Aug 17 17:16:38 2018 (r337980) +++ head/include/pthread_np.h Fri Aug 17 18:24:11 2018 (r337981) @@ -55,14 +55,14 @@ int pthread_main_np(void); int pthread_multi_np(void); int pthread_mutexattr_getkind_np(pthread_mutexattr_t); int pthread_mutexattr_setkind_np(pthread_mutexattr_t *, int); -void pthread_resume_all_np(void); -int pthread_resume_np(pthread_t); -void pthread_set_name_np(pthread_t, const char *); int pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count); int pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count); int pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count); int pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count); int pthread_mutex_isowned_np(pthread_mutex_t *mutex); +void pthread_resume_all_np(void); +int pthread_resume_np(pthread_t); +void pthread_set_name_np(pthread_t, const char *); int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *); int pthread_single_np(void); void pthread_suspend_all_np(void); From owner-svn-src-all@freebsd.org Fri Aug 17 18:33: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 802001077EDE; Fri, 17 Aug 2018 18:32:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3344F8D49C; Fri, 17 Aug 2018 18:32:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 149564728; Fri, 17 Aug 2018 18:32:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HIWx0c086604; Fri, 17 Aug 2018 18:32:59 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HIWrSP086571; Fri, 17 Aug 2018 18:32:53 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201808171832.w7HIWrSP086571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 17 Aug 2018 18:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337982 - in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/a... X-SVN-Group: stable-11 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable/11: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm crypto/openssl/crypto/... X-SVN-Commit-Revision: 337982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 18:33:00 -0000 Author: jkim Date: Fri Aug 17 18:32:53 2018 New Revision: 337982 URL: https://svnweb.freebsd.org/changeset/base/337982 Log: MFC: r337791 Merge OpenSSL 1.0.2p. Added: stable/11/crypto/openssl/crypto/bn_int.h - copied unchanged from r337791, head/crypto/openssl/crypto/bn_int.h stable/11/crypto/openssl/doc/man3/ - copied from r337791, head/crypto/openssl/doc/man3/ stable/11/secure/lib/libcrypto/man/X509_cmp_time.3 - copied unchanged from r337791, head/secure/lib/libcrypto/man/X509_cmp_time.3 Modified: stable/11/crypto/openssl/CHANGES stable/11/crypto/openssl/CONTRIBUTING stable/11/crypto/openssl/Configure stable/11/crypto/openssl/Makefile stable/11/crypto/openssl/NEWS stable/11/crypto/openssl/README stable/11/crypto/openssl/apps/apps.c stable/11/crypto/openssl/apps/asn1pars.c stable/11/crypto/openssl/apps/ca.c stable/11/crypto/openssl/apps/ocsp.c stable/11/crypto/openssl/apps/passwd.c stable/11/crypto/openssl/apps/s_apps.h stable/11/crypto/openssl/apps/s_client.c stable/11/crypto/openssl/apps/s_server.c stable/11/crypto/openssl/apps/s_socket.c stable/11/crypto/openssl/apps/verify.c stable/11/crypto/openssl/crypto/Makefile stable/11/crypto/openssl/crypto/asn1/a_bool.c stable/11/crypto/openssl/crypto/asn1/a_object.c stable/11/crypto/openssl/crypto/asn1/a_strex.c stable/11/crypto/openssl/crypto/asn1/ameth_lib.c stable/11/crypto/openssl/crypto/asn1/asn1.h stable/11/crypto/openssl/crypto/asn1/asn1_err.c stable/11/crypto/openssl/crypto/asn1/tasn_enc.c stable/11/crypto/openssl/crypto/bio/bss_log.c stable/11/crypto/openssl/crypto/bio/bss_mem.c stable/11/crypto/openssl/crypto/bn/Makefile stable/11/crypto/openssl/crypto/bn/asm/armv4-mont.pl stable/11/crypto/openssl/crypto/bn/asm/ia64-mont.pl stable/11/crypto/openssl/crypto/bn/asm/mips-mont.pl stable/11/crypto/openssl/crypto/bn/asm/parisc-mont.pl stable/11/crypto/openssl/crypto/bn/asm/ppc-mont.pl stable/11/crypto/openssl/crypto/bn/asm/ppc64-mont.pl stable/11/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl stable/11/crypto/openssl/crypto/bn/asm/s390x-mont.pl stable/11/crypto/openssl/crypto/bn/asm/sparct4-mont.pl stable/11/crypto/openssl/crypto/bn/asm/sparcv9-mont.pl stable/11/crypto/openssl/crypto/bn/asm/via-mont.pl stable/11/crypto/openssl/crypto/bn/asm/vis3-mont.pl stable/11/crypto/openssl/crypto/bn/asm/x86-mont.pl stable/11/crypto/openssl/crypto/bn/asm/x86_64-mont.pl stable/11/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl stable/11/crypto/openssl/crypto/bn/bn.h stable/11/crypto/openssl/crypto/bn/bn_div.c stable/11/crypto/openssl/crypto/bn/bn_exp.c stable/11/crypto/openssl/crypto/bn/bn_gf2m.c stable/11/crypto/openssl/crypto/bn/bn_lcl.h stable/11/crypto/openssl/crypto/bn/bn_lib.c stable/11/crypto/openssl/crypto/bn/bn_mod.c stable/11/crypto/openssl/crypto/bn/bn_mont.c stable/11/crypto/openssl/crypto/bn/bn_sqr.c stable/11/crypto/openssl/crypto/conf/conf_api.c stable/11/crypto/openssl/crypto/dh/dh_key.c stable/11/crypto/openssl/crypto/dh/dh_pmeth.c stable/11/crypto/openssl/crypto/dsa/dsa.h stable/11/crypto/openssl/crypto/dsa/dsa_err.c stable/11/crypto/openssl/crypto/dsa/dsa_gen.c stable/11/crypto/openssl/crypto/dsa/dsa_ossl.c stable/11/crypto/openssl/crypto/dsa/dsa_pmeth.c stable/11/crypto/openssl/crypto/ec/ec_ameth.c stable/11/crypto/openssl/crypto/ec/ec_lib.c stable/11/crypto/openssl/crypto/ec/ecp_nistz256.c stable/11/crypto/openssl/crypto/ecdsa/Makefile stable/11/crypto/openssl/crypto/ecdsa/ecdsatest.c stable/11/crypto/openssl/crypto/ecdsa/ecs_ossl.c stable/11/crypto/openssl/crypto/engine/eng_lib.c stable/11/crypto/openssl/crypto/engine/tb_asnmth.c stable/11/crypto/openssl/crypto/o_time.c stable/11/crypto/openssl/crypto/opensslv.h stable/11/crypto/openssl/crypto/pem/pem.h stable/11/crypto/openssl/crypto/pem/pem_lib.c stable/11/crypto/openssl/crypto/pem/pem_pk8.c stable/11/crypto/openssl/crypto/pem/pem_pkey.c stable/11/crypto/openssl/crypto/pem/pvkfmt.c stable/11/crypto/openssl/crypto/pkcs12/p12_asn.c stable/11/crypto/openssl/crypto/rsa/Makefile stable/11/crypto/openssl/crypto/rsa/rsa_eay.c stable/11/crypto/openssl/crypto/rsa/rsa_gen.c stable/11/crypto/openssl/crypto/rsa/rsa_oaep.c stable/11/crypto/openssl/crypto/rsa/rsa_pk1.c stable/11/crypto/openssl/crypto/rsa/rsa_sign.c stable/11/crypto/openssl/crypto/rsa/rsa_ssl.c stable/11/crypto/openssl/crypto/sha/asm/sha1-586.pl stable/11/crypto/openssl/crypto/sha/asm/sha256-586.pl stable/11/crypto/openssl/crypto/ui/ui_openssl.c stable/11/crypto/openssl/crypto/x509/x509_cmp.c stable/11/crypto/openssl/crypto/x509/x509_lu.c stable/11/crypto/openssl/crypto/x509/x509_vfy.c stable/11/crypto/openssl/crypto/x509v3/v3_purp.c stable/11/crypto/openssl/doc/apps/cms.pod stable/11/crypto/openssl/doc/apps/config.pod stable/11/crypto/openssl/doc/apps/genpkey.pod stable/11/crypto/openssl/doc/apps/s_client.pod stable/11/crypto/openssl/doc/crypto/BIO_s_fd.pod stable/11/crypto/openssl/doc/crypto/BN_add.pod stable/11/crypto/openssl/doc/crypto/BN_bn2bin.pod stable/11/crypto/openssl/doc/crypto/BN_generate_prime.pod stable/11/crypto/openssl/doc/crypto/CMS_encrypt.pod stable/11/crypto/openssl/doc/crypto/CMS_get0_SignerInfos.pod stable/11/crypto/openssl/doc/crypto/CMS_get1_ReceiptRequest.pod stable/11/crypto/openssl/doc/crypto/DSA_do_sign.pod stable/11/crypto/openssl/doc/crypto/DSA_sign.pod stable/11/crypto/openssl/doc/crypto/OBJ_nid2obj.pod stable/11/crypto/openssl/doc/crypto/SMIME_read_PKCS7.pod stable/11/crypto/openssl/doc/crypto/ecdsa.pod stable/11/crypto/openssl/doc/crypto/pem.pod stable/11/crypto/openssl/doc/fingerprints.txt stable/11/crypto/openssl/doc/ssl/SSL_CTX_use_certificate.pod stable/11/crypto/openssl/doc/ssl/SSL_get_ciphers.pod stable/11/crypto/openssl/doc/ssl/SSL_get_session.pod stable/11/crypto/openssl/doc/ssl/SSL_get_version.pod stable/11/crypto/openssl/doc/ssl/ssl.pod stable/11/crypto/openssl/ssl/d1_both.c stable/11/crypto/openssl/ssl/s3_lib.c stable/11/crypto/openssl/ssl/s3_srvr.c stable/11/crypto/openssl/ssl/ssl.h stable/11/crypto/openssl/ssl/ssl_lib.c stable/11/crypto/openssl/ssl/ssl_locl.h stable/11/crypto/openssl/ssl/t1_lib.c stable/11/crypto/openssl/ssl/t1_trce.c stable/11/crypto/openssl/util/domd stable/11/secure/lib/libcrypto/Makefile.inc stable/11/secure/lib/libcrypto/Makefile.man stable/11/secure/lib/libcrypto/amd64/x86_64-mont.S stable/11/secure/lib/libcrypto/amd64/x86_64-mont5.S stable/11/secure/lib/libcrypto/arm/armv4-mont.S stable/11/secure/lib/libcrypto/i386/x86-mont.S stable/11/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/11/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/11/secure/lib/libcrypto/man/ASN1_TIME_set.3 stable/11/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/11/secure/lib/libcrypto/man/BIO_ctrl.3 stable/11/secure/lib/libcrypto/man/BIO_f_base64.3 stable/11/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/11/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/11/secure/lib/libcrypto/man/BIO_f_md.3 stable/11/secure/lib/libcrypto/man/BIO_f_null.3 stable/11/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/11/secure/lib/libcrypto/man/BIO_find_type.3 stable/11/secure/lib/libcrypto/man/BIO_new.3 stable/11/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/11/secure/lib/libcrypto/man/BIO_push.3 stable/11/secure/lib/libcrypto/man/BIO_read.3 stable/11/secure/lib/libcrypto/man/BIO_s_accept.3 stable/11/secure/lib/libcrypto/man/BIO_s_bio.3 stable/11/secure/lib/libcrypto/man/BIO_s_connect.3 stable/11/secure/lib/libcrypto/man/BIO_s_fd.3 stable/11/secure/lib/libcrypto/man/BIO_s_file.3 stable/11/secure/lib/libcrypto/man/BIO_s_mem.3 stable/11/secure/lib/libcrypto/man/BIO_s_null.3 stable/11/secure/lib/libcrypto/man/BIO_s_socket.3 stable/11/secure/lib/libcrypto/man/BIO_set_callback.3 stable/11/secure/lib/libcrypto/man/BIO_should_retry.3 stable/11/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/11/secure/lib/libcrypto/man/BN_CTX_new.3 stable/11/secure/lib/libcrypto/man/BN_CTX_start.3 stable/11/secure/lib/libcrypto/man/BN_add.3 stable/11/secure/lib/libcrypto/man/BN_add_word.3 stable/11/secure/lib/libcrypto/man/BN_bn2bin.3 stable/11/secure/lib/libcrypto/man/BN_cmp.3 stable/11/secure/lib/libcrypto/man/BN_copy.3 stable/11/secure/lib/libcrypto/man/BN_generate_prime.3 stable/11/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/11/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/11/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/11/secure/lib/libcrypto/man/BN_new.3 stable/11/secure/lib/libcrypto/man/BN_num_bytes.3 stable/11/secure/lib/libcrypto/man/BN_rand.3 stable/11/secure/lib/libcrypto/man/BN_set_bit.3 stable/11/secure/lib/libcrypto/man/BN_swap.3 stable/11/secure/lib/libcrypto/man/BN_zero.3 stable/11/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/11/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/11/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/11/secure/lib/libcrypto/man/CMS_compress.3 stable/11/secure/lib/libcrypto/man/CMS_decrypt.3 stable/11/secure/lib/libcrypto/man/CMS_encrypt.3 stable/11/secure/lib/libcrypto/man/CMS_final.3 stable/11/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/11/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/11/secure/lib/libcrypto/man/CMS_get0_type.3 stable/11/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/11/secure/lib/libcrypto/man/CMS_sign.3 stable/11/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/11/secure/lib/libcrypto/man/CMS_uncompress.3 stable/11/secure/lib/libcrypto/man/CMS_verify.3 stable/11/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/11/secure/lib/libcrypto/man/CONF_modules_free.3 stable/11/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/11/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/11/secure/lib/libcrypto/man/DH_generate_key.3 stable/11/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/11/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/DH_new.3 stable/11/secure/lib/libcrypto/man/DH_set_method.3 stable/11/secure/lib/libcrypto/man/DH_size.3 stable/11/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/11/secure/lib/libcrypto/man/DSA_do_sign.3 stable/11/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/11/secure/lib/libcrypto/man/DSA_generate_key.3 stable/11/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/11/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/DSA_new.3 stable/11/secure/lib/libcrypto/man/DSA_set_method.3 stable/11/secure/lib/libcrypto/man/DSA_sign.3 stable/11/secure/lib/libcrypto/man/DSA_size.3 stable/11/secure/lib/libcrypto/man/EC_GFp_simple_method.3 stable/11/secure/lib/libcrypto/man/EC_GROUP_copy.3 stable/11/secure/lib/libcrypto/man/EC_GROUP_new.3 stable/11/secure/lib/libcrypto/man/EC_KEY_new.3 stable/11/secure/lib/libcrypto/man/EC_POINT_add.3 stable/11/secure/lib/libcrypto/man/EC_POINT_new.3 stable/11/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/11/secure/lib/libcrypto/man/ERR_clear_error.3 stable/11/secure/lib/libcrypto/man/ERR_error_string.3 stable/11/secure/lib/libcrypto/man/ERR_get_error.3 stable/11/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/11/secure/lib/libcrypto/man/ERR_load_strings.3 stable/11/secure/lib/libcrypto/man/ERR_print_errors.3 stable/11/secure/lib/libcrypto/man/ERR_put_error.3 stable/11/secure/lib/libcrypto/man/ERR_remove_state.3 stable/11/secure/lib/libcrypto/man/ERR_set_mark.3 stable/11/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/11/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/11/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/11/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/11/secure/lib/libcrypto/man/EVP_EncodeInit.3 stable/11/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/11/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/11/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/11/secure/lib/libcrypto/man/EVP_SealInit.3 stable/11/secure/lib/libcrypto/man/EVP_SignInit.3 stable/11/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/11/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/11/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/11/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/11/secure/lib/libcrypto/man/OPENSSL_config.3 stable/11/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/11/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 stable/11/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/11/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/11/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/11/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/11/secure/lib/libcrypto/man/PKCS12_create.3 stable/11/secure/lib/libcrypto/man/PKCS12_parse.3 stable/11/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/11/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/11/secure/lib/libcrypto/man/PKCS7_sign.3 stable/11/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/11/secure/lib/libcrypto/man/PKCS7_verify.3 stable/11/secure/lib/libcrypto/man/RAND_add.3 stable/11/secure/lib/libcrypto/man/RAND_bytes.3 stable/11/secure/lib/libcrypto/man/RAND_cleanup.3 stable/11/secure/lib/libcrypto/man/RAND_egd.3 stable/11/secure/lib/libcrypto/man/RAND_load_file.3 stable/11/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/11/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/11/secure/lib/libcrypto/man/RSA_check_key.3 stable/11/secure/lib/libcrypto/man/RSA_generate_key.3 stable/11/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/RSA_new.3 stable/11/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/11/secure/lib/libcrypto/man/RSA_print.3 stable/11/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/11/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/11/secure/lib/libcrypto/man/RSA_set_method.3 stable/11/secure/lib/libcrypto/man/RSA_sign.3 stable/11/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/11/secure/lib/libcrypto/man/RSA_size.3 stable/11/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/11/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/11/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/11/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/11/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/11/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/11/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/11/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/11/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/11/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/11/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/11/secure/lib/libcrypto/man/X509_check_host.3 stable/11/secure/lib/libcrypto/man/X509_check_private_key.3 stable/11/secure/lib/libcrypto/man/X509_new.3 stable/11/secure/lib/libcrypto/man/X509_verify_cert.3 stable/11/secure/lib/libcrypto/man/bio.3 stable/11/secure/lib/libcrypto/man/blowfish.3 stable/11/secure/lib/libcrypto/man/bn.3 stable/11/secure/lib/libcrypto/man/bn_internal.3 stable/11/secure/lib/libcrypto/man/buffer.3 stable/11/secure/lib/libcrypto/man/crypto.3 stable/11/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/11/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 stable/11/secure/lib/libcrypto/man/d2i_DHparams.3 stable/11/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/11/secure/lib/libcrypto/man/d2i_ECPKParameters.3 stable/11/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_PrivateKey.3 stable/11/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/11/secure/lib/libcrypto/man/d2i_X509.3 stable/11/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/11/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/11/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/11/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/11/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/11/secure/lib/libcrypto/man/des.3 stable/11/secure/lib/libcrypto/man/dh.3 stable/11/secure/lib/libcrypto/man/dsa.3 stable/11/secure/lib/libcrypto/man/ec.3 stable/11/secure/lib/libcrypto/man/ecdsa.3 stable/11/secure/lib/libcrypto/man/engine.3 stable/11/secure/lib/libcrypto/man/err.3 stable/11/secure/lib/libcrypto/man/evp.3 stable/11/secure/lib/libcrypto/man/hmac.3 stable/11/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/11/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/11/secure/lib/libcrypto/man/lh_stats.3 stable/11/secure/lib/libcrypto/man/lhash.3 stable/11/secure/lib/libcrypto/man/md5.3 stable/11/secure/lib/libcrypto/man/mdc2.3 stable/11/secure/lib/libcrypto/man/pem.3 stable/11/secure/lib/libcrypto/man/rand.3 stable/11/secure/lib/libcrypto/man/rc4.3 stable/11/secure/lib/libcrypto/man/ripemd.3 stable/11/secure/lib/libcrypto/man/rsa.3 stable/11/secure/lib/libcrypto/man/sha.3 stable/11/secure/lib/libcrypto/man/threads.3 stable/11/secure/lib/libcrypto/man/ui.3 stable/11/secure/lib/libcrypto/man/ui_compat.3 stable/11/secure/lib/libcrypto/man/x509.3 stable/11/secure/lib/libssl/Makefile.man stable/11/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/11/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_new.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 stable/11/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 stable/11/secure/lib/libssl/man/SSL_CONF_cmd.3 stable/11/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 stable/11/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 stable/11/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/11/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/11/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/11/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/11/secure/lib/libssl/man/SSL_CTX_free.3 stable/11/secure/lib/libssl/man/SSL_CTX_get0_param.3 stable/11/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/11/secure/lib/libssl/man/SSL_CTX_new.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/11/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/11/secure/lib/libssl/man/SSL_CTX_set1_curves.3 stable/11/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/11/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/11/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 stable/11/secure/lib/libssl/man/SSL_SESSION_free.3 stable/11/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/11/secure/lib/libssl/man/SSL_accept.3 stable/11/secure/lib/libssl/man/SSL_alert_type_string.3 stable/11/secure/lib/libssl/man/SSL_check_chain.3 stable/11/secure/lib/libssl/man/SSL_clear.3 stable/11/secure/lib/libssl/man/SSL_connect.3 stable/11/secure/lib/libssl/man/SSL_do_handshake.3 stable/11/secure/lib/libssl/man/SSL_export_keying_material.3 stable/11/secure/lib/libssl/man/SSL_free.3 stable/11/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/11/secure/lib/libssl/man/SSL_get_ciphers.3 stable/11/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/11/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/11/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/11/secure/lib/libssl/man/SSL_get_error.3 stable/11/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/11/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/11/secure/lib/libssl/man/SSL_get_fd.3 stable/11/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/11/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/11/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/11/secure/lib/libssl/man/SSL_get_rbio.3 stable/11/secure/lib/libssl/man/SSL_get_session.3 stable/11/secure/lib/libssl/man/SSL_get_verify_result.3 stable/11/secure/lib/libssl/man/SSL_get_version.3 stable/11/secure/lib/libssl/man/SSL_library_init.3 stable/11/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/11/secure/lib/libssl/man/SSL_new.3 stable/11/secure/lib/libssl/man/SSL_pending.3 stable/11/secure/lib/libssl/man/SSL_read.3 stable/11/secure/lib/libssl/man/SSL_rstate_string.3 stable/11/secure/lib/libssl/man/SSL_session_reused.3 stable/11/secure/lib/libssl/man/SSL_set_bio.3 stable/11/secure/lib/libssl/man/SSL_set_connect_state.3 stable/11/secure/lib/libssl/man/SSL_set_fd.3 stable/11/secure/lib/libssl/man/SSL_set_session.3 stable/11/secure/lib/libssl/man/SSL_set_shutdown.3 stable/11/secure/lib/libssl/man/SSL_set_verify_result.3 stable/11/secure/lib/libssl/man/SSL_shutdown.3 stable/11/secure/lib/libssl/man/SSL_state_string.3 stable/11/secure/lib/libssl/man/SSL_want.3 stable/11/secure/lib/libssl/man/SSL_write.3 stable/11/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/11/secure/lib/libssl/man/ssl.3 stable/11/secure/usr.bin/openssl/man/CA.pl.1 stable/11/secure/usr.bin/openssl/man/asn1parse.1 stable/11/secure/usr.bin/openssl/man/ca.1 stable/11/secure/usr.bin/openssl/man/ciphers.1 stable/11/secure/usr.bin/openssl/man/cms.1 stable/11/secure/usr.bin/openssl/man/crl.1 stable/11/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/11/secure/usr.bin/openssl/man/dgst.1 stable/11/secure/usr.bin/openssl/man/dhparam.1 stable/11/secure/usr.bin/openssl/man/dsa.1 stable/11/secure/usr.bin/openssl/man/dsaparam.1 stable/11/secure/usr.bin/openssl/man/ec.1 stable/11/secure/usr.bin/openssl/man/ecparam.1 stable/11/secure/usr.bin/openssl/man/enc.1 stable/11/secure/usr.bin/openssl/man/errstr.1 stable/11/secure/usr.bin/openssl/man/gendsa.1 stable/11/secure/usr.bin/openssl/man/genpkey.1 stable/11/secure/usr.bin/openssl/man/genrsa.1 stable/11/secure/usr.bin/openssl/man/nseq.1 stable/11/secure/usr.bin/openssl/man/ocsp.1 stable/11/secure/usr.bin/openssl/man/openssl.1 stable/11/secure/usr.bin/openssl/man/passwd.1 stable/11/secure/usr.bin/openssl/man/pkcs12.1 stable/11/secure/usr.bin/openssl/man/pkcs7.1 stable/11/secure/usr.bin/openssl/man/pkcs8.1 stable/11/secure/usr.bin/openssl/man/pkey.1 stable/11/secure/usr.bin/openssl/man/pkeyparam.1 stable/11/secure/usr.bin/openssl/man/pkeyutl.1 stable/11/secure/usr.bin/openssl/man/rand.1 stable/11/secure/usr.bin/openssl/man/req.1 stable/11/secure/usr.bin/openssl/man/rsa.1 stable/11/secure/usr.bin/openssl/man/rsautl.1 stable/11/secure/usr.bin/openssl/man/s_client.1 stable/11/secure/usr.bin/openssl/man/s_server.1 stable/11/secure/usr.bin/openssl/man/s_time.1 stable/11/secure/usr.bin/openssl/man/sess_id.1 stable/11/secure/usr.bin/openssl/man/smime.1 stable/11/secure/usr.bin/openssl/man/speed.1 stable/11/secure/usr.bin/openssl/man/spkac.1 stable/11/secure/usr.bin/openssl/man/ts.1 stable/11/secure/usr.bin/openssl/man/tsget.1 stable/11/secure/usr.bin/openssl/man/verify.1 stable/11/secure/usr.bin/openssl/man/version.1 stable/11/secure/usr.bin/openssl/man/x509.1 stable/11/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/crypto/openssl/CHANGES ============================================================================== --- stable/11/crypto/openssl/CHANGES Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/CHANGES Fri Aug 17 18:32:53 2018 (r337982) @@ -7,6 +7,64 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.0.2o and 1.0.2p [14 Aug 2018] + + *) Client DoS due to large DH parameter + + During key agreement in a TLS handshake using a DH(E) based ciphersuite a + malicious server can send a very large prime value to the client. This will + cause the client to spend an unreasonably long period of time generating a + key for this prime resulting in a hang until the client has finished. This + could be exploited in a Denial Of Service attack. + + This issue was reported to OpenSSL on 5th June 2018 by Guido Vranken + (CVE-2018-0732) + [Guido Vranken] + + *) Cache timing vulnerability in RSA Key Generation + + The OpenSSL RSA Key generation algorithm has been shown to be vulnerable to + a cache timing side channel attack. An attacker with sufficient access to + mount cache timing attacks during the RSA key generation process could + recover the private key. + + This issue was reported to OpenSSL on 4th April 2018 by Alejandro Cabrera + Aldaya, Billy Brumley, Cesar Pereida Garcia and Luis Manuel Alvarez Tapia. + (CVE-2018-0737) + [Billy Brumley] + + *) Make EVP_PKEY_asn1_new() a bit stricter about its input. A NULL pem_str + parameter is no longer accepted, as it leads to a corrupt table. NULL + pem_str is reserved for alias entries only. + [Richard Levitte] + + *) Revert blinding in ECDSA sign and instead make problematic addition + length-invariant. Switch even to fixed-length Montgomery multiplication. + [Andy Polyakov] + + *) Change generating and checking of primes so that the error rate of not + being prime depends on the intended use based on the size of the input. + For larger primes this will result in more rounds of Miller-Rabin. + The maximal error rate for primes with more than 1080 bits is lowered + to 2^-128. + [Kurt Roeckx, Annie Yousar] + + *) Increase the number of Miller-Rabin rounds for DSA key generating to 64. + [Kurt Roeckx] + + *) Add blinding to ECDSA and DSA signatures to protect against side channel + attacks discovered by Keegan Ryan (NCC Group). + [Matt Caswell] + + *) When unlocking a pass phrase protected PEM file or PKCS#8 container, we + now allow empty (zero character) pass phrases. + [Richard Levitte] + + *) Certificate time validation (X509_cmp_time) enforces stricter + compliance with RFC 5280. Fractional seconds and timezone offsets + are no longer allowed. + [Emilia Käsper] + Changes between 1.0.2n and 1.0.2o [27 Mar 2018] *) Constructed ASN.1 types with a recursive definition could exceed the stack Modified: stable/11/crypto/openssl/CONTRIBUTING ============================================================================== --- stable/11/crypto/openssl/CONTRIBUTING Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/CONTRIBUTING Fri Aug 17 18:32:53 2018 (r337982) @@ -1,27 +1,27 @@ -HOW TO CONTRIBUTE PATCHES TO OpenSSL ------------------------------------- +HOW TO CONTRIBUTE TO OpenSSL +---------------------------- (Please visit https://www.openssl.org/community/getting-started.html for other ideas about how to contribute.) -Development is coordinated on the openssl-dev mailing list (see the -above link or https://mta.openssl.org for information on subscribing). -If you are unsure as to whether a feature will be useful for the general -OpenSSL community you might want to discuss it on the openssl-dev mailing -list first. Someone may be already working on the same thing or there -may be a good reason as to why that feature isn't implemented. +Development is done on GitHub, https://github.com/openssl/openssl. -To submit a patch, make a pull request on GitHub. If you think the patch -could use feedback from the community, please start a thread on openssl-dev -to discuss it. +To request new features or report bugs, please open an issue on GitHub -Having addressed the following items before the PR will help make the -acceptance and review process faster: +To submit a patch, please open a pull request on GitHub. If you are thinking +of making a large contribution, open an issue for it before starting work, +to get comments from the community. Someone may be already working on +the same thing or there may be reasons why that feature isn't implemented. - 1. Anything other than trivial contributions will require a contributor - licensing agreement, giving us permission to use your code. See - https://www.openssl.org/policies/cla.html for details. +To make it easier to review and accept your pull request, please follow these +guidelines: + 1. Anything other than a trivial contribution requires a Contributor + License Agreement (CLA), giving us permission to use your code. See + https://www.openssl.org/policies/cla.html for details. If your + contribution is too small to require a CLA, put "CLA: trivial" on a + line by itself in your commit message body. + 2. All source files should start with the following text (with appropriate comment characters at the start of each line and the year(s) updated): @@ -34,21 +34,21 @@ acceptance and review process faster: https://www.openssl.org/source/license.html 3. Patches should be as current as possible; expect to have to rebase - often. We do not accept merge commits; You will be asked to remove - them before a patch is considered acceptable. + often. We do not accept merge commits, you will have to remove them + (usually by rebasing) before it will be acceptable. 4. Patches should follow our coding style (see - https://www.openssl.org/policies/codingstyle.html) and compile without - warnings. Where gcc or clang is availble you should use the + https://www.openssl.org/policies/codingstyle.html) and compile + without warnings. Where gcc or clang is available you should use the --strict-warnings Configure option. OpenSSL compiles on many varied - platforms: try to ensure you only use portable features. - Clean builds via Travis and AppVeyor are expected, and done whenever - a PR is created or updated. + platforms: try to ensure you only use portable features. Clean builds + via Travis and AppVeyor are required, and they are started automatically + whenever a PR is created or updated. 5. When at all possible, patches should include tests. These can either be added to an existing test, or completely new. Please see test/README for information on the test framework. 6. New features or changed functionality must include - documentation. Please look at the "pod" files in doc/apps, doc/crypto - and doc/ssl for examples of our style. + documentation. Please look at the "pod" files in doc for + examples of our style. Modified: stable/11/crypto/openssl/Configure ============================================================================== --- stable/11/crypto/openssl/Configure Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/Configure Fri Aug 17 18:32:53 2018 (r337982) @@ -1173,6 +1173,7 @@ foreach (sort (keys %disabled)) $depflags .= " -DOPENSSL_NO_$ALGO"; } } + if (/^comp$/) { $zlib = 0; } } print "\n"; @@ -1671,6 +1672,13 @@ while () { } close(PIPE); +# Xcode did not handle $cc -M before clang support +my $cc_as_makedepend = 0; +if ($predefined{__GNUC__} >= 3 && !(defined($predefined{__APPLE_CC__}) + && !defined($predefined{__clang__}))) { + $cc_as_makedepend = 1; +} + if ($strict_warnings) { my $wopt; @@ -1730,14 +1738,14 @@ while () s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/; s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/; s/^RC=\s*/RC= \$\(CROSS_COMPILE\)/; - s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $predefined{__GNUC__} >= 3; + s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc_as_makedepend; } else { s/^CC=.*$/CC= $cc/; s/^AR=\s*ar/AR= $ar/; s/^RANLIB=.*/RANLIB= $ranlib/; s/^RC=.*/RC= $windres/; - s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $predefined{__GNUC__} >= 3; + s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc_as_makedepend; } s/^CFLAG=.*$/CFLAG= $cflags/; s/^DEPFLAG=.*$/DEPFLAG=$depflags/; Modified: stable/11/crypto/openssl/Makefile ============================================================================== --- stable/11/crypto/openssl/Makefile Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/Makefile Fri Aug 17 18:32:53 2018 (r337982) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2o +VERSION=1.0.2p MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 Modified: stable/11/crypto/openssl/NEWS ============================================================================== --- stable/11/crypto/openssl/NEWS Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/NEWS Fri Aug 17 18:32:53 2018 (r337982) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2o and OpenSSL 1.0.2p [14 Aug 2018] + + o Client DoS due to large DH parameter (CVE-2018-0732) + o Cache timing vulnerability in RSA Key Generation (CVE-2018-0737) + Major changes between OpenSSL 1.0.2n and OpenSSL 1.0.2o [27 Mar 2018] o Constructed ASN.1 types with a recursive definition could exceed the Modified: stable/11/crypto/openssl/README ============================================================================== --- stable/11/crypto/openssl/README Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/README Fri Aug 17 18:32:53 2018 (r337982) @@ -1,7 +1,7 @@ - OpenSSL 1.0.2o 27 Mar 2018 + OpenSSL 1.0.2p 14 Aug 2018 - Copyright (c) 1998-2015 The OpenSSL Project + Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson All rights reserved. Modified: stable/11/crypto/openssl/apps/apps.c ============================================================================== --- stable/11/crypto/openssl/apps/apps.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/apps.c Fri Aug 17 18:32:53 2018 (r337982) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1359,7 +1359,8 @@ int set_name_ex(unsigned long *flags, const char *arg) }; if (set_multi_opts(flags, arg, ex_tbl) == 0) return 0; - if ((*flags & XN_FLAG_SEP_MASK) == 0) + if (*flags != XN_FLAG_COMPAT + && (*flags & XN_FLAG_SEP_MASK) == 0) *flags |= XN_FLAG_SEP_CPLUS_SPC; return 1; } Modified: stable/11/crypto/openssl/apps/asn1pars.c ============================================================================== --- stable/11/crypto/openssl/apps/asn1pars.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/asn1pars.c Fri Aug 17 18:32:53 2018 (r337982) @@ -295,7 +295,7 @@ int MAIN(int argc, char **argv) ASN1_TYPE *atmp; int typ; j = atoi(sk_OPENSSL_STRING_value(osk, i)); - if (j == 0) { + if (j <= 0 || j >= tmplen) { BIO_printf(bio_err, "'%s' is an invalid number\n", sk_OPENSSL_STRING_value(osk, i)); continue; @@ -327,14 +327,14 @@ int MAIN(int argc, char **argv) num = tmplen; } - if (offset >= num) { - BIO_printf(bio_err, "Error: offset too large\n"); + if (offset < 0 || offset >= num) { + BIO_printf(bio_err, "Error: offset out of range\n"); goto end; } num -= offset; - if ((length == 0) || ((long)length > num)) + if (length == 0 || length > (unsigned int)num) length = (unsigned int)num; if (derout) { if (BIO_write(derout, str + offset, length) != (int)length) { Modified: stable/11/crypto/openssl/apps/ca.c ============================================================================== --- stable/11/crypto/openssl/apps/ca.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/ca.c Fri Aug 17 18:32:53 2018 (r337982) @@ -1176,10 +1176,13 @@ int MAIN(int argc, char **argv) if (j > 0) { total_done++; BIO_printf(bio_err, "\n"); - if (!BN_add_word(serial, 1)) + if (!BN_add_word(serial, 1)) { + X509_free(x); goto err; + } if (!sk_X509_push(cert_sk, x)) { BIO_printf(bio_err, "Memory allocation failure\n"); + X509_free(x); goto err; } } Modified: stable/11/crypto/openssl/apps/ocsp.c ============================================================================== --- stable/11/crypto/openssl/apps/ocsp.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/ocsp.c Fri Aug 17 18:32:53 2018 (r337982) @@ -4,7 +4,7 @@ * 2000. */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -787,7 +787,6 @@ int MAIN(int argc, char **argv) OCSP_response_status_str(i), i); if (ignore_err) goto redo_accept; - ret = 0; goto end; } Modified: stable/11/crypto/openssl/apps/passwd.c ============================================================================== --- stable/11/crypto/openssl/apps/passwd.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/passwd.c Fri Aug 17 18:32:53 2018 (r337982) @@ -306,9 +306,9 @@ static char *md5crypt(const char *passwd, const char * out_buf[0] = '$'; out_buf[1] = 0; assert(strlen(magic) <= 4); /* "1" or "apr1" */ - strncat(out_buf, magic, 4); - strncat(out_buf, "$", 1); - strncat(out_buf, salt, 8); + BUF_strlcat(out_buf, magic, sizeof(out_buf)); + BUF_strlcat(out_buf, "$", sizeof(out_buf)); + BUF_strlcat(out_buf, salt, sizeof(out_buf)); assert(strlen(out_buf) <= 6 + 8); /* "$apr1$..salt.." */ salt_out = out_buf + 2 + strlen(magic); salt_len = strlen(salt_out); Modified: stable/11/crypto/openssl/apps/s_apps.h ============================================================================== --- stable/11/crypto/openssl/apps/s_apps.h Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/s_apps.h Fri Aug 17 18:32:53 2018 (r337982) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -152,9 +152,8 @@ typedef fd_mask fd_set; #define PROTOCOL "tcp" int do_server(int port, int type, int *ret, - int (*cb) (char *hostname, int s, int stype, - unsigned char *context), unsigned char *context, - int naccept); + int (*cb) (int s, int stype, unsigned char *context), + unsigned char *context, int naccept); #ifdef HEADER_X509_H int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx); #endif Modified: stable/11/crypto/openssl/apps/s_client.c ============================================================================== --- stable/11/crypto/openssl/apps/s_client.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/s_client.c Fri Aug 17 18:32:53 2018 (r337982) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -337,7 +337,7 @@ static void sc_usage(void) BIO_printf(bio_err, " -prexit - print session information even on connection failure\n"); BIO_printf(bio_err, - " -showcerts - show all certificates in the chain\n"); + " -showcerts - Show all certificates sent by the server\n"); BIO_printf(bio_err, " -debug - extra output\n"); #ifdef WATT32 BIO_printf(bio_err, " -wdebug - WATT-32 tcp debugging\n"); Modified: stable/11/crypto/openssl/apps/s_server.c ============================================================================== --- stable/11/crypto/openssl/apps/s_server.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/s_server.c Fri Aug 17 18:32:53 2018 (r337982) @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -209,9 +209,9 @@ typedef unsigned int u_int; #ifndef OPENSSL_NO_RSA static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength); #endif -static int sv_body(char *hostname, int s, int stype, unsigned char *context); -static int www_body(char *hostname, int s, int stype, unsigned char *context); -static int rev_body(char *hostname, int s, int stype, unsigned char *context); +static int sv_body(int s, int stype, unsigned char *context); +static int www_body(int s, int stype, unsigned char *context); +static int rev_body(int s, int stype, unsigned char *context); static void close_accept_socket(void); static void sv_usage(void); static int init_ssl_connection(SSL *s); @@ -1087,11 +1087,14 @@ int MAIN(int argc, char *argv[]) char *chCApath = NULL, *chCAfile = NULL; char *vfyCApath = NULL, *vfyCAfile = NULL; unsigned char *context = NULL; +#ifndef OPENSSL_NO_DH char *dhfile = NULL; + int no_dhe = 0; +#endif int badop = 0; int ret = 1; int build_chain = 0; - int no_tmp_rsa = 0, no_dhe = 0, no_ecdhe = 0, nocert = 0; + int no_tmp_rsa = 0, no_ecdhe = 0, nocert = 0; int state = 0; const SSL_METHOD *meth = NULL; int socket_type = SOCK_STREAM; @@ -1239,11 +1242,15 @@ int MAIN(int argc, char *argv[]) if (--argc < 1) goto bad; s_chain_file = *(++argv); - } else if (strcmp(*argv, "-dhparam") == 0) { + } +#ifndef OPENSSL_NO_DH + else if (strcmp(*argv, "-dhparam") == 0) { if (--argc < 1) goto bad; dhfile = *(++argv); - } else if (strcmp(*argv, "-dcertform") == 0) { + } +#endif + else if (strcmp(*argv, "-dcertform") == 0) { if (--argc < 1) goto bad; s_dcert_format = str2fmt(*(++argv)); @@ -1390,9 +1397,13 @@ int MAIN(int argc, char *argv[]) verify_quiet = 1; } else if (strcmp(*argv, "-no_tmp_rsa") == 0) { no_tmp_rsa = 1; - } else if (strcmp(*argv, "-no_dhe") == 0) { + } +#ifndef OPENSSL_NO_DH + else if (strcmp(*argv, "-no_dhe") == 0) { no_dhe = 1; - } else if (strcmp(*argv, "-no_ecdhe") == 0) { + } +#endif + else if (strcmp(*argv, "-no_ecdhe") == 0) { no_ecdhe = 1; } else if (strcmp(*argv, "-no_resume_ephemeral") == 0) { no_resume_ephemeral = 1; @@ -2165,7 +2176,7 @@ static void print_stats(BIO *bio, SSL_CTX *ssl_ctx) SSL_CTX_sess_get_cache_size(ssl_ctx)); } -static int sv_body(char *hostname, int s, int stype, unsigned char *context) +static int sv_body(int s, int stype, unsigned char *context) { char *buf = NULL; fd_set readfds; @@ -2780,7 +2791,7 @@ static int load_CA(SSL_CTX *ctx, char *file) } #endif -static int www_body(char *hostname, int s, int stype, unsigned char *context) +static int www_body(int s, int stype, unsigned char *context) { char *buf = NULL; int ret = 1; @@ -3183,7 +3194,7 @@ static int www_body(char *hostname, int s, int stype, return (ret); } -static int rev_body(char *hostname, int s, int stype, unsigned char *context) +static int rev_body(int s, int stype, unsigned char *context) { char *buf = NULL; int i; Modified: stable/11/crypto/openssl/apps/s_socket.c ============================================================================== --- stable/11/crypto/openssl/apps/s_socket.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/s_socket.c Fri Aug 17 18:32:53 2018 (r337982) @@ -109,7 +109,7 @@ static int ssl_sock_init(void); static int init_client_ip(int *sock, unsigned char ip[4], int port, int type); static int init_server(int *sock, int port, int type); static int init_server_long(int *sock, int port, char *ip, int type); -static int do_accept(int acc_sock, int *sock, char **host); +static int do_accept(int acc_sock, int *sock); static int host_ip(char *str, unsigned char ip[4]); # ifdef OPENSSL_SYS_WIN16 @@ -290,12 +290,10 @@ static int init_client_ip(int *sock, unsigned char ip[ } int do_server(int port, int type, int *ret, - int (*cb) (char *hostname, int s, int stype, - unsigned char *context), unsigned char *context, - int naccept) + int (*cb) (int s, int stype, unsigned char *context), + unsigned char *context, int naccept) { int sock; - char *name = NULL; int accept_socket = 0; int i; @@ -308,15 +306,13 @@ int do_server(int port, int type, int *ret, } for (;;) { if (type == SOCK_STREAM) { - if (do_accept(accept_socket, &sock, &name) == 0) { + if (do_accept(accept_socket, &sock) == 0) { SHUTDOWN(accept_socket); return (0); } } else sock = accept_socket; - i = (*cb) (name, sock, type, context); - if (name != NULL) - OPENSSL_free(name); + i = (*cb) (sock, type, context); if (type == SOCK_STREAM) SHUTDOWN2(sock); if (naccept != -1) @@ -386,30 +382,24 @@ static int init_server(int *sock, int port, int type) return (init_server_long(sock, port, NULL, type)); } -static int do_accept(int acc_sock, int *sock, char **host) +static int do_accept(int acc_sock, int *sock) { int ret; - struct hostent *h1, *h2; - static struct sockaddr_in from; - int len; -/* struct linger ling; */ if (!ssl_sock_init()) - return (0); + return 0; # ifndef OPENSSL_SYS_WINDOWS redoit: # endif - memset((char *)&from, 0, sizeof(from)); - len = sizeof(from); /* * Note: under VMS with SOCKETSHR the fourth parameter is currently of * type (int *) whereas under other systems it is (void *) if you don't * have a cast it will choke the compiler: if you do have a cast then you * can either go for (int *) or (void *). */ - ret = accept(acc_sock, (struct sockaddr *)&from, (void *)&len); + ret = accept(acc_sock, NULL, NULL); if (ret == INVALID_SOCKET) { # if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)) int i; @@ -425,56 +415,11 @@ static int do_accept(int acc_sock, int *sock, char **h fprintf(stderr, "errno=%d ", errno); perror("accept"); # endif - return (0); + return 0; } -/*- - ling.l_onoff=1; - ling.l_linger=0; - i=setsockopt(ret,SOL_SOCKET,SO_LINGER,(char *)&ling,sizeof(ling)); - if (i < 0) { perror("linger"); return(0); } - i=0; - i=setsockopt(ret,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); - if (i < 0) { perror("keepalive"); return(0); } -*/ - - if (host == NULL) - goto end; -# ifndef BIT_FIELD_LIMITS - /* I should use WSAAsyncGetHostByName() under windows */ - h1 = gethostbyaddr((char *)&from.sin_addr.s_addr, - sizeof(from.sin_addr.s_addr), AF_INET); -# else - h1 = gethostbyaddr((char *)&from.sin_addr, - sizeof(struct in_addr), AF_INET); -# endif - if (h1 == NULL) { - BIO_printf(bio_err, "bad gethostbyaddr\n"); - *host = NULL; - /* return(0); */ - } else { - if ((*host = (char *)OPENSSL_malloc(strlen(h1->h_name) + 1)) == NULL) { - perror("OPENSSL_malloc"); - closesocket(ret); - return (0); - } - BUF_strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1); - - h2 = GetHostByName(*host); - if (h2 == NULL) { - BIO_printf(bio_err, "gethostbyname failure\n"); - closesocket(ret); - return (0); - } - if (h2->h_addrtype != AF_INET) { - BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n"); - closesocket(ret); - return (0); - } - } - end: *sock = ret; - return (1); + return 1; } int extract_host_port(char *str, char **host_ptr, unsigned char *ip, Modified: stable/11/crypto/openssl/apps/verify.c ============================================================================== --- stable/11/crypto/openssl/apps/verify.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/apps/verify.c Fri Aug 17 18:32:53 2018 (r337982) @@ -277,6 +277,7 @@ static int check(X509_STORE *ctx, char *file, X509_STORE_set_flags(ctx, vflags); if (!X509_STORE_CTX_init(csc, ctx, x, uchain)) { ERR_print_errors(bio_err); + X509_STORE_CTX_free(csc); goto end; } if (tchain) Modified: stable/11/crypto/openssl/crypto/Makefile ============================================================================== --- stable/11/crypto/openssl/crypto/Makefile Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/Makefile Fri Aug 17 18:32:53 2018 (r337982) @@ -46,7 +46,7 @@ SRC= $(LIBSRC) EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \ ossl_typ.h HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \ - constant_time_locl.h $(EXHEADER) + constant_time_locl.h bn_int.h $(EXHEADER) ALL= $(GENERAL) $(SRC) $(HEADER) Modified: stable/11/crypto/openssl/crypto/asn1/a_bool.c ============================================================================== --- stable/11/crypto/openssl/crypto/asn1/a_bool.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/asn1/a_bool.c Fri Aug 17 18:32:53 2018 (r337982) @@ -63,17 +63,31 @@ int i2d_ASN1_BOOLEAN(int a, unsigned char **pp) { int r; - unsigned char *p; + unsigned char *p, *allocated = NULL; r = ASN1_object_size(0, 1, V_ASN1_BOOLEAN); if (pp == NULL) return (r); - p = *pp; + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(r)) == NULL) { + ASN1err(ASN1_F_I2D_ASN1_BOOLEAN, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } + ASN1_put_object(&p, 0, 1, V_ASN1_BOOLEAN, V_ASN1_UNIVERSAL); - *(p++) = (unsigned char)a; - *pp = p; - return (r); + *p = (unsigned char)a; + + + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + 1; + return r; } int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length) Modified: stable/11/crypto/openssl/crypto/asn1/a_object.c ============================================================================== --- stable/11/crypto/openssl/crypto/asn1/a_object.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/asn1/a_object.c Fri Aug 17 18:32:53 2018 (r337982) @@ -66,7 +66,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) { - unsigned char *p; + unsigned char *p, *allocated = NULL; int objsize; if ((a == NULL) || (a->data == NULL)) @@ -76,13 +76,24 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp if (pp == NULL || objsize == -1) return objsize; - p = *pp; + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(objsize)) == NULL) { + ASN1err(ASN1_F_I2D_ASN1_OBJECT, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } + ASN1_put_object(&p, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL); memcpy(p, a->data, a->length); - p += a->length; - *pp = p; - return (objsize); + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + a->length; + return objsize; } int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) Modified: stable/11/crypto/openssl/crypto/asn1/a_strex.c ============================================================================== --- stable/11/crypto/openssl/crypto/asn1/a_strex.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/asn1/a_strex.c Fri Aug 17 18:32:53 2018 (r337982) @@ -4,7 +4,7 @@ * 2000. */ /* ==================================================================== - * Copyright (c) 2000 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -194,18 +194,38 @@ static int do_buf(unsigned char *buf, int buflen, int type, unsigned char flags, char *quotes, char_io *io_ch, void *arg) { - int i, outlen, len; + int i, outlen, len, charwidth; unsigned char orflags, *p, *q; unsigned long c; p = buf; q = buf + buflen; outlen = 0; + charwidth = type & BUF_TYPE_WIDTH_MASK; + + switch (charwidth) { + case 4: + if (buflen & 3) { + ASN1err(ASN1_F_DO_BUF, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH); + return -1; + } + break; + case 2: + if (buflen & 1) { + ASN1err(ASN1_F_DO_BUF, ASN1_R_INVALID_BMPSTRING_LENGTH); + return -1; + } + break; + default: + break; + } + while (p != q) { if (p == buf && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_FIRST_ESC_2253; else orflags = 0; - switch (type & BUF_TYPE_WIDTH_MASK) { + + switch (charwidth) { case 4: c = ((unsigned long)*p++) << 24; c |= ((unsigned long)*p++) << 16; @@ -226,6 +246,7 @@ static int do_buf(unsigned char *buf, int buflen, i = UTF8_getc(p, buflen, &c); if (i < 0) return -1; /* Invalid UTF8String */ + buflen -= i; p += i; break; default: Modified: stable/11/crypto/openssl/crypto/asn1/ameth_lib.c ============================================================================== --- stable/11/crypto/openssl/crypto/asn1/ameth_lib.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/asn1/ameth_lib.c Fri Aug 17 18:32:53 2018 (r337982) @@ -3,7 +3,7 @@ * 2006. */ /* ==================================================================== - * Copyright (c) 2006 The OpenSSL Project. All rights reserved. + * Copyright (c) 2006-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -304,6 +304,18 @@ EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int fl goto err; } else ameth->info = NULL; + + /* + * One of the following must be true: + * + * pem_str == NULL AND ASN1_PKEY_ALIAS is set + * pem_str != NULL AND ASN1_PKEY_ALIAS is clear + * + * Anything else is an error and may lead to a corrupt ASN1 method table + */ + if (!((pem_str == NULL && (flags & ASN1_PKEY_ALIAS) != 0) + || (pem_str != NULL && (flags & ASN1_PKEY_ALIAS) == 0))) + goto err; if (pem_str) { ameth->pem_str = BUF_strdup(pem_str); Modified: stable/11/crypto/openssl/crypto/asn1/asn1.h ============================================================================== --- stable/11/crypto/openssl/crypto/asn1/asn1.h Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/asn1/asn1.h Fri Aug 17 18:32:53 2018 (r337982) @@ -1164,6 +1164,7 @@ int SMIME_text(BIO *in, BIO *out); * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + void ERR_load_ASN1_strings(void); /* Error codes for the ASN1 functions. */ @@ -1264,7 +1265,10 @@ void ERR_load_ASN1_strings(void); # define ASN1_F_D2I_X509 156 # define ASN1_F_D2I_X509_CINF 157 # define ASN1_F_D2I_X509_PKEY 159 +# define ASN1_F_DO_BUF 221 # define ASN1_F_I2D_ASN1_BIO_STREAM 211 +# define ASN1_F_I2D_ASN1_BOOLEAN 223 +# define ASN1_F_I2D_ASN1_OBJECT 222 # define ASN1_F_I2D_ASN1_SET 188 # define ASN1_F_I2D_ASN1_TIME 160 # define ASN1_F_I2D_DSA_PUBKEY 161 @@ -1414,7 +1418,7 @@ void ERR_load_ASN1_strings(void); # define ASN1_R_WRONG_TAG 168 # define ASN1_R_WRONG_TYPE 169 -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif Modified: stable/11/crypto/openssl/crypto/asn1/asn1_err.c ============================================================================== --- stable/11/crypto/openssl/crypto/asn1/asn1_err.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/asn1/asn1_err.c Fri Aug 17 18:32:53 2018 (r337982) @@ -166,7 +166,10 @@ static ERR_STRING_DATA ASN1_str_functs[] = { {ERR_FUNC(ASN1_F_D2I_X509), "D2I_X509"}, {ERR_FUNC(ASN1_F_D2I_X509_CINF), "D2I_X509_CINF"}, {ERR_FUNC(ASN1_F_D2I_X509_PKEY), "d2i_X509_PKEY"}, + {ERR_FUNC(ASN1_F_DO_BUF), "DO_BUF"}, {ERR_FUNC(ASN1_F_I2D_ASN1_BIO_STREAM), "i2d_ASN1_bio_stream"}, + {ERR_FUNC(ASN1_F_I2D_ASN1_BOOLEAN), "i2d_ASN1_BOOLEAN"}, + {ERR_FUNC(ASN1_F_I2D_ASN1_OBJECT), "i2d_ASN1_OBJECT"}, {ERR_FUNC(ASN1_F_I2D_ASN1_SET), "i2d_ASN1_SET"}, {ERR_FUNC(ASN1_F_I2D_ASN1_TIME), "I2D_ASN1_TIME"}, {ERR_FUNC(ASN1_F_I2D_DSA_PUBKEY), "i2d_DSA_PUBKEY"}, Modified: stable/11/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- stable/11/crypto/openssl/crypto/asn1/tasn_enc.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/asn1/tasn_enc.c Fri Aug 17 18:32:53 2018 (r337982) @@ -4,7 +4,7 @@ * 2000. */ /* ==================================================================== - * Copyright (c) 2000-2004 The OpenSSL Project. All rights reserved. + * Copyright (c) 2000-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -588,6 +588,8 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout otmp = (ASN1_OBJECT *)*pval; cont = otmp->data; len = otmp->length; + if (cont == NULL || len == 0) + return -1; break; case V_ASN1_NULL: Modified: stable/11/crypto/openssl/crypto/bio/bss_log.c ============================================================================== --- stable/11/crypto/openssl/crypto/bio/bss_log.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/bio/bss_log.c Fri Aug 17 18:32:53 2018 (r337982) @@ -1,6 +1,6 @@ /* crypto/bio/bss_log.c */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -242,7 +242,7 @@ static int MS_CALLBACK slg_write(BIO *b, const char *i if ((buf = (char *)OPENSSL_malloc(inl + 1)) == NULL) { return (0); } - strncpy(buf, in, inl); + memcpy(buf, in, inl); buf[inl] = '\0'; i = 0; Modified: stable/11/crypto/openssl/crypto/bio/bss_mem.c ============================================================================== --- stable/11/crypto/openssl/crypto/bio/bss_mem.c Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/bio/bss_mem.c Fri Aug 17 18:32:53 2018 (r337982) @@ -188,6 +188,8 @@ static int mem_write(BIO *b, const char *in, int inl) } BIO_clear_retry_flags(b); + if (inl == 0) + return 0; blen = bm->length; if (BUF_MEM_grow_clean(bm, blen + inl) != (blen + inl)) goto end; Modified: stable/11/crypto/openssl/crypto/bn/Makefile ============================================================================== --- stable/11/crypto/openssl/crypto/bn/Makefile Fri Aug 17 18:24:11 2018 (r337981) +++ stable/11/crypto/openssl/crypto/bn/Makefile Fri Aug 17 18:32:53 2018 (r337982) @@ -197,21 +197,24 @@ bn_add.o: ../../include/openssl/e_os2.h ../../include/ bn_add.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_add.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_add.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_add.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_add.c bn_lcl.h +bn_add.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_add.c +bn_add.o: bn_lcl.h bn_asm.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_asm.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_asm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_asm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_asm.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_asm.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_asm.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_asm.c bn_lcl.h +bn_asm.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_asm.c +bn_asm.o: bn_lcl.h bn_blind.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_blind.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_blind.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_blind.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_blind.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_blind.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_blind.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_blind.c bn_lcl.h +bn_blind.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h +bn_blind.o: bn_blind.c bn_lcl.h bn_const.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h bn_const.o: ../../include/openssl/opensslconf.h bn_const.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h @@ -223,7 +226,8 @@ bn_ctx.o: ../../include/openssl/e_os2.h ../../include/ bn_ctx.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_ctx.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_ctx.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_ctx.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_ctx.c bn_lcl.h +bn_ctx.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_ctx.c +bn_ctx.o: bn_lcl.h bn_depr.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_depr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h @@ -231,14 +235,15 @@ bn_depr.o: ../../include/openssl/lhash.h ../../include bn_depr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_depr.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h bn_depr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -bn_depr.o: ../cryptlib.h bn_depr.c bn_lcl.h +bn_depr.o: ../bn_int.h ../cryptlib.h bn_depr.c bn_lcl.h bn_div.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_div.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_div.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_div.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_div.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_div.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_div.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_div.c bn_lcl.h +bn_div.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_div.c +bn_div.o: bn_lcl.h bn_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h bn_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h bn_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h @@ -252,7 +257,7 @@ bn_exp.o: ../../include/openssl/e_os2.h ../../include/ bn_exp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_exp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_exp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_exp.o: ../../include/openssl/symhacks.h ../constant_time_locl.h +bn_exp.o: ../../include/openssl/symhacks.h ../bn_int.h ../constant_time_locl.h bn_exp.o: ../cryptlib.h bn_exp.c bn_lcl.h rsaz_exp.h bn_exp2.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_exp2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h @@ -260,70 +265,80 @@ bn_exp2.o: ../../include/openssl/e_os2.h ../../include bn_exp2.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_exp2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_exp2.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_exp2.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_exp2.c bn_lcl.h +bn_exp2.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_exp2.c +bn_exp2.o: bn_lcl.h bn_gcd.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_gcd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_gcd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_gcd.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_gcd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_gcd.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_gcd.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_gcd.c bn_lcl.h +bn_gcd.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_gcd.c +bn_gcd.o: bn_lcl.h bn_gf2m.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_gf2m.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_gf2m.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_gf2m.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_gf2m.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_gf2m.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_gf2m.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_gf2m.c bn_lcl.h +bn_gf2m.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_gf2m.c +bn_gf2m.o: bn_lcl.h bn_kron.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_kron.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_kron.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_kron.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_kron.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_kron.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_kron.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_kron.c bn_lcl.h +bn_kron.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_kron.c +bn_kron.o: bn_lcl.h bn_lib.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_lib.c +bn_lib.o: ../../include/openssl/symhacks.h ../bn_int.h ../cryptlib.h bn_lcl.h +bn_lib.o: bn_lib.c bn_mod.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_mod.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Aug 17 18:34:09 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 8D2B81077F4C; Fri, 17 Aug 2018 18:34:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF788D620; Fri, 17 Aug 2018 18:34:09 +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 1DE5F4739; Fri, 17 Aug 2018 18:34:09 +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 w7HIY9Dx086730; Fri, 17 Aug 2018 18:34:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HIY7o5086721; Fri, 17 Aug 2018 18:34:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808171834.w7HIY7o5086721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 Aug 2018 18:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337983 - in head: include lib/libc/include lib/libthr lib/libthr/thread share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: include lib/libc/include lib/libthr lib/libthr/thread share/man/man3 X-SVN-Commit-Revision: 337983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 18:34:09 -0000 Author: kib Date: Fri Aug 17 18:34:07 2018 New Revision: 337983 URL: https://svnweb.freebsd.org/changeset/base/337983 Log: Add pthread_get_name_np(3). The function retrieves the thread name previously set by pthread_set_name_np(3). The name is cached in the process memory. Requested by: Willem Jan Withagen Man page update: Yuri Pankov Reviewed by: ian (previous version) Discussed with: arichardson, bjk (man page) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D16702 Modified: head/include/pthread_np.h head/lib/libc/include/namespace.h head/lib/libc/include/un-namespace.h head/lib/libthr/pthread.map head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_info.c head/lib/libthr/thread/thr_private.h head/share/man/man3/Makefile head/share/man/man3/pthread_set_name_np.3 Modified: head/include/pthread_np.h ============================================================================== --- head/include/pthread_np.h Fri Aug 17 18:32:53 2018 (r337982) +++ head/include/pthread_np.h Fri Aug 17 18:34:07 2018 (r337983) @@ -49,6 +49,7 @@ int pthread_attr_setcreatesuspend_np(pthread_attr_t *) int pthread_attr_get_np(pthread_t, pthread_attr_t *); int pthread_attr_getaffinity_np(const pthread_attr_t *, size_t, cpuset_t *); int pthread_attr_setaffinity_np(pthread_attr_t *, size_t, const cpuset_t *); +void pthread_get_name_np(pthread_t, char *, size_t); int pthread_getaffinity_np(pthread_t, size_t, cpuset_t *); int pthread_getthreadid_np(void); int pthread_main_np(void); Modified: head/lib/libc/include/namespace.h ============================================================================== --- head/lib/libc/include/namespace.h Fri Aug 17 18:32:53 2018 (r337982) +++ head/lib/libc/include/namespace.h Fri Aug 17 18:34:07 2018 (r337983) @@ -134,6 +134,7 @@ #define pthread_detach _pthread_detach #define pthread_equal _pthread_equal #define pthread_exit _pthread_exit +#define pthread_get_name_np _pthread_get_name_np #define pthread_getaffinity_np _pthread_getaffinity_np #define pthread_getconcurrency _pthread_getconcurrency #define pthread_getcpuclockid _pthread_getcpuclockid Modified: head/lib/libc/include/un-namespace.h ============================================================================== --- head/lib/libc/include/un-namespace.h Fri Aug 17 18:32:53 2018 (r337982) +++ head/lib/libc/include/un-namespace.h Fri Aug 17 18:34:07 2018 (r337983) @@ -115,6 +115,7 @@ #undef pthread_detach #undef pthread_equal #undef pthread_exit +#undef pthread_get_name_np #undef pthread_getaffinity_np #undef pthread_getconcurrency #undef pthread_getcpuclockid Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Fri Aug 17 18:32:53 2018 (r337982) +++ head/lib/libthr/pthread.map Fri Aug 17 18:34:07 2018 (r337983) @@ -321,3 +321,7 @@ FBSD_1.4 { pthread_mutexattr_getrobust; pthread_mutexattr_setrobust; }; + +FBSD_1.5 { + pthread_get_name_np; +}; Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Fri Aug 17 18:32:53 2018 (r337982) +++ head/lib/libthr/thread/thr_exit.c Fri Aug 17 18:34:07 2018 (r337983) @@ -280,6 +280,9 @@ exit_thread(void) { struct pthread *curthread = _get_curthread(); + free(curthread->name); + curthread->name = NULL; + /* Check if there is thread specific data: */ if (curthread->specific != NULL) { /* Run the thread-specific data destructors: */ Modified: head/lib/libthr/thread/thr_info.c ============================================================================== --- head/lib/libthr/thread/thr_info.c Fri Aug 17 18:32:53 2018 (r337982) +++ head/lib/libthr/thread/thr_info.c Fri Aug 17 18:34:07 2018 (r337983) @@ -2,8 +2,12 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1995-1998 John Birrell + * Copyright (c) 2018 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -43,27 +47,65 @@ __FBSDID("$FreeBSD$"); __weak_reference(_pthread_set_name_np, pthread_set_name_np); +static void +thr_set_name_np(struct pthread *thread, const char *name) +{ + + free(thread->name); + thread->name = strdup(name); +} + /* Set the thread name for debug. */ void _pthread_set_name_np(pthread_t thread, const char *name) { - struct pthread *curthread = _get_curthread(); - int ret = 0; + struct pthread *curthread; + curthread = _get_curthread(); if (curthread == thread) { - if (thr_set_name(thread->tid, name)) - ret = errno; + THR_THREAD_LOCK(curthread, thread); + thr_set_name(thread->tid, name); + thr_set_name_np(thread, name); + THR_THREAD_UNLOCK(curthread, thread); } else { - if ((ret=_thr_find_thread(curthread, thread, 0)) == 0) { + if (_thr_find_thread(curthread, thread, 0) == 0) { if (thread->state != PS_DEAD) { - if (thr_set_name(thread->tid, name)) - ret = errno; + thr_set_name(thread->tid, name); + thr_set_name_np(thread, name); } THR_THREAD_UNLOCK(curthread, thread); } } -#if 0 - /* XXX should return error code. */ - return (ret); -#endif +} + +static void +thr_get_name_np(struct pthread *thread, char *buf, size_t len) +{ + + if (thread->name != NULL) + strlcpy(buf, thread->name, len); + else if (len > 0) + buf[0] = '\0'; +} + +__weak_reference(_pthread_get_name_np, pthread_get_name_np); + +void +_pthread_get_name_np(pthread_t thread, char *buf, size_t len) +{ + struct pthread *curthread; + + curthread = _get_curthread(); + if (curthread == thread) { + THR_THREAD_LOCK(curthread, thread); + thr_get_name_np(thread, buf, len); + THR_THREAD_UNLOCK(curthread, thread); + } else { + if (_thr_find_thread(curthread, thread, 0) == 0) { + if (thread->state != PS_DEAD) + thr_get_name_np(thread, buf, len); + THR_THREAD_UNLOCK(curthread, thread); + } else if (len > 0) + buf[0] = '\0'; + } } Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Fri Aug 17 18:32:53 2018 (r337982) +++ head/lib/libthr/thread/thr_private.h Fri Aug 17 18:34:07 2018 (r337983) @@ -572,6 +572,8 @@ struct pthread { /* Sleep queue */ struct sleepqueue *sleepqueue; + /* pthread_set/get_name_np */ + char *name; }; #define THR_SHOULD_GC(thrd) \ Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Fri Aug 17 18:32:53 2018 (r337982) +++ head/share/man/man3/Makefile Fri Aug 17 18:34:07 2018 (r337983) @@ -334,6 +334,7 @@ PTHREAD_MLINKS+=pthread_rwlock_rdlock.3 pthread_rwlock PTHREAD_MLINKS+=pthread_rwlock_wrlock.3 pthread_rwlock_trywrlock.3 PTHREAD_MLINKS+=pthread_schedparam.3 pthread_getschedparam.3 \ pthread_schedparam.3 pthread_setschedparam.3 +PTHREAD_MLINKS+=pthread_set_name_np.3 pthread_get_name_np.3 PTHREAD_MLINKS+=pthread_spin_init.3 pthread_spin_destroy.3 \ pthread_spin_lock.3 pthread_spin_trylock.3 \ pthread_spin_lock.3 pthread_spin_unlock.3 Modified: head/share/man/man3/pthread_set_name_np.3 ============================================================================== --- head/share/man/man3/pthread_set_name_np.3 Fri Aug 17 18:32:53 2018 (r337982) +++ head/share/man/man3/pthread_set_name_np.3 Fri Aug 17 18:34:07 2018 (r337983) @@ -24,17 +24,20 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2016 +.Dd August 12, 2018 .Dt PTHREAD_SET_NAME_NP 3 .Os .Sh NAME +.Nm pthread_get_name_np , .Nm pthread_set_name_np -.Nd set the thread name +.Nd set and retrieve the thread name .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft void +.Fn pthread_get_name_np "pthread_t thread" "char *name" "size_t len" +.Ft void .Fn pthread_set_name_np "pthread_t thread" "const char *name" .Sh DESCRIPTION The @@ -43,11 +46,32 @@ function applies a copy of the given .Fa name to the given .Fa thread . +.Pp +The +.Fn pthread_get_name_np +function retrieves the +.Fa name +associated with +.Fa thread . +If +.Fn pthread_set_name_np +was not previously called for +.Fa thread , +the buffer pointed to by +.Fa name +will be empty. .Sh ERRORS -Because of the debugging nature of this function, all errors that may +Because of the debugging nature of these functions, all errors that may appear inside are silently ignored. .Sh SEE ALSO .Xr thr_set_name 2 +.Sh STANDARDS +.Fn pthread_set_name_np +and +.Fn pthread_get_name_np +are non-standard extensions. .Sh AUTHORS This manual page was written by -.An Alexey Zelkin Aq Mt phantom@FreeBSD.org . +.An Alexey Zelkin Aq Mt phantom@FreeBSD.org +and +An Yuri Pankov Aq Mt yuripv@yuripv.net . From owner-svn-src-all@freebsd.org Fri Aug 17 18:34: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 D39891077FE4; Fri, 17 Aug 2018 18:34:41 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8409F8D7B0; Fri, 17 Aug 2018 18:34:41 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4F5A98CAC; Fri, 17 Aug 2018 18:34:41 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f46.google.com with SMTP id j81-v6so12564343ite.0; Fri, 17 Aug 2018 11:34:41 -0700 (PDT) X-Gm-Message-State: AOUpUlHn8FHGUFRoUb4HpdJelcWHS1YTo7s0hCZZoCDYdgTeBrYVCJSd YLa+xxlsYpRTl5gt2AZSEayzJcIomLVbgrXq9yk= X-Google-Smtp-Source: AA+uWPylQHMTSJzqcwGP1oD2m+J0SII1gE7mLDVcjrd605iVDrK4Zo1hCDQ98/6ELyLsAdI4mDb1GgyWO8Bqf1Ha7TU= X-Received: by 2002:a02:2b12:: with SMTP id h18-v6mr32245581jaa.10.1534530880772; Fri, 17 Aug 2018 11:34:40 -0700 (PDT) MIME-Version: 1.0 References: <201808152023.w7FKN9LL055254@repo.freebsd.org> <79ad414a-3e8e-3abd-0a8a-4d61b9ccfb4f@yandex.ru> In-Reply-To: <79ad414a-3e8e-3abd-0a8a-4d61b9ccfb4f@yandex.ru> From: Matthew Macy Date: Fri, 17 Aug 2018 11:34:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337866 - in head/sys: net netinet netinet6 To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 18:34:42 -0000 Sorry. I'll take a look. On Fri, Aug 17, 2018 at 05:30 Andrey V. Elsukov wrote: > On 15.08.2018 23:23, Matt Macy wrote: > > Author: mmacy > > Date: Wed Aug 15 20:23:08 2018 > > New Revision: 337866 > > URL: https://svnweb.freebsd.org/changeset/base/337866 > > > > Log: > > Fix in6_multi double free > > > > This is actually several different bugs: > > - The code is not designed to handle inpcb deletion after interface > deletion > > - add reference for inpcb membership > > - The multicast address has to be removed from interface lists when > the refcount > > goes to zero OR when the interface goes away > > - decouple list disconnect from refcount (v6 only for now) > > - ifmultiaddr can exist past being on interface lists > > - add flag for tracking whether or not it's enqueued > > - deferring freeing moptions makes the incpb cleanup code simpler but > opens the > > door wider still to races > > - call inp_gcmoptions synchronously after dropping the the inpcb lock > > > > Fundamentally multicast needs a rewrite - but keep applying band-aids > for now. > > > > Tested by: kp > > Reported by: novel, kp, lwhsu > > > > Modified: > > head/sys/net/if.c > > head/sys/net/if_var.h > > head/sys/netinet/in_mcast.c > > head/sys/netinet/in_pcb.c > > head/sys/netinet/ip_carp.c > > head/sys/netinet6/in6_ifattach.c > > head/sys/netinet6/in6_mcast.c > > head/sys/netinet6/in6_var.h > > head/sys/netinet6/mld6.c > > Hi, > > After this commit my test machine panics just after boot finishes. > Reverting this commit helps. > Machine has two interfaces in failover lagg. One interface is not > connected. > > FreeBSD 12.0-ALPHA2 (GENERIC) #2 r337961M: Fri Aug 17 14:54:48 MSK 2018 > > # ifconfig > em0: flags=8843 metric 0 mtu 1500 > > options=209b > ether 00:22:4d:6a:5e:b9 > media: Ethernet autoselect > status: no carrier > nd6 options=21 > re0: flags=8843 metric 0 mtu 1500 > > options=8209b > ether 00:22:4d:6a:5e:b9 > hwaddr 1c:bd:b9:de:0d:7d > media: Ethernet autoselect (1000baseT ) > status: active > nd6 options=21 > lagg0: flags=8843 metric 0 mtu 1500 > > options=209b > ether 00:22:4d:6a:5e:b9 > inet6 fe80::222:4dff:fe6a:5eb9%lagg0 prefixlen 64 scopeid 0x5 > inet 10.9.8.6 netmask 0xffffff00 broadcast 10.9.8.255 > laggproto failover lagghash l2,l3,l4 > laggport: em0 flags=1 > laggport: re0 flags=4 > groups: lagg > media: Ethernet autoselect > status: active > nd6 options=21 > > -- > WBR, Andrey V. Elsukov > From owner-svn-src-all@freebsd.org Fri Aug 17 18:37: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 3670410780EB; Fri, 17 Aug 2018 18:37:23 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA48D8D992; Fri, 17 Aug 2018 18:37:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B498F4751; Fri, 17 Aug 2018 18:37:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HIbMqb086927; Fri, 17 Aug 2018 18:37:22 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HIbMs4086926; Fri, 17 Aug 2018 18:37:22 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808171837.w7HIbMs4086926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 17 Aug 2018 18:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337984 - head/tests/sys/netipsec/tunnel X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/netipsec/tunnel X-SVN-Commit-Revision: 337984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 18:37:23 -0000 Author: asomers Date: Fri Aug 17 18:37:22 2018 New Revision: 337984 URL: https://svnweb.freebsd.org/changeset/base/337984 Log: Fix sys/netipsec/tunnel tests after r337736 Originally, these tests accidentally used broadcast addresses when they should've used unicast addresses. That the tests passed prior to r337736 was accidental. Submitted by: ae Reviewed by: olivier MFC after: 2 weeks Modified: head/tests/sys/netipsec/tunnel/utils.subr Modified: head/tests/sys/netipsec/tunnel/utils.subr ============================================================================== --- head/tests/sys/netipsec/tunnel/utils.subr Fri Aug 17 18:34:07 2018 (r337983) +++ head/tests/sys/netipsec/tunnel/utils.subr Fri Aug 17 18:37:22 2018 (r337984) @@ -57,8 +57,8 @@ ist_v4_setup () jexec ipsecA ifconfig ${epair_LAN_A}b 192.0.2.2/30 up jexec ipsecA ifconfig ${epair_PUB_A}a 198.51.100.2/30 up jexec router ifconfig ${epair_PUB_A}b 198.51.100.1/30 up - jexec router ifconfig ${epair_PUB_B}b 198.51.100.6/30 up - jexec ipsecB ifconfig ${epair_PUB_B}a 198.51.100.7/30 up + jexec router ifconfig ${epair_PUB_B}b 198.51.100.5/30 up + jexec ipsecB ifconfig ${epair_PUB_B}a 198.51.100.6/30 up jexec ipsecB ifconfig ${epair_LAN_B}b 203.0.113.2/30 up jexec hostB ifconfig ${epair_LAN_B}a 203.0.113.1/30 up jexec ipsecA sysctl net.inet.ip.forwarding=1 @@ -66,7 +66,7 @@ ist_v4_setup () jexec ipsecB sysctl net.inet.ip.forwarding=1 jexec hostA route add default 192.0.2.2 jexec ipsecA route add default 198.51.100.1 - jexec ipsecB route add default 198.51.100.6 + jexec ipsecB route add default 198.51.100.5 jexec hostB route add default 203.0.113.2 } @@ -109,7 +109,7 @@ ist_setkey() SRC_LAN="192.0.2.0/24" DST_LAN="203.0.113.0/24" SRC_GW="198.51.100.2" - DST_GW="198.51.100.7" + DST_GW="198.51.100.6" else SRC_LAN="2001:db8:1::/64" DST_LAN="2001:db8:45::/64" From owner-svn-src-all@freebsd.org Fri Aug 17 18:38: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 92D72107815A; Fri, 17 Aug 2018 18:38:10 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (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 EAC988DB0F; Fri, 17 Aug 2018 18:38:09 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-x129.google.com with SMTP id f135-v6so6534528lfg.10; Fri, 17 Aug 2018 11:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ur+La+tiWL5IaLPXecl+yVh31N5EwWH+hOLejzFfW+o=; b=EAvggpkbx7PLORrs0FmM6xdp31j9DsRFoA3hGnClGwBY/MAUuqeVY8rXoxYNCcG9rj Oy3nWsbNYwmIUJTUJxdCTgZRyY81CGGZsvU/2Lyy6aBQ9+0R0PgiQrBr/k2h6hKYZD5Q FucYHRdOaXU5ycoGdSJXNyTK1OogEdb5g8Svei8n91sbHopwu+GYIL/sy2kvB9hkwbOS Vy2Dc60k/Gdd5Z9AvWaOOhHDZTk33uNHiKoqCHR+5vtVM9Rv8o7qzuBhaai2yAKx27Cj XfVdOyXlAD+WeGAM4FvjS0DNkkIidJhbaZMugNtb7DleJNnGzQIEwDzs2dKX89zi2/8n ZHGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ur+La+tiWL5IaLPXecl+yVh31N5EwWH+hOLejzFfW+o=; b=Qo37Td4j3wefck2hWfNnXA3XoMJaNPW4svZe8OhdoBgPxNl4hjriKr5ElBZluwweDo eZeOCIjoprSoksiE4/ry1qY6YSp5mLHiImMvXdho4726PHOoZPnqHsBFa1tpx9N815cZ O8MN9d4/fNZ1key/hmDJERLht3jb79Rhnmr+nWwWtN7/6q6wLgHwhsksNvD3LTSKukOr vyOlnFxBdFVXBVX62pZRRMAvsrTDqRVGFhX9u229ujLl3qi290FLM8AB88vmui+Mjwa2 xva776fnZvIdz0fFZhKa6DLmUGwv4DD1vZ001oS0Dgp/wpRdGMEqBzN2wGp7T181RDyr 9pjg== X-Gm-Message-State: AOUpUlFmV04to1qcsrZ/O4XAtmu6k/Cteyq6H6FMelEHrxR4vR28Bzw6 d3IMm/4bKlcfk/0yIbTQRVzfEJzMDobWhJmdb8p+yw== X-Google-Smtp-Source: AA+uWPxYhwH/NZl2kx3A7VG07c0MWMdqxuahQ6puz34x0oLN7jw/44IYSiB7Epe+v01/itO77j/WcjCA5VSblHtN5Tk= X-Received: by 2002:a19:c94a:: with SMTP id z71-v6mr2314415lff.34.1534531088238; Fri, 17 Aug 2018 11:38:08 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 2002:ab3:7851:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 11:38:07 -0700 (PDT) In-Reply-To: References: <201808140754.w7E7sEFs018313@repo.freebsd.org> From: Alan Somers Date: Fri, 17 Aug 2018 12:38:07 -0600 X-Google-Sender-Auth: dyNjpJ9z4rRvhAtuHInuSj2i35U Message-ID: Subject: Re: svn commit: r337736 - in head/sys: netinet netinet6 To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: "Andrey V. Elsukov" , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 18:38:10 -0000 On Fri, Aug 17, 2018 at 10:53 AM, Olivier Cochard-Labb=C3=A9 wrote: > On Fri, Aug 17, 2018 at 3:33 PM Andrey V. Elsukov > wrote: > >> >> I think it is because IPv4 tests use broadcast addresses in some places. >> The attached patch fixes the test for me. >> >> > I confirm it was a typo from me, and I never intend to badly use these > broadcast addresses. > The patch correctly fix it. > Ok, I committed the patch. Thanks for fixing it, Andrey. -Alan From owner-svn-src-all@freebsd.org Fri Aug 17 19:16: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 A5A251078FC6; Fri, 17 Aug 2018 19:16:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ECEA28EEDF; Fri, 17 Aug 2018 19:16:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id qkEOfX87mWppDqkEPfJZkL; Fri, 17 Aug 2018 13:16:22 -0600 X-Authority-Analysis: v=2.3 cv=YIcrNiOx c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=dapMudl6Dx4A:10 a=xfDLHkLGAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=LdYOoKc5PQHeLCZUTHkA:9 a=CjuIK1q_8ugA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 1736EC98; Fri, 17 Aug 2018 12:16:50 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w7HJG91b062476; Fri, 17 Aug 2018 12:16:09 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w7HJG9Ba062473; Fri, 17 Aug 2018 12:16:09 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201808171916.w7HJG9Ba062473@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: "Conrad E. Meyer" , Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... In-Reply-To: Message from Warner Losh of "Fri, 17 Aug 2018 10:12:30 -0600." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 17 Aug 2018 12:16:09 -0700 X-CMAE-Envelope: MS4wfG/1TEFCDdtv/2/yeHOXKeW/H7caIoRXv8csJ4B1fUFaL5Km0aUfdaMgv6c9k1vVLoVkIlP2UDvnkZxEC/SI5C2r83r/7wMuChGDcadMQBV9hBh5qZGg /0eaC22guY3VRyWKJ5U99aCQt+ImbllLbhgUyxT1YT5KfRBY01ow3Up9BcYM4oVhwdJezgCnMjuvFS10yD3/u71Vy0hJWj5rjG6+F6cNnZMbD6xPKkYDjeoK A+OQCsOWEBkbymc8K0ozZ/yOOWwnmwfhMxADziR6VHMcSrZOWzskvPWeDGXGBZyhdlnnnyUFTicmdNesusmvAlDBt+CFbRjoVKwlhy73KR8= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 19:16:29 -0000 In message , Warner Losh writes: > --0000000000003c9be50573a3d433 > Content-Type: text/plain; charset="UTF-8" > > On Fri, Aug 17, 2018, 10:05 AM Conrad Meyer wrote: [...] > > >> Bring in libsodium to sys/contrib > > >> ... > > > > > > Why wasn't this imported into vendor-sys first? Especially if we intend > > > on tailoring it over time. > > > > We don't intent on tailoring it at all. > > > > We don't document such an exception... history tells me this belief may be > optimistic.. Agreed, which is why importing into vendor is important. It makes the job of some random committer who's chosen to or been tasked to update it easier. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri Aug 17 19:19: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 3C2D4107906F; Fri, 17 Aug 2018 19:19:00 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5E048F074; Fri, 17 Aug 2018 19:18:59 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2ACE4DC1; Fri, 17 Aug 2018 19:18:59 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HJIxlP007682; Fri, 17 Aug 2018 19:18:59 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HJIxx9007681; Fri, 17 Aug 2018 19:18:59 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201808171918.w7HJIxx9007681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Fri, 17 Aug 2018 19:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337985 - stable/11/sys/dev/bge X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/dev/bge X-SVN-Commit-Revision: 337985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 19:19:00 -0000 Author: eugen Date: Fri Aug 17 19:18:59 2018 New Revision: 337985 URL: https://svnweb.freebsd.org/changeset/base/337985 Log: MFC r336461: bge(4): disable MSI for BGE_ASICREV_BCM5784/BGE_CHIPREV_5784_AX found in some MacBook Pro. PR: 229727 Reported by: Stephan Neuhaus and others Tested by: Stephan Neuhaus Approved by: mav (mentor) Modified: stable/11/sys/dev/bge/if_bge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/bge/if_bge.c ============================================================================== --- stable/11/sys/dev/bge/if_bge.c Fri Aug 17 18:37:22 2018 (r337984) +++ stable/11/sys/dev/bge/if_bge.c Fri Aug 17 19:18:59 2018 (r337985) @@ -3204,6 +3204,14 @@ bge_can_use_msi(struct bge_softc *sc) sc->bge_chiprev != BGE_CHIPREV_5750_BX) can_use_msi = 1; break; + case BGE_ASICREV_BCM5784: + /* + * Prevent infinite "watchdog timeout" errors + * in some MacBook Pro and make it work out-of-the-box. + */ + if (sc->bge_chiprev == BGE_CHIPREV_5784_AX) + break; + /* FALLTHROUGH */ default: if (BGE_IS_575X_PLUS(sc)) can_use_msi = 1; From owner-svn-src-all@freebsd.org Fri Aug 17 19:22: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 BAF1910793C7; Fri, 17 Aug 2018 19:22:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E4C78F5FA; Fri, 17 Aug 2018 19:22:47 +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 4F6BC4F4F; Fri, 17 Aug 2018 19:22:47 +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 w7HJMls7012918; Fri, 17 Aug 2018 19:22:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HJMkTZ012915; Fri, 17 Aug 2018 19:22:46 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808171922.w7HJMkTZ012915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 17 Aug 2018 19:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337986 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 337986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 19:22:48 -0000 Author: np Date: Fri Aug 17 19:22:46 2018 New Revision: 337986 URL: https://svnweb.freebsd.org/changeset/base/337986 Log: cxgbe/tom: Put the ifnet or VLAN's PCP value in the 802.1Q tag of frames generated by the TOE. Works with vid 0 (no VLAN, just priority) too. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom_l2t.c Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Fri Aug 17 19:18:59 2018 (r337985) +++ head/sys/dev/cxgbe/tom/t4_connect.c Fri Aug 17 19:22:46 2018 (r337986) @@ -326,7 +326,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct tcpcb *tp = intotcpcb(inp); int reason; struct offload_settings settings; - uint16_t vid = 0xffff; + uint16_t vid = 0xfff, pcp = 0; INP_WLOCK_ASSERT(inp); KASSERT(nam->sa_family == AF_INET || nam->sa_family == AF_INET6, @@ -339,13 +339,15 @@ t4_connect(struct toedev *tod, struct socket *so, stru vi = ifp->if_softc; VLAN_TAG(rt_ifp, &vid); + VLAN_PCP(rt_ifp, &pcp); } else if (rt_ifp->if_type == IFT_IEEE8023ADLAG) DONT_OFFLOAD_ACTIVE_OPEN(ENOSYS); /* XXX: implement lagg+TOE */ else DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); rw_rlock(&sc->policy_lock); - settings = *lookup_offload_policy(sc, OPEN_TYPE_ACTIVE, NULL, vid, inp); + settings = *lookup_offload_policy(sc, OPEN_TYPE_ACTIVE, NULL, + EVL_MAKETAG(vid, pcp, 0), inp); rw_runlock(&sc->policy_lock); if (!settings.offload) DONT_OFFLOAD_ACTIVE_OPEN(EPERM); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Fri Aug 17 19:18:59 2018 (r337985) +++ head/sys/dev/cxgbe/tom/t4_listen.c Fri Aug 17 19:22:46 2018 (r337986) @@ -521,8 +521,8 @@ t4_listen_start(struct toedev *tod, struct tcpcb *tp) INP_WLOCK_ASSERT(inp); rw_rlock(&sc->policy_lock); - settings = *lookup_offload_policy(sc, OPEN_TYPE_LISTEN, NULL, 0xffff, - inp); + settings = *lookup_offload_policy(sc, OPEN_TYPE_LISTEN, NULL, + EVL_MAKETAG(0xfff, 0, 0), inp); rw_runlock(&sc->policy_lock); if (!settings.offload) return (0); @@ -1305,7 +1305,7 @@ found: * XXX: lagg support, lagg + vlan support. */ vid = EVL_VLANOFTAG(be16toh(cpl->vlan)); - if (vid != 0xfff) { + if (vid != 0xfff && vid != 0) { ifp = VLAN_DEVAT(hw_ifp, vid); if (ifp == NULL) REJECT_PASS_ACCEPT(); @@ -1396,7 +1396,8 @@ found: } so = inp->inp_socket; rw_rlock(&sc->policy_lock); - settings = *lookup_offload_policy(sc, OPEN_TYPE_PASSIVE, m, 0xffff, inp); + settings = *lookup_offload_policy(sc, OPEN_TYPE_PASSIVE, m, + EVL_MAKETAG(0xfff, 0, 0), inp); rw_runlock(&sc->policy_lock); if (!settings.offload) { INP_WUNLOCK(inp); Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Fri Aug 17 19:18:59 2018 (r337985) +++ head/sys/dev/cxgbe/tom/t4_tom.c Fri Aug 17 19:22:46 2018 (r337986) @@ -649,7 +649,7 @@ select_ntuple(struct vi_info *vi, struct l2t_entry *e) * Initialize each of the fields which we care about which are present * in the Compressed Filter Tuple. */ - if (tp->vlan_shift >= 0 && e->vlan != CPL_L2T_VLAN_NONE) + if (tp->vlan_shift >= 0 && EVL_VLANOFTAG(e->vlan) != CPL_L2T_VLAN_NONE) ntuple |= (uint64_t)(F_FT_VLAN_VLD | e->vlan) << tp->vlan_shift; if (tp->port_shift >= 0) @@ -1130,7 +1130,7 @@ prepare_pkt(int open_type, uint16_t vtag, struct inpcb ipv6 = inp->inp_vflag & INP_IPV6; len = 0; - if (vtag == 0xffff) { + if (EVL_VLANOFTAG(vtag) == 0xfff) { struct ether_header *eh = (void *)pkt; if (ipv6) Modified: head/sys/dev/cxgbe/tom/t4_tom_l2t.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom_l2t.c Fri Aug 17 19:18:59 2018 (r337985) +++ head/sys/dev/cxgbe/tom/t4_tom_l2t.c Fri Aug 17 19:22:46 2018 (r337986) @@ -236,7 +236,7 @@ resolve_entry(struct adapter *sc, struct l2t_entry *e) struct sockaddr_in6 sin6 = {0}; struct sockaddr *sa; uint8_t dmac[ETHER_HDR_LEN]; - uint16_t vtag = VLAN_NONE; + uint16_t vtag; int rc; if (e->ipv6 == 0) { @@ -251,6 +251,7 @@ resolve_entry(struct adapter *sc, struct l2t_entry *e) sa = (void *)&sin6; } + vtag = EVL_MAKETAG(VLAN_NONE, 0, 0); rc = toe_l2_resolve(tod, e->ifp, sa, dmac, &vtag); if (rc == EWOULDBLOCK) return (rc); @@ -355,20 +356,27 @@ t4_l2t_get(struct port_info *pi, struct ifnet *ifp, st struct adapter *sc = pi->adapter; struct l2t_data *d = sc->l2t; u_int hash, smt_idx = pi->port_id; + uint16_t vid, pcp, vtag; KASSERT(sa->sa_family == AF_INET || sa->sa_family == AF_INET6, ("%s: sa %p has unexpected sa_family %d", __func__, sa, sa->sa_family)); -#ifndef VLAN_TAG - if (ifp->if_type == IFT_L2VLAN) - return (NULL); -#endif + vid = VLAN_NONE; + pcp = 0; + if (ifp->if_type == IFT_L2VLAN) { + VLAN_TAG(ifp, &vid); + VLAN_PCP(ifp, &pcp); + } else if (ifp->if_pcp != IFNET_PCP_NONE) { + vid = 0; + pcp = ifp->if_pcp; + } + vtag = EVL_MAKETAG(vid, pcp, 0); hash = l2_hash(d, sa, ifp->if_index); rw_wlock(&d->lock); for (e = d->l2tab[hash].first; e; e = e->next) { - if (l2_cmp(sa, e) == 0 && e->ifp == ifp && + if (l2_cmp(sa, e) == 0 && e->ifp == ifp && e->vlan == vtag && e->smt_idx == smt_idx) { l2t_hold(d, e); goto done; @@ -391,12 +399,7 @@ t4_l2t_get(struct port_info *pi, struct ifnet *ifp, st e->wrq = &sc->sge.ctrlq[pi->port_id]; e->iqid = sc->sge.ofld_rxq[pi->vi[0].first_ofld_rxq].iq.abs_id; atomic_store_rel_int(&e->refcnt, 1); -#ifdef VLAN_TAG - if (ifp->if_type == IFT_L2VLAN) - VLAN_TAG(ifp, &e->vlan); - else - e->vlan = VLAN_NONE; -#endif + e->vlan = vtag; mtx_unlock(&e->lock); } done: From owner-svn-src-all@freebsd.org Fri Aug 17 20: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 7677C107AA0B; Fri, 17 Aug 2018 20:28:32 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29D447157A; Fri, 17 Aug 2018 20:28:32 +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 0AF3C5908; Fri, 17 Aug 2018 20:28:32 +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 w7HKSV69044323; Fri, 17 Aug 2018 20:28:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HKSVO1044322; Fri, 17 Aug 2018 20:28:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808172028.w7HKSVO1044322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 17 Aug 2018 20:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337987 - 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: 337987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 20:28:32 -0000 Author: np Date: Fri Aug 17 20:28:31 2018 New Revision: 337987 URL: https://svnweb.freebsd.org/changeset/base/337987 Log: cxgbe(4): Adjust ntids to account for nhptids in the TOE case too. This should have been part of r337538. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Aug 17 19:22:46 2018 (r337986) +++ head/sys/dev/cxgbe/t4_main.c Fri Aug 17 20:28:31 2018 (r337987) @@ -3992,6 +3992,12 @@ get_params__post_init(struct adapter *sc) return (rc); } sc->tids.ntids = val[0]; + if (sc->params.fw_vers < + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(5) | V_FW_HDR_FW_VER_BUILD(0))) { + MPASS(sc->tids.ntids >= sc->tids.nhpftids); + sc->tids.ntids -= sc->tids.nhpftids; + } sc->tids.natids = min(sc->tids.ntids / 2, MAX_ATIDS); if (val[2] > val[1]) { sc->tids.stid_base = val[1]; From owner-svn-src-all@freebsd.org Fri Aug 17 20:29: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 65DAC107AA80; Fri, 17 Aug 2018 20:29:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19E2A716F9; Fri, 17 Aug 2018 20:29:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F04AA5909; Fri, 17 Aug 2018 20:29:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HKTV3M044411; Fri, 17 Aug 2018 20:29:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HKTVeK044410; Fri, 17 Aug 2018 20:29:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201808172029.w7HKTVeK044410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 17 Aug 2018 20:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r337988 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: mav X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 337988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 20:29:32 -0000 Author: mav Date: Fri Aug 17 20:29:31 2018 New Revision: 337988 URL: https://svnweb.freebsd.org/changeset/base/337988 Log: Release Eugene Grosbein (eugene) from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Aug 17 20:28:31 2018 (r337987) +++ svnadmin/conf/mentors Fri Aug 17 20:29:31 2018 (r337988) @@ -19,7 +19,6 @@ bwidawsk emaste daichi gnn def pjd eri ae Co-mentor: thompsa -eugene avg Co-mentor: mav gordon delphij Co-mentor: emaste ivadasz adrian Co-mentor: cognet jceel trasz From owner-svn-src-all@freebsd.org Fri Aug 17 20:41: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 8BEBB107AF3B; Fri, 17 Aug 2018 20:41:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42BE771EDB; Fri, 17 Aug 2018 20:41:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 239DE5C0F; Fri, 17 Aug 2018 20:41:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HKfp6l050443; Fri, 17 Aug 2018 20:41:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HKfpbD050442; Fri, 17 Aug 2018 20:41:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808172041.w7HKfpbD050442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 17 Aug 2018 20:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337989 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 337989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 20:41:51 -0000 Author: imp Date: Fri Aug 17 20:41:50 2018 New Revision: 337989 URL: https://svnweb.freebsd.org/changeset/base/337989 Log: Copy the boot loader from the new location for the co-existing loaders. Reviewed by: gjb@ Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Fri Aug 17 20:29:31 2018 (r337988) +++ head/release/tools/arm.subr Fri Aug 17 20:41:50 2018 (r337989) @@ -198,7 +198,7 @@ arm_install_boot() { BOOTFILES="$(chroot ${CHROOTDIR} realpath ${BOOTFILES})" chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT - chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/loader/loader.efi \ + chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/loader_lua/loader_lua.efi \ ${FATMOUNT}/EFI/BOOT/$(efi_boot_name ${EMBEDDED_TARGET}) chroot ${CHROOTDIR} cp -R ${UFSMOUNT}/boot/dtb ${FATMOUNT} From owner-svn-src-all@freebsd.org Fri Aug 17 21:12: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 44654107B982; Fri, 17 Aug 2018 21:12:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED52A7304B; Fri, 17 Aug 2018 21:12:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D00F36128; Fri, 17 Aug 2018 21:12:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HLCHrs069835; Fri, 17 Aug 2018 21:12:17 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HLCHoJ069203; Fri, 17 Aug 2018 21:12:17 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808172112.w7HLCHoJ069203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 17 Aug 2018 21:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337990 - in head/sys/fs: nfs nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 337990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 21:12:18 -0000 Author: rmacklem Date: Fri Aug 17 21:12:16 2018 New Revision: 337990 URL: https://svnweb.freebsd.org/changeset/base/337990 Log: Fix LORs between vn_start_write() and vn_lock() in the pNFS server. When coding the pNFS server, I added several vn_start_write() calls done while the vnode was locked, not realizing I had introduced LORs and possible deadlock when an exported file system on the MDS is suspended. This patch fixes this by removing the added vn_start_write() calls and modifying the code so that the extant vn_start_write() call before the NFS RPC/operation is done when needed by the pNFS server. Flags are changed so that LayoutCommit and LayoutReturn now get a vn_start_write() done for them. When the pNFS server is enabled, the code now also changes the flags for Getattr, so that the vn_start_write() is done for Getattr, since it may need to do a vn_set_extattr(). The nfs_writerpc flag array was made global to the NFS server and renamed nfsrv_writerpc, which is consistent naming for globals in the NFS server. Thanks go to kib@ for reporting that doing vn_start_write() while the vnode is locked results in a LOR. This patch only affects the behaviour of the pNFS server. Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdsocket.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri Aug 17 20:41:50 2018 (r337989) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Aug 17 21:12:16 2018 (r337990) @@ -156,9 +156,9 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS] = { { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Get Dir Deleg */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Get Device Info */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Get Device List */ - { 0, 1, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Layout Commit */ + { 0, 1, 0, 1, LK_EXCLUSIVE, 1, 1 }, /* Layout Commit */ { 0, 1, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Layout Get */ - { 0, 1, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Layout Return */ + { 0, 1, 0, 1, LK_EXCLUSIVE, 1, 0 }, /* Layout Return */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Secinfo No name */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Sequence */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Set SSV */ Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Aug 17 20:41:50 2018 (r337989) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Fri Aug 17 21:12:16 2018 (r337990) @@ -107,6 +107,9 @@ extern u_long sb_max_adj; extern int newnfs_numnfsd; extern struct proc *nfsd_master_proc; extern time_t nfsdev_time; +extern int nfsrv_writerpc[NFS_NPROCS]; +extern volatile int nfsrv_devidcnt; +extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS]; /* * NFS server system calls @@ -527,8 +530,21 @@ nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args * nfsrvd_pool->sp_minthreads = args->minthreads; nfsrvd_pool->sp_maxthreads = args->maxthreads; + /* + * If this is a pNFS service, make Getattr do a + * vn_start_write(), so it can do a vn_set_extattr(). + */ + if (nfsrv_devidcnt > 0) { + nfsrv_writerpc[NFSPROC_GETATTR] = 1; + nfsv4_opflag[NFSV4OP_GETATTR].modifyfs = 1; + } + svc_run(nfsrvd_pool); + /* Reset Getattr to not do a vn_start_write(). */ + nfsrv_writerpc[NFSPROC_GETATTR] = 0; + nfsv4_opflag[NFSV4OP_GETATTR].modifyfs = 0; + if (principal[0] != '\0') { rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2); rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Aug 17 20:41:50 2018 (r337989) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Aug 17 21:12:16 2018 (r337990) @@ -128,7 +128,7 @@ static int nfsrv_getattrdsrpc(fhandle_t *, struct ucre static int nfsrv_putfhname(fhandle_t *, char *); static int nfsrv_pnfslookupds(struct vnode *, struct vnode *, struct pnfsdsfile *, struct vnode **, NFSPROC_T *); -static void nfsrv_pnfssetfh(struct vnode *, struct pnfsdsfile *, +static void nfsrv_pnfssetfh(struct vnode *, struct pnfsdsfile *, char *, char *, struct vnode *, NFSPROC_T *); static int nfsrv_dsremove(struct vnode *, char *, struct ucred *, NFSPROC_T *); static int nfsrv_dssetacl(struct vnode *, struct acl *, struct ucred *, @@ -4068,21 +4068,16 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, tpf->dsf_sin.sin_port = 0; } - error = vn_start_write(vp, &mp, V_WAIT); - if (error == 0) { + error = vn_extattr_set(vp, IO_NODELOCKED, + EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsfile", + sizeof(*pf) * nfsrv_maxpnfsmirror, (char *)pf, p); + if (error == 0) error = vn_extattr_set(vp, IO_NODELOCKED, - EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsfile", - sizeof(*pf) * nfsrv_maxpnfsmirror, (char *)pf, p); - if (error == 0) - error = vn_extattr_set(vp, IO_NODELOCKED, - EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsattr", - sizeof(dsattr), (char *)&dsattr, p); - vn_finished_write(mp); - if (error != 0) - printf("pNFS: pnfscreate setextattr=%d\n", - error); - } else - printf("pNFS: pnfscreate startwrite=%d\n", error); + EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsattr", + sizeof(dsattr), (char *)&dsattr, p); + if (error != 0) + printf("pNFS: pnfscreate setextattr=%d\n", + error); } else printf("pNFS: pnfscreate=%d\n", error); free(pf, M_TEMP); @@ -4415,6 +4410,9 @@ nfsrv_proxyds(struct nfsrv_descript *nd, struct vnode tryagain: if (error == 0) { buflen = 1024; + if (ioproc == NFSPROC_READDS && NFSVOPISLOCKED(vp) == + LK_EXCLUSIVE) + printf("nfsrv_proxyds: Readds vp exclusively locked\n"); error = nfsrv_dsgetsockmnt(vp, LK_SHARED, buf, &buflen, &mirrorcnt, p, dvp, fh, NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -4673,6 +4671,8 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char if (fhiszero != 0) nfsrv_pnfssetfh( vp, pf, + devid, + fnamep, nvp, p); if (nvpp != NULL && *nvpp == NULL) { @@ -4746,21 +4746,15 @@ static int nfsrv_setextattr(struct vnode *vp, struct nfsvattr *nap, NFSPROC_T *p) { struct pnfsdsattr dsattr; - struct mount *mp; int error; ASSERT_VOP_ELOCKED(vp, "nfsrv_setextattr vp"); - error = vn_start_write(vp, &mp, V_WAIT); - if (error == 0) { - dsattr.dsa_filerev = nap->na_filerev; - dsattr.dsa_size = nap->na_size; - dsattr.dsa_atime = nap->na_atime; - dsattr.dsa_mtime = nap->na_mtime; - error = vn_extattr_set(vp, IO_NODELOCKED, - EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsattr", - sizeof(dsattr), (char *)&dsattr, p); - vn_finished_write(mp); - } + dsattr.dsa_filerev = nap->na_filerev; + dsattr.dsa_size = nap->na_size; + dsattr.dsa_atime = nap->na_atime; + dsattr.dsa_mtime = nap->na_mtime; + error = vn_extattr_set(vp, IO_NODELOCKED, EXTATTR_NAMESPACE_SYSTEM, + "pnfsd.dsattr", sizeof(dsattr), (char *)&dsattr, p); if (error != 0) printf("pNFS: setextattr=%d\n", error); return (error); @@ -5532,35 +5526,26 @@ nfsrv_pnfslookupds(struct vnode *vp, struct vnode *dvp * Set the file handle to the correct one. */ static void -nfsrv_pnfssetfh(struct vnode *vp, struct pnfsdsfile *pf, struct vnode *nvp, - NFSPROC_T *p) +nfsrv_pnfssetfh(struct vnode *vp, struct pnfsdsfile *pf, char *devid, + char *fnamep, struct vnode *nvp, NFSPROC_T *p) { - struct mount *mp; struct nfsnode *np; int ret; np = VTONFS(nvp); NFSBCOPY(np->n_fhp->nfh_fh, &pf->dsf_fh, NFSX_MYFH); /* - * We can only do a setextattr for an exclusively - * locked vp. Instead of trying to upgrade a shared - * lock, just leave dsf_fh zeroed out and it will - * keep doing this lookup until it is done with an - * exclusively locked vp. + * We can only do a vn_set_extattr() if the vnode is exclusively + * locked and vn_start_write() has been done. If devid != NULL or + * fnamep != NULL or the vnode is shared locked, vn_start_write() + * may not have been done. + * If not done now, it will be done on a future call. */ - if (NFSVOPISLOCKED(vp) == LK_EXCLUSIVE) { - ret = vn_start_write(vp, &mp, V_WAIT); - NFSD_DEBUG(4, "nfsrv_pnfssetfh: vn_start_write=%d\n", - ret); - if (ret == 0) { - ret = vn_extattr_set(vp, IO_NODELOCKED, - EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsfile", - sizeof(*pf), (char *)pf, p); - vn_finished_write(mp); - NFSD_DEBUG(4, "nfsrv_pnfslookupds: aft " - "vn_extattr_set=%d\n", ret); - } - } + if (devid == NULL && fnamep == NULL && NFSVOPISLOCKED(vp) == + LK_EXCLUSIVE) + ret = vn_extattr_set(vp, IO_NODELOCKED, + EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsfile", sizeof(*pf), + (char *)pf, p); NFSD_DEBUG(4, "eo nfsrv_pnfssetfh=%d\n", ret); } Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Aug 17 20:41:50 2018 (r337989) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Aug 17 21:12:16 2018 (r337990) @@ -361,7 +361,7 @@ static int nfsrv_nonidempotent[NFS_V3NPROCS] = { * This static array indicates whether or not the RPC modifies the * file system. */ -static int nfs_writerpc[NFS_NPROCS] = { 0, 0, 1, 0, 0, 0, 0, +int nfsrv_writerpc[NFS_NPROCS] = { 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; @@ -517,10 +517,10 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, u lktype = LK_EXCLUSIVE; if (nd->nd_flag & ND_PUBLOOKUP) nfsd_fhtovp(nd, &nfs_pubfh, lktype, &vp, &nes, - &mp, nfs_writerpc[nd->nd_procnum], p); + &mp, nfsrv_writerpc[nd->nd_procnum], p); else nfsd_fhtovp(nd, &fh, lktype, &vp, &nes, - &mp, nfs_writerpc[nd->nd_procnum], p); + &mp, nfsrv_writerpc[nd->nd_procnum], p); if (nd->nd_repstat == NFSERR_PROGNOTV4) goto out; } @@ -545,7 +545,7 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, u nfsrvd_statstart(nfsv3to4op[nd->nd_procnum], /*now*/ NULL); nfsrvd_statend(nfsv3to4op[nd->nd_procnum], /*bytes*/ 0, /*now*/ NULL, /*then*/ NULL); - if (mp != NULL && nfs_writerpc[nd->nd_procnum] != 0) + if (mp != NULL && nfsrv_writerpc[nd->nd_procnum] != 0) vn_finished_write(mp); goto out; } @@ -576,7 +576,7 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, u error = (*(nfsrv3_procs0[nd->nd_procnum]))(nd, isdgram, vp, p, &nes); } - if (mp != NULL && nfs_writerpc[nd->nd_procnum] != 0) + if (mp != NULL && nfsrv_writerpc[nd->nd_procnum] != 0) vn_finished_write(mp); nfsrvd_statend(nfsv3to4op[nd->nd_procnum], /*bytes*/ 0, From owner-svn-src-all@freebsd.org Fri Aug 17 21:19: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 F02F9107BAAB; Fri, 17 Aug 2018 21:19:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A588273326; Fri, 17 Aug 2018 21:19:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 876D86172; Fri, 17 Aug 2018 21:19:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HLJIiX070495; Fri, 17 Aug 2018 21:19:18 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HLJIbY070494; Fri, 17 Aug 2018 21:19:18 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201808172119.w7HLJIbY070494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 17 Aug 2018 21:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337991 - head X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 337991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2018 21:19:19 -0000 Author: bz Date: Fri Aug 17 21:19:18 2018 New Revision: 337991 URL: https://svnweb.freebsd.org/changeset/base/337991 Log: METALOG, unless manually overwritten, is defined as ${DESTDIR}/${DISTDIR}/METALOG In the create-world-packages target we manually piece this together (unless it is undefined), without the DISTDIR. Normally DISTDIR is empty (unset) and no one notices. Now DISTDIR is a well known long-standing PORTS environment variable and if that is set in the local environment the path to METALOG is wrong as it no longer is ${DESTDIR}/METALOG. Long-term we should start to avoid "publicly well known" names for global variables, for now just piece ${DISTDIR} in as well. This allows create-world-packages to continue if DISTDIR is set in the env. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Aug 17 21:12:16 2018 (r337990) +++ head/Makefile.inc1 Fri Aug 17 21:19:18 2018 (r337991) @@ -1765,7 +1765,7 @@ create-packages: .PHONY create-packages-world create-p create-world-packages: _pkgbootstrap .PHONY @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || : @cd ${WSTAGEDIR} ; \ - env -i LC_COLLATE=C sort ${WSTAGEDIR}/METALOG | \ + env -i LC_COLLATE=C sort ${WSTAGEDIR}/${DISTDIR}/METALOG | \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk @for plist in ${WSTAGEDIR}/*.plist; do \ plist=$${plist##*/} ; \ From owner-svn-src-all@freebsd.org Sat Aug 18 01:05:45 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 B53771080818; Sat, 18 Aug 2018 01:05:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A05A7AD0A; Sat, 18 Aug 2018 01:05:44 +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 4ADF2106F6; Sat, 18 Aug 2018 01:05:44 +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 w7I15i1G089264; Sat, 18 Aug 2018 01:05:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I15cIN089237; Sat, 18 Aug 2018 01:05:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808180105.w7I15cIN089237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 18 Aug 2018 01:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337992 - in head: include lib/libthr/thread share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: include lib/libthr/thread share/man/man3 X-SVN-Commit-Revision: 337992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 01:05:45 -0000 Author: pfg Date: Sat Aug 18 01:05:38 2018 New Revision: 337992 URL: https://svnweb.freebsd.org/changeset/base/337992 Log: POSIX compliance improvements in the pthread(3) functions. This basically adds makes use of the C99 restrict keyword, and also adds some 'const's to four threading functions: pthread_mutexattr_gettype(), pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), and pthread_mutex_getprioceiling. The changes are in accordance to POSIX/SUSv4-2018. Hinted by: DragonFlyBSD Relnotes: yes MFC after: 1 month Differential Revision: D16722 Modified: head/include/pthread.h head/lib/libthr/thread/thr_attr.c head/lib/libthr/thread/thr_barrier.c head/lib/libthr/thread/thr_barrierattr.c head/lib/libthr/thread/thr_cond.c head/lib/libthr/thread/thr_condattr.c head/lib/libthr/thread/thr_create.c head/lib/libthr/thread/thr_getschedparam.c head/lib/libthr/thread/thr_mutex.c head/lib/libthr/thread/thr_mutexattr.c head/lib/libthr/thread/thr_rwlock.c head/lib/libthr/thread/thr_rwlockattr.c head/share/man/man3/pthread.3 head/share/man/man3/pthread_attr.3 head/share/man/man3/pthread_barrier_destroy.3 head/share/man/man3/pthread_barrierattr.3 head/share/man/man3/pthread_cond_init.3 head/share/man/man3/pthread_cond_wait.3 head/share/man/man3/pthread_create.3 head/share/man/man3/pthread_mutex_init.3 head/share/man/man3/pthread_mutex_timedlock.3 head/share/man/man3/pthread_mutexattr.3 head/share/man/man3/pthread_rwlock_init.3 head/share/man/man3/pthread_rwlock_timedrdlock.3 head/share/man/man3/pthread_rwlock_timedwrlock.3 head/share/man/man3/pthread_rwlockattr_getpshared.3 head/share/man/man3/pthread_schedparam.3 Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Fri Aug 17 21:19:18 2018 (r337991) +++ head/include/pthread.h Sat Aug 18 01:05:38 2018 (r337992) @@ -153,10 +153,10 @@ int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_getstack( const pthread_attr_t * __restrict, void ** __restrict, size_t * __restrict); -int pthread_attr_getstacksize(const pthread_attr_t *, - size_t *); -int pthread_attr_getguardsize(const pthread_attr_t *, - size_t *); +int pthread_attr_getstacksize(const pthread_attr_t * __restrict, + size_t * __restrict); +int pthread_attr_getguardsize(const pthread_attr_t * __restrict, + size_t * __restrict); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); int pthread_attr_getdetachstate(const pthread_attr_t *, int *); @@ -168,12 +168,12 @@ int pthread_attr_setstack(pthread_attr_t *, void *, int pthread_attr_setstackaddr(pthread_attr_t *, void *); int pthread_attr_setdetachstate(pthread_attr_t *, int); int pthread_barrier_destroy(pthread_barrier_t *); -int pthread_barrier_init(pthread_barrier_t *, - const pthread_barrierattr_t *, unsigned); +int pthread_barrier_init(pthread_barrier_t * __restrict, + const pthread_barrierattr_t * __restrict, unsigned); int pthread_barrier_wait(pthread_barrier_t *); int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared( - const pthread_barrierattr_t *, int *); + const pthread_barrierattr_t * __restrict, int * __restrict); int pthread_barrierattr_init(pthread_barrierattr_t *); int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); @@ -191,24 +191,27 @@ int pthread_barrierattr_setpshared(pthread_barrieratt } int pthread_condattr_destroy(pthread_condattr_t *); -int pthread_condattr_getclock(const pthread_condattr_t *, - clockid_t *); +int pthread_condattr_getclock(const pthread_condattr_t * __restrict, + clockid_t * __restrict); int pthread_condattr_getpshared(const pthread_condattr_t *, int *); int pthread_condattr_init(pthread_condattr_t *); int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); int pthread_condattr_setpshared(pthread_condattr_t *, int); int pthread_cond_broadcast(pthread_cond_t *); int pthread_cond_destroy(pthread_cond_t *); -int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); +int pthread_cond_init(pthread_cond_t * __restrict, + const pthread_condattr_t * __restrict); int pthread_cond_signal(pthread_cond_t *); int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t * __mutex, const struct timespec *) __requires_exclusive(*__mutex); -int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * __mutex) +int pthread_cond_wait(pthread_cond_t * __restrict, + pthread_mutex_t * __restrict __mutex) __requires_exclusive(*__mutex); -int pthread_create(pthread_t *, const pthread_attr_t *, - void *(*) (void *), void *); +int pthread_create(pthread_t * __restrict, + const pthread_attr_t * __restrict, void *(*) (void *), + void * __restrict); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; @@ -219,40 +222,44 @@ int pthread_key_create(pthread_key_t *, void (*) (voi int pthread_key_delete(pthread_key_t); int pthread_mutexattr_init(pthread_mutexattr_t *); int pthread_mutexattr_destroy(pthread_mutexattr_t *); -int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, - int *); -int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); +int pthread_mutexattr_getpshared( + const pthread_mutexattr_t * __restrict, + int * __restrict); +int pthread_mutexattr_gettype( + const pthread_mutexattr_t * __restrict, int * __restrict); int pthread_mutexattr_settype(pthread_mutexattr_t *, int); int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); int pthread_mutex_consistent(pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); int pthread_mutex_destroy(pthread_mutex_t * __mutex) __requires_unlocked(*__mutex); -int pthread_mutex_init(pthread_mutex_t * __mutex, - const pthread_mutexattr_t *) +int pthread_mutex_init(pthread_mutex_t * __restrict __mutex, + const pthread_mutexattr_t * __restrict) __requires_unlocked(*__mutex); int pthread_mutex_lock(pthread_mutex_t * __mutex) __locks_exclusive(*__mutex); int pthread_mutex_trylock(pthread_mutex_t * __mutex) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_timedlock(pthread_mutex_t * __mutex, - const struct timespec *) +int pthread_mutex_timedlock(pthread_mutex_t * __restrict __mutex, + const struct timespec * __restrict) __trylocks_exclusive(0, *__mutex); int pthread_mutex_unlock(pthread_mutex_t * __mutex) __unlocks(*__mutex); int pthread_once(pthread_once_t *, void (*) (void)); int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __requires_unlocked(*__rwlock); -int pthread_rwlock_init(pthread_rwlock_t * __rwlock, - const pthread_rwlockattr_t *) +int pthread_rwlock_init(pthread_rwlock_t * __restrict __rwlock, + const pthread_rwlockattr_t * __restrict) __requires_unlocked(*__rwlock); int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __locks_shared(*__rwlock); -int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock, - const struct timespec *) +int pthread_rwlock_timedrdlock( + pthread_rwlock_t * __restrict __rwlock, + const struct timespec * __restrict) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock, - const struct timespec *) +int pthread_rwlock_timedwrlock( + pthread_rwlock_t * __restrict __rwlock, + const struct timespec * __restrict) __trylocks_exclusive(0, *__rwlock); int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __trylocks_shared(0, *__rwlock); @@ -265,8 +272,9 @@ int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, int *); -int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, - int *); +int pthread_rwlockattr_getpshared( + const pthread_rwlockattr_t * __restrict, + int * __restrict); int pthread_rwlockattr_init(pthread_rwlockattr_t *); int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); @@ -295,30 +303,39 @@ int pthread_setprio(pthread_t, int); void pthread_yield(void); #endif -int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *, int *); +int pthread_mutexattr_getprioceiling( + const pthread_mutexattr_t * __restrict, + int * __restrict); int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int); -int pthread_mutex_getprioceiling(pthread_mutex_t *, int *); -int pthread_mutex_setprioceiling(pthread_mutex_t *, int, int *); +int pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict, + int * __restrict); +int pthread_mutex_setprioceiling(pthread_mutex_t * __restrict, int, + int * __restrict); -int pthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *); +int pthread_mutexattr_getprotocol( + const pthread_mutexattr_t * __restrict, + int * __restrict); int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_mutexattr_getrobust( pthread_mutexattr_t * __restrict, int * __restrict); int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int); -int pthread_attr_getinheritsched(const pthread_attr_t *, int *); +int pthread_attr_getinheritsched(const pthread_attr_t * __restrict, + int * __restrict); int pthread_attr_getschedparam(const pthread_attr_t *, struct sched_param *); -int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); -int pthread_attr_getscope(const pthread_attr_t *, int *); +int pthread_attr_getschedpolicy(const pthread_attr_t * __restrict, + int * __restrict); +int pthread_attr_getscope(const pthread_attr_t * __restrict, + int * __restrict); int pthread_attr_setinheritsched(pthread_attr_t *, int); int pthread_attr_setschedparam(pthread_attr_t *, const struct sched_param *); int pthread_attr_setschedpolicy(pthread_attr_t *, int); int pthread_attr_setscope(pthread_attr_t *, int); -int pthread_getschedparam(pthread_t pthread, int *, - struct sched_param *); +int pthread_getschedparam(pthread_t pthread, int * __restrict, + struct sched_param * __restrict); int pthread_setschedparam(pthread_t, int, const struct sched_param *); #if __XSI_VISIBLE Modified: head/lib/libthr/thread/thr_attr.c ============================================================================== --- head/lib/libthr/thread/thr_attr.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_attr.c Sat Aug 18 01:05:38 2018 (r337992) @@ -199,7 +199,8 @@ _pthread_attr_getdetachstate(const pthread_attr_t *att __weak_reference(_pthread_attr_getguardsize, pthread_attr_getguardsize); int -_pthread_attr_getguardsize(const pthread_attr_t *attr, size_t *guardsize) +_pthread_attr_getguardsize(const pthread_attr_t *__restrict attr, + size_t *__restrict guardsize) { int ret; @@ -217,7 +218,8 @@ _pthread_attr_getguardsize(const pthread_attr_t *attr, __weak_reference(_pthread_attr_getinheritsched, pthread_attr_getinheritsched); int -_pthread_attr_getinheritsched(const pthread_attr_t *attr, int *sched_inherit) +_pthread_attr_getinheritsched(const pthread_attr_t * __restrict attr, + int * __restrict sched_inherit) { int ret = 0; @@ -232,7 +234,8 @@ _pthread_attr_getinheritsched(const pthread_attr_t *at __weak_reference(_pthread_attr_getschedparam, pthread_attr_getschedparam); int -_pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param) +_pthread_attr_getschedparam(const pthread_attr_t * __restrict attr, + struct sched_param * __restrict param) { int ret = 0; @@ -247,7 +250,8 @@ _pthread_attr_getschedparam(const pthread_attr_t *attr __weak_reference(_pthread_attr_getschedpolicy, pthread_attr_getschedpolicy); int -_pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy) +_pthread_attr_getschedpolicy(const pthread_attr_t * __restrict attr, + int * __restrict policy) { int ret = 0; @@ -262,7 +266,8 @@ _pthread_attr_getschedpolicy(const pthread_attr_t *att __weak_reference(_pthread_attr_getscope, pthread_attr_getscope); int -_pthread_attr_getscope(const pthread_attr_t *attr, int *contentionscope) +_pthread_attr_getscope(const pthread_attr_t * __restrict attr, + int * __restrict contentionscope) { int ret = 0; @@ -320,7 +325,8 @@ _pthread_attr_getstackaddr(const pthread_attr_t *attr, __weak_reference(_pthread_attr_getstacksize, pthread_attr_getstacksize); int -_pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize) +_pthread_attr_getstacksize(const pthread_attr_t * __restrict attr, + size_t * __restrict stacksize) { int ret; @@ -440,7 +446,8 @@ _pthread_attr_setinheritsched(pthread_attr_t *attr, in __weak_reference(_pthread_attr_setschedparam, pthread_attr_setschedparam); int -_pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param) +_pthread_attr_setschedparam(pthread_attr_t * __restrict attr, + const struct sched_param * __restrict param) { int policy; Modified: head/lib/libthr/thread/thr_barrier.c ============================================================================== --- head/lib/libthr/thread/thr_barrier.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_barrier.c Sat Aug 18 01:05:38 2018 (r337992) @@ -96,8 +96,8 @@ _pthread_barrier_destroy(pthread_barrier_t *barrier) } int -_pthread_barrier_init(pthread_barrier_t *barrier, - const pthread_barrierattr_t *attr, unsigned count) +_pthread_barrier_init(pthread_barrier_t * __restrict barrier, + const pthread_barrierattr_t * __restrict attr, unsigned count) { pthread_barrier_t bar; int pshared; Modified: head/lib/libthr/thread/thr_barrierattr.c ============================================================================== --- head/lib/libthr/thread/thr_barrierattr.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_barrierattr.c Sat Aug 18 01:05:38 2018 (r337992) @@ -58,8 +58,8 @@ _pthread_barrierattr_destroy(pthread_barrierattr_t *at } int -_pthread_barrierattr_getpshared(const pthread_barrierattr_t *attr, - int *pshared) +_pthread_barrierattr_getpshared(const pthread_barrierattr_t * __restrict attr, + int * __restrict pshared) { if (attr == NULL || *attr == NULL) Modified: head/lib/libthr/thread/thr_cond.c ============================================================================== --- head/lib/libthr/thread/thr_cond.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_cond.c Sat Aug 18 01:05:38 2018 (r337992) @@ -149,7 +149,8 @@ init_static(struct pthread *thread, pthread_cond_t *co } int -_pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *cond_attr) +_pthread_cond_init(pthread_cond_t * __restrict cond, + const pthread_condattr_t * __restrict cond_attr) { *cond = NULL; @@ -374,15 +375,17 @@ _pthread_cond_wait(pthread_cond_t *cond, pthread_mutex } int -__pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +__pthread_cond_wait(pthread_cond_t * __restrict cond, + pthread_mutex_t * __restrict mutex) { return (cond_wait_common(cond, mutex, NULL, 1)); } int -_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec * abstime) +_pthread_cond_timedwait(pthread_cond_t * __restrict cond, + pthread_mutex_t * __restrict mutex, + const struct timespec * __restrict abstime) { if (abstime == NULL || abstime->tv_sec < 0 || abstime->tv_nsec < 0 || Modified: head/lib/libthr/thread/thr_condattr.c ============================================================================== --- head/lib/libthr/thread/thr_condattr.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_condattr.c Sat Aug 18 01:05:38 2018 (r337992) @@ -82,7 +82,8 @@ _pthread_condattr_destroy(pthread_condattr_t *attr) } int -_pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clock_id) +_pthread_condattr_getclock(const pthread_condattr_t * __restrict attr, + clockid_t * __restrict clock_id) { if (attr == NULL || *attr == NULL) return (EINVAL); @@ -106,7 +107,8 @@ _pthread_condattr_setclock(pthread_condattr_t *attr, c } int -_pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared) +_pthread_condattr_getpshared(const pthread_condattr_t * __restrict attr, + int * __restrict pshared) { if (attr == NULL || *attr == NULL) Modified: head/lib/libthr/thread/thr_create.c ============================================================================== --- head/lib/libthr/thread/thr_create.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_create.c Sat Aug 18 01:05:38 2018 (r337992) @@ -52,8 +52,9 @@ static void thread_start(struct pthread *curthread); __weak_reference(_pthread_create, pthread_create); int -_pthread_create(pthread_t * thread, const pthread_attr_t * attr, - void *(*start_routine) (void *), void *arg) +_pthread_create(pthread_t * __restrict thread, + const pthread_attr_t * __restrict attr, void *(*start_routine) (void *), + void * __restrict arg) { struct pthread *curthread, *new_thread; struct thr_param param; Modified: head/lib/libthr/thread/thr_getschedparam.c ============================================================================== --- head/lib/libthr/thread/thr_getschedparam.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_getschedparam.c Sat Aug 18 01:05:38 2018 (r337992) @@ -47,8 +47,8 @@ __FBSDID("$FreeBSD$"); __weak_reference(_pthread_getschedparam, pthread_getschedparam); int -_pthread_getschedparam(pthread_t pthread, int *policy, - struct sched_param *param) +_pthread_getschedparam(pthread_t pthread, int * __restrict policy, + struct sched_param * __restrict param) { struct pthread *curthread = _get_curthread(); int ret = 0; Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_mutex.c Sat Aug 18 01:05:38 2018 (r337992) @@ -66,12 +66,12 @@ _Static_assert(sizeof(struct pthread_mutex) <= PAGE_SI * Prototypes */ int __pthread_mutex_consistent(pthread_mutex_t *mutex); -int __pthread_mutex_init(pthread_mutex_t *mutex, - const pthread_mutexattr_t *mutex_attr); +int __pthread_mutex_init(pthread_mutex_t * __restrict mutex, + const pthread_mutexattr_t * __restrict mutex_attr); int __pthread_mutex_trylock(pthread_mutex_t *mutex); int __pthread_mutex_lock(pthread_mutex_t *mutex); -int __pthread_mutex_timedlock(pthread_mutex_t *mutex, - const struct timespec *abstime); +int __pthread_mutex_timedlock(pthread_mutex_t * __restrict mutex, + const struct timespec * __restrict abstime); int _pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count); int _pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count); int __pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count); @@ -376,8 +376,8 @@ shared_mutex_init(struct pthread_mutex *pmtx, const st } int -__pthread_mutex_init(pthread_mutex_t *mutex, - const pthread_mutexattr_t *mutex_attr) +__pthread_mutex_init(pthread_mutex_t * __restrict mutex, + const pthread_mutexattr_t * __restrict mutex_attr) { struct pthread_mutex *pmtx; int ret; @@ -392,7 +392,7 @@ __pthread_mutex_init(pthread_mutex_t *mutex, return (mutex_init(mutex, mutex_attr ? *mutex_attr : NULL, calloc)); } - pmtx = __thr_pshared_offpage(mutex, 1); + pmtx = __thr_pshared_offpage(__DECONST(void *, mutex), 1); if (pmtx == NULL) return (EFAULT); *mutex = THR_PSHARED_PTR; @@ -748,8 +748,8 @@ __pthread_mutex_lock(pthread_mutex_t *mutex) } int -__pthread_mutex_timedlock(pthread_mutex_t *mutex, - const struct timespec *abstime) +__pthread_mutex_timedlock(pthread_mutex_t * __restrict mutex, + const struct timespec * __restrict abstime) { struct pthread_mutex *m; int ret; @@ -995,13 +995,13 @@ mutex_unlock_common(struct pthread_mutex *m, bool cv, } int -_pthread_mutex_getprioceiling(pthread_mutex_t *mutex, - int *prioceiling) +_pthread_mutex_getprioceiling(const pthread_mutex_t * __restrict mutex, + int * __restrict prioceiling) { struct pthread_mutex *m; if (*mutex == THR_PSHARED_PTR) { - m = __thr_pshared_offpage(mutex, 0); + m = __thr_pshared_offpage(__DECONST(void *, mutex), 0); if (m == NULL) return (EINVAL); shared_mutex_init(m, NULL); @@ -1017,8 +1017,8 @@ _pthread_mutex_getprioceiling(pthread_mutex_t *mutex, } int -_pthread_mutex_setprioceiling(pthread_mutex_t *mutex, - int ceiling, int *old_ceiling) +_pthread_mutex_setprioceiling(pthread_mutex_t * __restrict mutex, + int ceiling, int * __restrict old_ceiling) { struct pthread *curthread; struct pthread_mutex *m, *m1, *m2; Modified: head/lib/libthr/thread/thr_mutexattr.c ============================================================================== --- head/lib/libthr/thread/thr_mutexattr.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_mutexattr.c Sat Aug 18 01:05:38 2018 (r337992) @@ -150,7 +150,8 @@ _pthread_mutexattr_settype(pthread_mutexattr_t *attr, } int -_pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *type) +_pthread_mutexattr_gettype(const pthread_mutexattr_t * __restrict attr, + int * __restrict type) { int ret; @@ -202,7 +203,8 @@ _pthread_mutexattr_setpshared(pthread_mutexattr_t *att } int -_pthread_mutexattr_getprotocol(pthread_mutexattr_t *mattr, int *protocol) +_pthread_mutexattr_getprotocol(const pthread_mutexattr_t * __restrict mattr, + int * __restrict protocol) { int ret = 0; @@ -230,7 +232,8 @@ _pthread_mutexattr_setprotocol(pthread_mutexattr_t *ma } int -_pthread_mutexattr_getprioceiling(pthread_mutexattr_t *mattr, int *prioceiling) +_pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * __restrict mattr, + int * __restrict prioceiling) { int ret = 0; Modified: head/lib/libthr/thread/thr_rwlock.c ============================================================================== --- head/lib/libthr/thread/thr_rwlock.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_rwlock.c Sat Aug 18 01:05:38 2018 (r337992) @@ -225,8 +225,8 @@ _pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) } int -_pthread_rwlock_timedrdlock (pthread_rwlock_t *rwlock, - const struct timespec *abstime) +_pthread_rwlock_timedrdlock(pthread_rwlock_t * __restrict rwlock, + const struct timespec * __restrict abstime) { return (rwlock_rdlock_common(rwlock, abstime)); } @@ -337,8 +337,8 @@ _pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) } int -_pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock, - const struct timespec *abstime) +_pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict rwlock, + const struct timespec * __restrict abstime) { return (rwlock_wrlock_common (rwlock, abstime)); } Modified: head/lib/libthr/thread/thr_rwlockattr.c ============================================================================== --- head/lib/libthr/thread/thr_rwlockattr.c Fri Aug 17 21:19:18 2018 (r337991) +++ head/lib/libthr/thread/thr_rwlockattr.c Sat Aug 18 01:05:38 2018 (r337992) @@ -57,8 +57,9 @@ _pthread_rwlockattr_destroy(pthread_rwlockattr_t *rwlo } int -_pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *rwlockattr, - int *pshared) +_pthread_rwlockattr_getpshared( + const pthread_rwlockattr_t * __restrict rwlockattr, + int * __restrict pshared) { *pshared = (*rwlockattr)->pshared; Modified: head/share/man/man3/pthread.3 ============================================================================== --- head/share/man/man3/pthread.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 12, 2014 +.Dd August 17, 2018 .Dt PTHREAD 3 .Os .Sh NAME @@ -236,17 +236,17 @@ Set the detach state in a thread attributes object. Destroy a mutex attributes object. .It Xo .Ft int -.Fn pthread_mutexattr_getprioceiling "pthread_mutexattr_t *attr" "int *ceiling" +.Fn pthread_mutexattr_getprioceiling "const pthread_mutexattr_t *restrict attr" "int *restrict ceiling" .Xc Obtain priority ceiling attribute of mutex attribute object. .It Xo .Ft int -.Fn pthread_mutexattr_getprotocol "pthread_mutexattr_t *attr" "int *protocol" +.Fn pthread_mutexattr_getprotocol "const pthread_mutexattr_t *restrict attr" "int *restrict protocol" .Xc Obtain protocol attribute of mutex attribute object. .It Xo .Ft int -.Fn pthread_mutexattr_gettype "pthread_mutexattr_t *attr" "int *type" +.Fn pthread_mutexattr_gettype "const pthread_mutexattr_t *restrict attr" "int *restrict type" .Xc Obtain the mutex type attribute in the specified mutex attributes object. .It Xo Modified: head/share/man/man3/pthread_attr.3 ============================================================================== --- head/share/man/man3/pthread_attr.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_attr.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 8, 2010 +.Dd August 17, 2018 .Dt PTHREAD_ATTR 3 .Os .Sh NAME @@ -66,11 +66,11 @@ .Ft int .Fn pthread_attr_setstacksize "pthread_attr_t *attr" "size_t stacksize" .Ft int -.Fn pthread_attr_getstacksize "const pthread_attr_t *attr" "size_t *stacksize" +.Fn pthread_attr_getstacksize "const pthread_attr_t *restrict attr" "size_t *restrict stacksize" .Ft int .Fn pthread_attr_setguardsize "pthread_attr_t *attr" "size_t guardsize" .Ft int -.Fn pthread_attr_getguardsize "const pthread_attr_t *attr" "size_t *guardsize" +.Fn pthread_attr_getguardsize "const pthread_attr_t * restrict attr" "size_t * restrict guardsize" .Ft int .Fn pthread_attr_setstackaddr "pthread_attr_t *attr" "void *stackaddr" .Ft int @@ -82,7 +82,7 @@ .Ft int .Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched" .Ft int -.Fn pthread_attr_getinheritsched "const pthread_attr_t *attr" "int *inheritsched" +.Fn pthread_attr_getinheritsched "const pthread_attr_t *restrict attr" "int *restrct inheritsched" .Ft int .Fn pthread_attr_setschedparam "pthread_attr_t *attr" "const struct sched_param *param" .Ft int @@ -90,11 +90,11 @@ .Ft int .Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy" .Ft int -.Fn pthread_attr_getschedpolicy "const pthread_attr_t *attr" "int *policy" +.Fn pthread_attr_getschedpolicy "const pthread_attr_t *restrict attr" "int *restrict policy" .Ft int .Fn pthread_attr_setscope "pthread_attr_t *attr" "int contentionscope" .Ft int -.Fn pthread_attr_getscope "const pthread_attr_t *attr" "int *contentionscope" +.Fn pthread_attr_getscope "const pthread_attr_t *restrict attr" "int *restrict contentionscope" .Sh DESCRIPTION Thread attributes are used to specify parameters to .Fn pthread_create . Modified: head/share/man/man3/pthread_barrier_destroy.3 ============================================================================== --- head/share/man/man3/pthread_barrier_destroy.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_barrier_destroy.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2004 +.Dd August 17, 2018 .Dt PTHREAD_BARRIER 3 .Os .Sh NAME @@ -37,7 +37,7 @@ .Ft int .Fn pthread_barrier_destroy "pthread_barrier_t *barrier" .Ft int -.Fn pthread_barrier_init "pthread_barrier_t *barrier" "const pthread_barrierattr_t *attr" "unsigned count" +.Fn pthread_barrier_init "pthread_barrier_t *restrict barrier" "const pthread_barrierattr_t *attr" "unsigned count" .Ft int .Fn pthread_barrier_wait "pthread_barrier_t *barrier" .Sh DESCRIPTION Modified: head/share/man/man3/pthread_barrierattr.3 ============================================================================== --- head/share/man/man3/pthread_barrierattr.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_barrierattr.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2016 +.Dd August 17, 2018 .Dt PTHREAD_BARRIERATTR 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Ft int .Fn pthread_barrierattr_destroy "pthread_barrierattr_t *attr" .Ft int -.Fn pthread_barrierattr_getpshared "const pthread_barrierattr_t *attr" "int *pshared" +.Fn pthread_barrierattr_getpshared "const pthread_barrierattr_t *restrict attr" "int *restrict pshared" .Ft int .Fn pthread_barrierattr_init "pthread_barrierattr_t *attr" .Ft int Modified: head/share/man/man3/pthread_cond_init.3 ============================================================================== --- head/share/man/man3/pthread_cond_init.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_cond_init.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2006 +.Dd August 17, 2018 .Dt PTHREAD_COND_INIT 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_cond_init "pthread_cond_t *cond" "const pthread_condattr_t *attr" +.Fn pthread_cond_init "pthread_cond_t *restrict cond" "const pthread_condattr_t *restrict attr" .Sh DESCRIPTION The .Fn pthread_cond_init Modified: head/share/man/man3/pthread_cond_wait.3 ============================================================================== --- head/share/man/man3/pthread_cond_wait.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_cond_wait.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 17, 2018 .Dt PTHREAD_COND_WAIT 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_cond_wait "pthread_cond_t *cond" "pthread_mutex_t *mutex" +.Fn pthread_cond_wait "pthread_cond_t *restrict cond" "pthread_mutex_t *restrict mutex" .Sh DESCRIPTION The .Fn pthread_cond_wait Modified: head/share/man/man3/pthread_create.3 ============================================================================== --- head/share/man/man3/pthread_create.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_create.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2016 +.Dd August 17, 2018 .Dt PTHREAD_CREATE 3 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_create "pthread_t *thread" "const pthread_attr_t *attr" "void *(*start_routine)(void *)" "void *arg" +.Fn pthread_create "pthread_t *restrict thread" "const pthread_attr_t *restrict attr" "void *(*start_routine)(void *)" "void *restrict arg" .Sh DESCRIPTION The .Fn pthread_create Modified: head/share/man/man3/pthread_mutex_init.3 ============================================================================== --- head/share/man/man3/pthread_mutex_init.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_mutex_init.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2006 +.Dd August 17, 2018 .Dt PTHREAD_MUTEX_INIT 3 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_mutex_init "pthread_mutex_t *mutex" "const pthread_mutexattr_t *attr" +.Fn pthread_mutex_init "pthread_mutex_t *restrict mutex" "const pthread_mutexattr_t *restrict attr" .Sh DESCRIPTION The .Fn pthread_mutex_init Modified: head/share/man/man3/pthread_mutex_timedlock.3 ============================================================================== --- head/share/man/man3/pthread_mutex_timedlock.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_mutex_timedlock.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 17, 2018 .Dt PTHREAD_MUTEX_TIMEDLOCK 3 .Os .Sh NAME @@ -36,7 +36,7 @@ .In pthread.h .In time.h .Ft int -.Fn pthread_mutex_timedlock "pthread_mutex_t *mutex" "const struct timespec *abs_timeout" +.Fn pthread_mutex_timedlock "pthread_mutex_t *restrict mutex" "const struct timespec *restrict abs_timeout" .Sh DESCRIPTION The .Fn pthread_mutex_timedlock Modified: head/share/man/man3/pthread_mutexattr.3 ============================================================================== --- head/share/man/man3/pthread_mutexattr.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_mutexattr.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 29, 2016 +.Dd August 17, 2018 .Dt PTHREAD_MUTEXATTR 3 .Os .Sh NAME @@ -52,11 +52,11 @@ .Ft int .Fn pthread_mutexattr_setprioceiling "pthread_mutexattr_t *attr" "int prioceiling" .Ft int -.Fn pthread_mutexattr_getprioceiling "pthread_mutexattr_t *attr" "int *prioceiling" +.Fn pthread_mutexattr_getprioceiling "const pthread_mutexattr_t *attr" "int *prioceiling" .Ft int .Fn pthread_mutexattr_setprotocol "pthread_mutexattr_t *attr" "int protocol" .Ft int -.Fn pthread_mutexattr_getprotocol "pthread_mutexattr_t *attr" "int *protocol" +.Fn pthread_mutexattr_getprotocol "const pthread_mutexattr_t *restrict attr" "int *restrict protocol" .Ft int .Fn pthread_mutexattr_setrobust "pthread_mutexattr_t *attr" "int robust" .Ft int @@ -64,7 +64,7 @@ .Ft int .Fn pthread_mutexattr_settype "pthread_mutexattr_t *attr" "int type" .Ft int -.Fn pthread_mutexattr_gettype "pthread_mutexattr_t *attr" "int *type" +.Fn pthread_mutexattr_gettype "const pthread_mutexattr_t *restrict attr" "int *restrict type" .Sh DESCRIPTION Mutex attributes are used to specify parameters to .Fn pthread_mutex_init . Modified: head/share/man/man3/pthread_rwlock_init.3 ============================================================================== --- head/share/man/man3/pthread_rwlock_init.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_rwlock_init.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2016 +.Dd August 17, 2018 .Dt PTHREAD_RWLOCK_INIT 3 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_rwlock_init "pthread_rwlock_t *lock" "const pthread_rwlockattr_t *attr" +.Fn pthread_rwlock_init "pthread_rwlock_t *restrict lock" "const pthread_rwlockattr_t *restrict attr" .Sh DESCRIPTION The .Fn pthread_rwlock_init Modified: head/share/man/man3/pthread_rwlock_timedrdlock.3 ============================================================================== --- head/share/man/man3/pthread_rwlock_timedrdlock.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_rwlock_timedrdlock.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd August 17, 2018 .Dt PTHREAD_RWLOCK_TIMEDRDLOCK 3 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_rwlock_timedrdlock "pthread_rwlock_t *rwlock" "const struct timespec *abs_timeout" +.Fn pthread_rwlock_timedrdlock "pthread_rwlock_t *restrict rwlock" "const struct timespec *restrict abs_timeout" .Sh DESCRIPTION This function acquires a read lock on the read-write lock .Fa rwlock . Modified: head/share/man/man3/pthread_rwlock_timedwrlock.3 ============================================================================== --- head/share/man/man3/pthread_rwlock_timedwrlock.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_rwlock_timedwrlock.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd August 17, 2018 .Dt PTHREAD_RWLOCK_TIMEDWRLOCK 3 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_rwlock_timedwrlock "pthread_rwlock_t *rwlock" "const struct timespec *abs_timeout" +.Fn pthread_rwlock_timedwrlock "pthread_rwlock_t *restrict rwlock" "const struct timespec *restrict abs_timeout" .Sh DESCRIPTION This function acquires a write lock on the read-write lock .Fa rwlock . Modified: head/share/man/man3/pthread_rwlockattr_getpshared.3 ============================================================================== --- head/share/man/man3/pthread_rwlockattr_getpshared.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_rwlockattr_getpshared.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 1999 +.Dd August 17, 2018 .Dt PTHREAD_RWLOCKATTR_GETPSHARED 3 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .In pthread.h .Ft int -.Fn pthread_rwlockattr_getpshared "const pthread_rwlockattr_t *attr" "int *pshared" +.Fn pthread_rwlockattr_getpshared "const pthread_rwlockattr_t *restrict attr" "int *restrict pshared" .Sh DESCRIPTION The .Fn pthread_rwlockattr_getpshared Modified: head/share/man/man3/pthread_schedparam.3 ============================================================================== --- head/share/man/man3/pthread_schedparam.3 Fri Aug 17 21:19:18 2018 (r337991) +++ head/share/man/man3/pthread_schedparam.3 Sat Aug 18 01:05:38 2018 (r337992) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2006 +.Dd August 17, 2018 .Dt PTHREAD_SCHEDPARAM 3 .Os .Sh NAME @@ -41,7 +41,7 @@ .Ft int .Fn pthread_setschedparam "pthread_t thread" "int policy" "const struct sched_param *param" .Ft int -.Fn pthread_getschedparam "pthread_t thread" "int *policy" "struct sched_param *param" +.Fn pthread_getschedparam "pthread_t thread" "int *restrict policy" "struct sched_param *restrict param" .Sh DESCRIPTION The .Fn pthread_setschedparam From owner-svn-src-all@freebsd.org Sat Aug 18 01:12: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 4B67C1080CCC; Sat, 18 Aug 2018 01:12:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE83D7B27F; Sat, 18 Aug 2018 01:12:45 +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 CEDF1108B3; Sat, 18 Aug 2018 01:12:45 +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 w7I1CjnV094250; Sat, 18 Aug 2018 01:12:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I1Cjkw094247; Sat, 18 Aug 2018 01:12:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808180112.w7I1Cjkw094247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 18 Aug 2018 01:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337993 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 337993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 01:12:46 -0000 Author: kevans Date: Sat Aug 18 01:12:44 2018 New Revision: 337993 URL: https://svnweb.freebsd.org/changeset/base/337993 Log: bectl(8): Allow running a custom command in the 'jail' subcommand Instead of always running /bin/sh, allow the user to specify the command to run. The jail is not removed when the command finishes. Meaning, `bectl unjail` will still need to be run. For example: ``` bectl jail newBE pkg upgrade bectl ujail newBE ``` Submitted by: Shawn Webb Obtained from: HardenedBSD (8b451014ab) Modified: head/sbin/bectl/bectl.8 head/sbin/bectl/bectl.c head/sbin/bectl/bectl_jail.c Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Sat Aug 18 01:05:38 2018 (r337992) +++ head/sbin/bectl/bectl.8 Sat Aug 18 01:12:44 2018 (r337993) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2018 +.Dd August 17, 2018 .Dt BECTL 8 .Os .Sh NAME @@ -54,6 +54,7 @@ jail .Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... .Ao Ar jailID | jailName Ac .Ao Ar bootenv Ac +.Op Ar utility Op Ar argument ... .Nm list .Op Fl a @@ -150,6 +151,7 @@ from .Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... .Ao Ar jailID | jailName Ac .Ao Ar bootenv Ac +.Op Ar utility Op Ar argument ... .Pp Creates a jail of the given boot environment. Multiple @@ -161,8 +163,16 @@ arguments may be specified. will set a jail parameter, and .Fl u will unset a jail parameter. -By default, jails are created in interactive mode, with a shell being +.Pp +By default, jails are created in interactive mode and +.Pa /bin/sh +is executed within the jail. +If +.Ar utility +is specified, it will be executed instead of +.Pa /bin/sh . +.Pp The .Fl b argument enables batch mode, thereby disabling interactive mode. Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Sat Aug 18 01:05:38 2018 (r337992) +++ head/sbin/bectl/bectl.c Sat Aug 18 01:12:44 2018 (r337993) @@ -77,7 +77,7 @@ usage(bool explicit) #if SOON "\tbectl add (path)*\n" #endif - "\tbectl jail [-b] [ -o key=value | -u key ]... bootenv\n" + "\tbectl jail [-b] [ -o key=value | -u key ]... bootenv [utility [argument ...]]\n" "\tbectl list [-a] [-D] [-H] [-s]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" Modified: head/sbin/bectl/bectl_jail.c ============================================================================== --- head/sbin/bectl/bectl_jail.c Sat Aug 18 01:05:38 2018 (r337992) +++ head/sbin/bectl/bectl_jail.c Sat Aug 18 01:12:44 2018 (r337993) @@ -238,10 +238,6 @@ bectl_cmd_jail(int argc, char *argv[]) fprintf(stderr, "bectl jail: missing boot environment name\n"); return (usage(false)); } - if (argc > 2) { - fprintf(stderr, "bectl jail: too many arguments\n"); - return (usage(false)); - } bootenv = argv[0]; @@ -284,7 +280,10 @@ bectl_cmd_jail(int argc, char *argv[]) if (interactive) { /* We're attached within the jail... good bye! */ chdir("/"); - execl("/bin/sh", "/bin/sh", NULL); + if (argc > 1) + execve(argv[1], &argv[1], NULL); + else + execl("/bin/sh", "/bin/sh", NULL); return (1); } From owner-svn-src-all@freebsd.org Sat Aug 18 01:14:20 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 7AD331080DCF; Sat, 18 Aug 2018 01:14:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C57A7B41E; Sat, 18 Aug 2018 01:14:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id BFDC4B538; Sat, 18 Aug 2018 01:14:19 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f46.google.com with SMTP id e23-v6so1757997lfc.13; Fri, 17 Aug 2018 18:14:19 -0700 (PDT) X-Gm-Message-State: AOUpUlGCzkjN+MGvjsrlFk7+dcwoB4+Aw5AZf2mx4g7tWdinStF0r6Do 02f+aCXWMG6113n7rQVsi5m/UUwBTfXBaek2mWo= X-Google-Smtp-Source: AA+uWPym1lgft5uekhrSLgFHkr/SEiyO96pEUNKtbGv/dKFZoR67x8Zg8MDrBiW153575rQzL/x1/aMXio8I/ZAo8v8= X-Received: by 2002:a19:26d2:: with SMTP id m201-v6mr22768209lfm.43.1534554858445; Fri, 17 Aug 2018 18:14:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 18:13:57 -0700 (PDT) In-Reply-To: <201808180112.w7I1Cjkw094247@repo.freebsd.org> References: <201808180112.w7I1Cjkw094247@repo.freebsd.org> From: Kyle Evans Date: Fri, 17 Aug 2018 20:13:57 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337993 - head/sbin/bectl To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 01:14:20 -0000 On Fri, Aug 17, 2018 at 8:12 PM, Kyle Evans wrote: > Author: kevans > Date: Sat Aug 18 01:12:44 2018 > New Revision: 337993 > URL: https://svnweb.freebsd.org/changeset/base/337993 > > Log: > bectl(8): Allow running a custom command in the 'jail' subcommand > > Instead of always running /bin/sh, allow the user to specify the command > to run. The jail is not removed when the command finishes. Meaning, > `bectl unjail` will still need to be run. > > For example: > > ``` > bectl jail newBE pkg upgrade > bectl ujail newBE > ``` > > Submitted by: Shawn Webb > Obtained from: HardenedBSD (8b451014ab) > I meant to note here that Shawn can only be blamed for the bectl_jail.c modifications. =) The usage and manpage update were done post-submission, pre-commit. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Sat Aug 18 03:08:55 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 0868A1083F47; Sat, 18 Aug 2018 03:08:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B26137E88C; Sat, 18 Aug 2018 03:08:54 +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 8F1E011B6E; Sat, 18 Aug 2018 03:08:54 +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 w7I38sUJ051540; Sat, 18 Aug 2018 03:08:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I38soM051539; Sat, 18 Aug 2018 03:08:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808180308.w7I38soM051539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 18 Aug 2018 03:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337994 - head/cddl/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/cddl/lib/libbe X-SVN-Commit-Revision: 337994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 03:08:55 -0000 Author: kevans Date: Sat Aug 18 03:08:54 2018 New Revision: 337994 URL: https://svnweb.freebsd.org/changeset/base/337994 Log: libbe(3): Remove -v from LDFLAGS -v is clearly not needed for linking, and it adds extra verbose information that is not necessary. Modified: head/cddl/lib/libbe/Makefile Modified: head/cddl/lib/libbe/Makefile ============================================================================== --- head/cddl/lib/libbe/Makefile Sat Aug 18 01:12:44 2018 (r337993) +++ head/cddl/lib/libbe/Makefile Sat Aug 18 03:08:54 2018 (r337994) @@ -26,7 +26,6 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/comm CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head -LDFLAGS+= -v CFLAGS+= -DNEED_SOLARIS_BOOLEAN From owner-svn-src-all@freebsd.org Sat Aug 18 03:21: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 5C30810842CC; Sat, 18 Aug 2018 03:21:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 062707F3CD; Sat, 18 Aug 2018 03:21:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBF6911D30; Sat, 18 Aug 2018 03:21:00 +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 w7I3L0iB056535; Sat, 18 Aug 2018 03:21:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I3Kx1X056526; Sat, 18 Aug 2018 03:20:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808180320.w7I3Kx1X056526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 18 Aug 2018 03:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337995 - in head: . cddl/lib cddl/lib/libbe lib lib/libbe share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . cddl/lib cddl/lib/libbe lib lib/libbe share/mk X-SVN-Commit-Revision: 337995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 03:21:01 -0000 Author: kevans Date: Sat Aug 18 03:20:59 2018 New Revision: 337995 URL: https://svnweb.freebsd.org/changeset/base/337995 Log: libbe(3): Move build goop back out of cddl/ Some background: in the GSoC project, libbe/Makefile lived in lib/libbe. I created projects/bectl branch, maintained the above for all of five minutes before I misread Makefile.inc1 and decided that it couldn't possibly build outside of cddl/, so I kicked the Makefile out into the cddl/ build and all was good. The misreading was of the bit where .WAIT is added to SUBDIR after lib, libexec but prior to building bin and cddl *only during the install targets*, which is the critical part. Fast forward- buildworld was still broken in my branch unbeknownst to me because I didn't nuke my OBJDIR. Combing through Makefile.inc1 eventually revealed the necessary magic to make sure that libbe's dependencies are specified well enough, and it becomes clear what needs done to make a non-cddl/ build work. This is an interesting prospect, because the build split is kind of annoying to work with. IGNORE_PRAGMA is added to avoid dropping WARNS by one more. This was previously pulled in via cddl/Makefile.inc. Added: head/lib/libbe/Makefile - copied, changed from r337994, head/cddl/lib/libbe/Makefile Deleted: head/cddl/lib/libbe/ Modified: head/Makefile.inc1 head/cddl/lib/Makefile head/lib/Makefile head/share/mk/src.libnames.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Aug 18 03:08:54 2018 (r337994) +++ head/Makefile.inc1 Sat Aug 18 03:20:59 2018 (r337995) @@ -2605,7 +2605,7 @@ cddl/lib/libzfs__L: cddl/lib/libzfs_core__L lib/msun__ cddl/lib/libzfs__L: lib/libthr__L lib/libmd__L lib/libz__L cddl/lib/libumem__L cddl/lib/libzfs__L: cddl/lib/libuutil__L cddl/lib/libavl__L lib/libgeom__L -cddl/lib/libbe__L: cddl/lib/libzfs__L +lib/libbe__L: cddl/lib/libzfs__L .endif _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Sat Aug 18 03:08:54 2018 (r337994) +++ head/cddl/lib/Makefile Sat Aug 18 03:20:59 2018 (r337995) @@ -4,7 +4,6 @@ SUBDIR= ${_drti} \ libavl \ - ${_libbe} \ libctf \ ${_libdtrace} \ libnvpair \ @@ -17,7 +16,6 @@ SUBDIR= ${_drti} \ SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" -_libbe= libbe _libzfs_core= libzfs_core _libzfs= libzfs .if ${MK_LIBTHR} != "no" @@ -30,7 +28,6 @@ _drti= drti _libdtrace= libdtrace .endif -SUBDIR_DEPEND_libbe= libnvpair libzfs SUBDIR_DEPEND_libdtrace= libctf SUBDIR_DEPEND_libzfs_core= libnvpair SUBDIR_DEPEND_libzfs= libavl libnvpair libumem libuutil libzfs_core Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Aug 18 03:08:54 2018 (r337994) +++ head/lib/Makefile Sat Aug 18 03:20:59 2018 (r337995) @@ -209,6 +209,7 @@ SUBDIR.${MK_TESTS}+= tests SUBDIR.${MK_UNBOUND}+= libunbound SUBDIR.${MK_USB}+= libusbhid libusb SUBDIR.${MK_OFED}+= ofed +SUBDIR.${MK_ZFS}+= libbe .if !make(install) SUBDIR_PARALLEL= Copied and modified: head/lib/libbe/Makefile (from r337994, head/cddl/lib/libbe/Makefile) ============================================================================== --- head/cddl/lib/libbe/Makefile Sat Aug 18 03:08:54 2018 (r337994, copy source) +++ head/lib/libbe/Makefile Sat Aug 18 03:20:59 2018 (r337995) @@ -4,19 +4,17 @@ PACKAGE= lib${LIB} LIB= be SHLIB_MAJOR= 1 SHLIB_MINOR= 0 -LIBBE_SRC= ${SRCTOP}/lib/libbe -.PATH: ${LIBBE_SRC} SRCS= be.c be_access.c be_error.c be_info.c INCS= be.h MAN= libbe.3 WARNS?= 2 +IGNORE_PRAGMA= yes LIBADD+= zfs LIBADD+= nvpair -CFLAGS+= -I${LIBBE_SRC} CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sat Aug 18 03:08:54 2018 (r337994) +++ head/share/mk/src.libnames.mk Sat Aug 18 03:20:59 2018 (r337995) @@ -486,7 +486,6 @@ LIBC_NOSSP_PIC?= ${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a # not using a --sysroot or for meta mode bootstrapping when there is no # Makefile.depend. These are sorted by directory. LIBAVLDIR= ${OBJTOP}/cddl/lib/libavl -LIBBEDIR= ${OBJTOP}/cddl/lib/libbe LIBCTFDIR= ${OBJTOP}/cddl/lib/libctf LIBDTRACEDIR= ${OBJTOP}/cddl/lib/libdtrace LIBNVPAIRDIR= ${OBJTOP}/cddl/lib/libnvpair From owner-svn-src-all@freebsd.org Sat Aug 18 04:23: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 037A41085270; Sat, 18 Aug 2018 04:23:53 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94A9181144; Sat, 18 Aug 2018 04:23:52 +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 70357128C4; Sat, 18 Aug 2018 04:23:52 +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 w7I4Nq8M092608; Sat, 18 Aug 2018 04:23:52 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I4NpNY092604; Sat, 18 Aug 2018 04:23:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808180423.w7I4NpNY092604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 18 Aug 2018 04:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337996 - in head/sys: dev/cxgbe modules/cxgbe/if_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys: dev/cxgbe modules/cxgbe/if_cxgbe X-SVN-Commit-Revision: 337996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 04:23:53 -0000 Author: np Date: Sat Aug 18 04:23:51 2018 New Revision: 337996 URL: https://svnweb.freebsd.org/changeset/base/337996 Log: cxgbe(4): Replace T4_PKT_TIMESTAMP with something slightly less hackish. Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/modules/cxgbe/if_cxgbe/Makefile Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Aug 18 03:20:59 2018 (r337995) +++ head/sys/dev/cxgbe/adapter.h Sat Aug 18 04:23:51 2018 (r337996) @@ -349,7 +349,7 @@ enum { /* iq flags */ IQ_ALLOCATED = (1 << 0), /* firmware resources allocated */ IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ - /* 1 << 2 Used to be IQ_INTR */ + IQ_RX_TIMESTAMP = (1 << 2), /* provide the SGE rx timestamp */ IQ_LRO_ENABLED = (1 << 3), /* iq is an eth rxq with LRO enabled */ IQ_ADJ_CREDIT = (1 << 4), /* hw is off by 1 credit for this iq */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Aug 18 03:20:59 2018 (r337995) +++ head/sys/dev/cxgbe/t4_main.c Sat Aug 18 04:23:51 2018 (r337996) @@ -1464,7 +1464,8 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ - IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6 | IFCAP_HWSTATS) + IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6 | IFCAP_HWSTATS | \ + IFCAP_HWRXTSTMP) #define T4_CAP_ENABLE (T4_CAP) static int @@ -1813,6 +1814,18 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd if (mask & IFCAP_TXRTLMT) ifp->if_capenable ^= IFCAP_TXRTLMT; #endif + if (mask & IFCAP_HWRXTSTMP) { + int i; + struct sge_rxq *rxq; + + ifp->if_capenable ^= IFCAP_HWRXTSTMP; + for_each_rxq(vi, i, rxq) { + if (ifp->if_capenable & IFCAP_HWRXTSTMP) + rxq->iq.flags |= IQ_RX_TIMESTAMP; + else + rxq->iq.flags &= ~IQ_RX_TIMESTAMP; + } + } #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Aug 18 03:20:59 2018 (r337995) +++ head/sys/dev/cxgbe/t4_sge.c Sat Aug 18 04:23:51 2018 (r337996) @@ -1564,6 +1564,17 @@ sort_before_lro(struct lro_ctrl *lro) return (lro->lro_mbuf_max != 0); } +static inline uint64_t +last_flit_to_ns(struct adapter *sc, uint64_t lf) +{ + uint64_t n = be64toh(lf) & 0xfffffffffffffff; /* 60b, not 64b. */ + + if (n > UINT64_MAX / 1000000) + return (n / sc->params.vpd.cclk * 1000000); + else + return (n * 1000000 / sc->params.vpd.cclk); +} + /* * Deals with interrupts on an iq+fl queue. */ @@ -1624,19 +1635,21 @@ service_iq_fl(struct sge_iq *iq, int budget) if (__predict_false(m0 == NULL)) goto out; refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; -#ifdef T4_PKT_TIMESTAMP - /* - * 60 bit timestamp for the payload is - * *(uint64_t *)m0->m_pktdat. Note that it is - * in the leading free-space in the mbuf. The - * kernel can clobber it during a pullup, - * m_copymdata, etc. You need to make sure that - * the mbuf reaches you unmolested if you care - * about the timestamp. - */ - *(uint64_t *)m0->m_pktdat = - be64toh(ctrl->u.last_flit) & 0xfffffffffffffff; + + if (iq->flags & IQ_RX_TIMESTAMP) { + /* + * Fill up rcv_tstmp but do not set M_TSTMP. + * rcv_tstmp is not in the format that the + * kernel expects and we don't want to mislead + * it. For now this is only for custom code + * that knows how to interpret cxgbe's stamp. + */ + m0->m_pkthdr.rcv_tstmp = + last_flit_to_ns(sc, d->rsp.u.last_flit); +#ifdef notyet + m0->m_flags |= M_TSTMP; #endif + } /* fall through */ @@ -1814,10 +1827,7 @@ get_scatter_segment(struct adapter *sc, struct sge_fl if (m == NULL) return (NULL); fl->mbuf_allocated++; -#ifdef T4_PKT_TIMESTAMP - /* Leave room for a timestamp */ - m->m_data += 8; -#endif + /* copy data to mbuf */ bcopy(payload, mtod(m, caddr_t), len); Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Sat Aug 18 03:20:59 2018 (r337995) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Sat Aug 18 04:23:51 2018 (r337996) @@ -34,9 +34,6 @@ SRCS+= cudbg_wtp.c SRCS+= fastlz_api.c SRCS+= fastlz.c -# Provide the timestamp of a packet in its header mbuf. -#CFLAGS+= -DT4_PKT_TIMESTAMP - CFLAGS+= -I${CXGBE} .include From owner-svn-src-all@freebsd.org Sat Aug 18 05:35: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 E12BD1086783; Sat, 18 Aug 2018 05:35:52 +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 5A20082EE9; Sat, 18 Aug 2018 05:35:52 +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 w7I5Zf3Z062953; Fri, 17 Aug 2018 22:35:41 -0700 (PDT) (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 w7I5ZfsS062952; Fri, 17 Aug 2018 22:35:41 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808180535.w7I5ZfsS062952@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337956 - in head: . bin/ls In-Reply-To: <201808171549.w7HFndsp059932@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Fri, 17 Aug 2018 22:35:41 -0700 (PDT) CC: Kyle Evans , src-committers , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 05:35:53 -0000 > > On Fri, Aug 17, 2018 at 10:26 AM, Kyle Evans wrote: > > > On Fri, Aug 17, 2018 at 10:24 AM, Rodney W. Grimes > > > wrote: > > >>> Author: kevans > > >>> Date: Fri Aug 17 04:15:51 2018 > > >>> New Revision: 337956 > > >>> URL: https://svnweb.freebsd.org/changeset/base/337956 > > >>> > > >>> Log: > > >>> ls(1): Add --color=when > > >>> > > >>> --color may be set to one of: 'auto', 'always', and 'never'. > > >>> > > >>> 'auto' is the default behavior- output colors only if -G or COLORTERM are > > >> > > >> Why different than coreutils ls? Default for coreutils is none. > > > > > > I guess this was worded poorly and you skipped both the review and > > > reading the diff... this is still contingent on environment variables > > > or -G being specified. > > > > > >>> set, and only if stdout is a tty. > > >>> > > >>> 'always' is a new behavior- output colors always. termcap(5) will be > > >>> consulted unless TERM is unset or not a recognized terminal, in which case > > >>> ls(1) will fall back to explicitly outputting ANSI escape sequences. > > >>> > > >>> 'never' to turn off any environment variable and -G usage. > > >> Why different than core utils? Coreutils uses none. > > > > > > I guess this was worded poorly and you skipped both the review and > > > reading the diff... this is still contingent on environment variables > > > or -G being specified. > > > > > > > ... copy-paste-o. The version of coreutils ls(1) that I have uses > > 'never' for this. There is no valid 'none' value. > > Oh boy, we need to investiage that then, cause it seems > as if the official page says none. Does your say it > has a different default value too? And our package of gnu coreutils also says never, so ignore my raising the issue of none vs never, that needs to be raised with the gnu folks as it seems as if there online manual and the code is in conflict. Ooopss.. retract that here we go... I have our pkg coreutils installed: root@x230a:~ # gls --color=none 828phone.tgz Desktop Downloads firefox.core soffice.bin.core root@x230a:~ # gls --color=never 828phone.tgz Desktop Downloads firefox.core soffice.bin.core root@x230a:~ # gls --color=theychangedit gls: invalid argument 'theychangedit' for '--color' Valid arguments are: - 'always', 'yes', 'force' - 'never', 'no', 'none' - 'auto', 'tty', 'if-tty' Try 'gls --help' for more information. So it looks as if we need to add a we bit more to make our use of --color match what coreutils actually allows. *Runs and ducks* cause Kyle has already gone way above the call of duty on this one! -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Aug 18 06:20: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 288EC1086EEE; Sat, 18 Aug 2018 06:20:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC24983DED; Sat, 18 Aug 2018 06:20:46 +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 AD48B13B8E; Sat, 18 Aug 2018 06:20:46 +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 w7I6Kkil050045; Sat, 18 Aug 2018 06:20:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I6Kk5M050042; Sat, 18 Aug 2018 06:20:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808180620.w7I6Kk5M050042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 18 Aug 2018 06:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337997 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 337997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 06:20:47 -0000 Author: delphij Date: Sat Aug 18 06:20:45 2018 New Revision: 337997 URL: https://svnweb.freebsd.org/changeset/base/337997 Log: Split arc4random_uniform into it's own file and sync with OpenBSD. PR: 182610 Obtained from: OpenBSD MFC after: 2 weeks Added: head/lib/libc/gen/arc4random_uniform.c (contents, props changed) - copied, changed from r337993, head/lib/libc/gen/arc4random.c Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/arc4random.c Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Sat Aug 18 04:23:51 2018 (r337996) +++ head/lib/libc/gen/Makefile.inc Sat Aug 18 06:20:45 2018 (r337997) @@ -16,6 +16,7 @@ SRCS+= __getosreldate.c \ _thread_init.c \ alarm.c \ arc4random.c \ + arc4random_uniform.c \ assert.c \ auxv.c \ basename.c \ Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Sat Aug 18 04:23:51 2018 (r337996) +++ head/lib/libc/gen/arc4random.c Sat Aug 18 06:20:45 2018 (r337997) @@ -244,41 +244,6 @@ arc4random_buf(void *_buf, size_t n) _ARC4_UNLOCK(); } -/* - * Calculate a uniformly distributed random number less than upper_bound - * avoiding "modulo bias". - * - * Uniformity is achieved by generating new random numbers until the one - * returned is outside the range [0, 2**32 % upper_bound). This - * guarantees the selected random number will be inside - * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound) - * after reduction modulo upper_bound. - */ -u_int32_t -arc4random_uniform(u_int32_t upper_bound) -{ - u_int32_t r, min; - - if (upper_bound < 2) - return 0; - - /* 2**32 % x == (2**32 - x) % x */ - min = -upper_bound % upper_bound; - /* - * This could theoretically loop forever but each retry has - * p > 0.5 (worst case, usually far better) of selecting a - * number inside the range we need, so it should rarely need - * to re-roll. - */ - for (;;) { - r = arc4random(); - if (r >= min) - break; - } - - return r % upper_bound; -} - #if 0 /*-------- Test code for i386 --------*/ #include Copied and modified: head/lib/libc/gen/arc4random_uniform.c (from r337993, head/lib/libc/gen/arc4random.c) ============================================================================== --- head/lib/libc/gen/arc4random.c Sat Aug 18 01:12:44 2018 (r337993, copy source) +++ head/lib/libc/gen/arc4random_uniform.c Sat Aug 18 06:20:45 2018 (r337997) @@ -1,7 +1,6 @@ -/* $OpenBSD: arc4random.c,v 1.24 2013/06/11 16:59:50 deraadt Exp $ */ +/* $OpenBSD: arc4random_uniform.c,v 1.2 2015/09/13 08:31:47 guenther Exp $ */ /* - * Copyright (c) 1996, David Mazieres * Copyright (c) 2008, Damien Miller * * Permission to use, copy, modify, and distribute this software for any @@ -15,235 +14,13 @@ * 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. - */ - -/* - * Arc4 random number generator for OpenBSD. * - * This code is derived from section 17.1 of Applied Cryptography, - * second edition, which describes a stream cipher allegedly - * compatible with RSA Labs "RC4" cipher (the actual description of - * which is a trade secret). The same algorithm is used as a stream - * cipher called "arcfour" in Tatu Ylonen's ssh package. - * - * RC4 is a registered trademark of RSA Laboratories. + * $FreeBSD$ */ -#include -__FBSDID("$FreeBSD$"); - -#include "namespace.h" -#include -#include +#include #include -#include -#include -#include -#include -#include -#include "libc_private.h" -#include "un-namespace.h" - -#ifdef __GNUC__ -#define inline __inline -#else /* !__GNUC__ */ -#define inline -#endif /* !__GNUC__ */ - -struct arc4_stream { - u_int8_t i; - u_int8_t j; - u_int8_t s[256]; -}; - -static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; - -#define KEYSIZE 128 -#define _ARC4_LOCK() \ - do { \ - if (__isthreaded) \ - _pthread_mutex_lock(&arc4random_mtx); \ - } while (0) - -#define _ARC4_UNLOCK() \ - do { \ - if (__isthreaded) \ - _pthread_mutex_unlock(&arc4random_mtx); \ - } while (0) - -static int rs_initialized; -static struct arc4_stream rs; -static pid_t arc4_stir_pid; -static int arc4_count; - -extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); - -static inline u_int8_t arc4_getbyte(void); -static void arc4_stir(void); - -static inline void -arc4_init(void) -{ - int n; - - for (n = 0; n < 256; n++) - rs.s[n] = n; - rs.i = 0; - rs.j = 0; -} - -static inline void -arc4_addrandom(u_char *dat, int datlen) -{ - int n; - u_int8_t si; - - rs.i--; - for (n = 0; n < 256; n++) { - rs.i = (rs.i + 1); - si = rs.s[rs.i]; - rs.j = (rs.j + si + dat[n % datlen]); - rs.s[rs.i] = rs.s[rs.j]; - rs.s[rs.j] = si; - } - rs.j = rs.i; -} - -size_t -__arc4_sysctl(u_char *buf, size_t size) -{ - int mib[2]; - size_t len, done; - - mib[0] = CTL_KERN; - mib[1] = KERN_ARND; - done = 0; - - do { - len = size; - if (__sysctl(mib, 2, buf, &len, NULL, 0) == -1) - return (done); - done += len; - buf += len; - size -= len; - } while (size > 0); - - return (done); -} - -static void -arc4_stir(void) -{ - u_char rdat[KEYSIZE]; - int i; - - if (!rs_initialized) { - arc4_init(); - rs_initialized = 1; - } - if (__arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) { - /* - * The sysctl cannot fail. If it does fail on some FreeBSD - * derivative or after some future change, just abort so that - * the problem will be found and fixed. abort is not normally - * suitable for a library but makes sense here. - */ - abort(); - } - - arc4_addrandom(rdat, KEYSIZE); - - /* - * Discard early keystream, as per recommendations in: - * "(Not So) Random Shuffles of RC4" by Ilya Mironov. - */ - for (i = 0; i < 3072; i++) - (void)arc4_getbyte(); - arc4_count = 1600000; -} - -static void -arc4_stir_if_needed(void) -{ - pid_t pid = getpid(); - - if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid) { - arc4_stir_pid = pid; - arc4_stir(); - } -} - -static inline u_int8_t -arc4_getbyte(void) -{ - u_int8_t si, sj; - - rs.i = (rs.i + 1); - si = rs.s[rs.i]; - rs.j = (rs.j + si); - sj = rs.s[rs.j]; - rs.s[rs.i] = sj; - rs.s[rs.j] = si; - return (rs.s[(si + sj) & 0xff]); -} - -static inline u_int32_t -arc4_getword(void) -{ - u_int32_t val; - val = arc4_getbyte() << 24; - val |= arc4_getbyte() << 16; - val |= arc4_getbyte() << 8; - val |= arc4_getbyte(); - return val; -} - -void -arc4random_stir(void) -{ - _ARC4_LOCK(); - arc4_stir(); - _ARC4_UNLOCK(); -} - -void -arc4random_addrandom(u_char *dat, int datlen) -{ - _ARC4_LOCK(); - if (!rs_initialized) - arc4_stir(); - arc4_addrandom(dat, datlen); - _ARC4_UNLOCK(); -} - -u_int32_t -arc4random(void) -{ - u_int32_t val; - _ARC4_LOCK(); - arc4_count -= 4; - arc4_stir_if_needed(); - val = arc4_getword(); - _ARC4_UNLOCK(); - return val; -} - -void -arc4random_buf(void *_buf, size_t n) -{ - u_char *buf = (u_char *)_buf; - _ARC4_LOCK(); - arc4_stir_if_needed(); - while (n--) { - if (--arc4_count <= 0) - arc4_stir(); - buf[n] = arc4_getbyte(); - } - _ARC4_UNLOCK(); -} - /* * Calculate a uniformly distributed random number less than upper_bound * avoiding "modulo bias". @@ -254,16 +31,17 @@ arc4random_buf(void *_buf, size_t n) * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound) * after reduction modulo upper_bound. */ -u_int32_t -arc4random_uniform(u_int32_t upper_bound) +uint32_t +arc4random_uniform(uint32_t upper_bound) { - u_int32_t r, min; + uint32_t r, min; if (upper_bound < 2) return 0; /* 2**32 % x == (2**32 - x) % x */ min = -upper_bound % upper_bound; + /* * This could theoretically loop forever but each retry has * p > 0.5 (worst case, usually far better) of selecting a @@ -278,24 +56,3 @@ arc4random_uniform(u_int32_t upper_bound) return r % upper_bound; } - -#if 0 -/*-------- Test code for i386 --------*/ -#include -#include -int -main(int argc, char **argv) -{ - const int iter = 1000000; - int i; - pctrval v; - - v = rdtsc(); - for (i = 0; i < iter; i++) - arc4random(); - v = rdtsc() - v; - v /= iter; - - printf("%qd cycles\n", v); -} -#endif From owner-svn-src-all@freebsd.org Sat Aug 18 06:24: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 231E210870ED for ; Sat, 18 Aug 2018 06:24:13 +0000 (UTC) (envelope-from gordon@tetlows.org) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (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 B71E1840EA for ; Sat, 18 Aug 2018 06:24:12 +0000 (UTC) (envelope-from gordon@tetlows.org) Received: by mail-qt0-x230.google.com with SMTP id y5-v6so11086411qti.12 for ; Fri, 17 Aug 2018 23:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tetlows.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nLEusjOlMffqHU/ldZ+cWIZDZaUA/fr+rjR8fzUmIAU=; b=Pn+oQAvRYgyzwhDDWnp3hsSj/AHREm4WxYGQQoJDs0Vl6t1Zr4CntxOvqZBKAEVysJ ulEOAE5kVC12ZyPQttx+HASucWnysqhd8Izl6TSG7smUMHKm1uKIuMB/e6iAzX9mjQLT 4Jn6atiCuKj4JM3P1RqhPjBgqyMbj1EJtBC28= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nLEusjOlMffqHU/ldZ+cWIZDZaUA/fr+rjR8fzUmIAU=; b=Fknq3XmVV+0rx2LTP3XoryUCGtJEv94Dw8VTboZPL2v4334nNC/8ge8MGaUNYmZNp6 D5XeDIZo4oyacMh4v9iQD0B+lq5UIw9lQ+jHmk4MsCZYrYVn0dWdfEZGmGG51EwPofMO DJy4y/UMwRln5WMDKPPg5WIqJDe+8lY5GnGIoYFXo6jcVI5kLWPZmuuxIOERbD3El42M KMYdOdV5krsLMJby1mqhp28/oFVmcE0vAzSX6T++FwlHBctbpGOofTy/vE/4yC4ApPlW a4F6mZyt2mNRmnPz2BWCSWBjAGK6p17Tcqo/dBkS/50GOd0kXudKTSc/NXGkREF/PMnP 8a9g== X-Gm-Message-State: AOUpUlFi12tIaIQ+8Bs3pLsJM3trjbyDyPs0IS2z4pq1S6Smfl5lerPl TqmwsFrLPHc2DbnvFlIuqjX0 X-Google-Smtp-Source: AA+uWPwZEEUgcK68qNpkoUPSaiYYKToQhUVpECIGhl8q5aTEQqCj5BDDL9zwW+mhQRkI3RtJ8ehG3Q== X-Received: by 2002:ac8:2a8f:: with SMTP id b15-v6mr36810176qta.405.1534573452038; Fri, 17 Aug 2018 23:24:12 -0700 (PDT) Received: from gmail.com ([2607:fc50:0:7900:0:dead:beef:cafe]) by smtp.gmail.com with ESMTPSA id y47-v6sm2758696qtk.27.2018.08.17.23.24.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 23:24:11 -0700 (PDT) Date: Fri, 17 Aug 2018 23:24:09 -0700 From: Gordon Tetlow To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs2... Message-ID: <20180818062409.GA6651@gmail.com> References: <201808170023.w7H0Np0H027296@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: <201808170023.w7H0Np0H027296@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 06:24:13 -0000 --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 17, 2018 at 12:23:51AM +0000, Conrad Meyer wrote: > Author: cem > Date: Fri Aug 17 00:23:50 2018 > New Revision: 337936 > URL: https://svnweb.freebsd.org/changeset/base/337936 >=20 > Log: > Bring in libsodium to sys/contrib > =20 > Bring in https://github.com/jedisct1/libsodium at > 461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified. > =20 > libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl > ("Networking and Cryptography Library," pronounced "salt") software lib= rary. > At the risk of oversimplifying, libsodium primarily exists to make it e= asier > to use NaCl. NaCl and libsodium provide high quality implementations o= f a > number of useful cryptographic concepts (as well as the underlying > primitics) seeing some adoption in newer network protocols. > =20 > I considered but dismissed cleaning up the directory hierarchy and > discarding artifacts of other build systems in favor of remaining close= to > upstream (and easing future updates). > =20 > Nothing is integrated into the build system yet, so in that sense, no > functional change. Hi! so@ here. Please don't integrate an additional crypto library without consultation from secteam. Bringing in a different crypto implementation has very serious downstream costs. Additionally, I don't see any discussion on current, hackers, arch, or security with a plan for why this is coming into the tree. That said, I've been on vacation the last two weeks, so if I missed something, please feel free to point it out to me. Thanks, Gordon --LQksG6bCIzRHxTLp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEuyjUCzYO7pNq7RVv5fe8y6O93fgFAlt3u4BfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEJC MjhENDBCMzYwRUVFOTM2QUVEMTU2RkU1RjdCQ0NCQTNCRERERjgACgkQ5fe8y6O9 3fg0Qwf+NIuOpRcrCy9oDo5rzsqOOLUAf79uIWZTRWkwQI0OTkpwRbxsnkH7zubu Lfaq/76zIVYgmlC7swg3P3beEbFvLYNAMs9GZtiyfwNT+N8YNPTz5HFvWhp1pfOw QfWI0OIqetApLBinoMdVRd5YDKJb5np/eTJaIejQ4QXUZeqiHeDRp+yykRxyT6IY DbVDQDtEUj9w64HH2ijKCxzT/jYjEQ+Gd8vCEMhKWO1FT+5keomyquWgSw1AVKXF QBg4G4ANd59EF++y7Ms5iCLz+0nAIUEaZZrr2xM4iVMjuIsuiaBt+/rLzjOfhnON 54rpcR+XTZx9hMzXumcSnz1QyWvtyQ== =v7s7 -----END PGP SIGNATURE----- --LQksG6bCIzRHxTLp-- From owner-svn-src-all@freebsd.org Sat Aug 18 06:31: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 B8FAF10872DC; Sat, 18 Aug 2018 06:31:50 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53EA684502; Sat, 18 Aug 2018 06:31:50 +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 3538113C7B; Sat, 18 Aug 2018 06:31:50 +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 w7I6Vo8r057637; Sat, 18 Aug 2018 06:31:50 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I6VnYP057635; Sat, 18 Aug 2018 06:31:49 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808180631.w7I6VnYP057635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 18 Aug 2018 06:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337998 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 337998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 06:31:50 -0000 Author: delphij Date: Sat Aug 18 06:31:49 2018 New Revision: 337998 URL: https://svnweb.freebsd.org/changeset/base/337998 Log: getrandom(2) should not be restricted in capability mode. Modified: head/sys/compat/freebsd32/capabilities.conf head/sys/kern/capabilities.conf Modified: head/sys/compat/freebsd32/capabilities.conf ============================================================================== --- head/sys/compat/freebsd32/capabilities.conf Sat Aug 18 06:20:45 2018 (r337997) +++ head/sys/compat/freebsd32/capabilities.conf Sat Aug 18 06:31:49 2018 (r337998) @@ -134,6 +134,7 @@ getpgrp getpid getppid getpriority +getrandom getresgid getresuid getrlimit Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Sat Aug 18 06:20:45 2018 (r337997) +++ head/sys/kern/capabilities.conf Sat Aug 18 06:31:49 2018 (r337998) @@ -308,6 +308,11 @@ getrusage getsid ## +## Allow getrandom +## +getrandom + +## ## Allow querying socket state, subject to capability rights. ## ## XXXRW: getsockopt(2) may need more attention. From owner-svn-src-all@freebsd.org Sat Aug 18 06:33: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 7013D1087571; Sat, 18 Aug 2018 06:33:52 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 141A384735; Sat, 18 Aug 2018 06:33:52 +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 E7FC613DAC; Sat, 18 Aug 2018 06:33:51 +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 w7I6XpPV059266; Sat, 18 Aug 2018 06:33:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I6Xpwq059264; Sat, 18 Aug 2018 06:33:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808180633.w7I6Xpwq059264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 18 Aug 2018 06:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337999 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 337999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 06:33:52 -0000 Author: delphij Date: Sat Aug 18 06:33:51 2018 New Revision: 337999 URL: https://svnweb.freebsd.org/changeset/base/337999 Log: Regen after r337998. Modified: head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/kern/init_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Sat Aug 18 06:31:49 2018 (r337998) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Sat Aug 18 06:33:51 2018 (r337999) @@ -642,5 +642,5 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_kevent_args), (sy_call_t *)freebsd32_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 560 = freebsd32_kevent */ { AS(freebsd32_cpuset_getdomain_args), (sy_call_t *)freebsd32_cpuset_getdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 561 = freebsd32_cpuset_getdomain */ { AS(freebsd32_cpuset_setdomain_args), (sy_call_t *)freebsd32_cpuset_setdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 562 = freebsd32_cpuset_setdomain */ - { AS(getrandom_args), (sy_call_t *)sys_getrandom, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 563 = getrandom */ + { AS(getrandom_args), (sy_call_t *)sys_getrandom, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 563 = getrandom */ }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sat Aug 18 06:31:49 2018 (r337998) +++ head/sys/kern/init_sysent.c Sat Aug 18 06:33:51 2018 (r337999) @@ -612,5 +612,5 @@ struct sysent sysent[] = { { AS(kevent_args), (sy_call_t *)sys_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 560 = kevent */ { AS(cpuset_getdomain_args), (sy_call_t *)sys_cpuset_getdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 561 = cpuset_getdomain */ { AS(cpuset_setdomain_args), (sy_call_t *)sys_cpuset_setdomain, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 562 = cpuset_setdomain */ - { AS(getrandom_args), (sy_call_t *)sys_getrandom, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 563 = getrandom */ + { AS(getrandom_args), (sy_call_t *)sys_getrandom, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 563 = getrandom */ }; From owner-svn-src-all@freebsd.org Sat Aug 18 08:26: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 D3EFE1089334; Sat, 18 Aug 2018 08:26:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84BCE8745E; Sat, 18 Aug 2018 08:26:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6687A14F79; Sat, 18 Aug 2018 08:26:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8QpLe015896; Sat, 18 Aug 2018 08:26:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8Qk9a015873; Sat, 18 Aug 2018 08:26:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180826.w7I8Qk9a015873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338000 - in vendor/llvm/dist-release_70: cmake/modules docs lib/Analysis lib/CodeGen/SelectionDAG lib/Target/PowerPC lib/Target/X86 lib/Transforms/Vectorize test/Analysis/BasicAA test/... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist-release_70: cmake/modules docs lib/Analysis lib/CodeGen/SelectionDAG lib/Target/PowerPC lib/Target/X86 lib/Transforms/Vectorize test/Analysis/BasicAA test/BugPoint test/CodeGen/AMD... X-SVN-Commit-Revision: 338000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:26:52 -0000 Author: dim Date: Sat Aug 18 08:26:46 2018 New Revision: 338000 URL: https://svnweb.freebsd.org/changeset/base/338000 Log: Vendor import of llvm release_70 branch r339999: https://llvm.org/svn/llvm-project/llvm/branches/release_70@339999 Added: vendor/llvm/dist-release_70/test/Analysis/BasicAA/tail-byval.ll vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/extract-subvector-equal-length.ll vendor/llvm/dist-release_70/test/CodeGen/ARM/inlineasm-operand-implicit-cast.ll vendor/llvm/dist-release_70/test/CodeGen/PowerPC/pr38087.ll vendor/llvm/dist-release_70/test/CodeGen/X86/pr38533.ll vendor/llvm/dist-release_70/test/CodeGen/X86/pr38539.ll vendor/llvm/dist-release_70/test/Transforms/DeadStoreElimination/tail-byval.ll Deleted: vendor/llvm/dist-release_70/test/CodeGen/ARM/inline-asm-operand-implicit-cast.ll Modified: vendor/llvm/dist-release_70/cmake/modules/HandleLLVMOptions.cmake vendor/llvm/dist-release_70/docs/ReleaseNotes.rst vendor/llvm/dist-release_70/lib/Analysis/BasicAliasAnalysis.cpp vendor/llvm/dist-release_70/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist-release_70/lib/Analysis/MemorySSA.cpp vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist-release_70/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist-release_70/lib/Target/X86/X86FlagsCopyLowering.cpp vendor/llvm/dist-release_70/lib/Transforms/Vectorize/SLPVectorizer.cpp vendor/llvm/dist-release_70/test/BugPoint/compile-custom.ll vendor/llvm/dist-release_70/test/BugPoint/unsymbolized.ll vendor/llvm/dist-release_70/test/CodeGen/X86/flags-copy-lowering.mir vendor/llvm/dist-release_70/test/Other/opt-bisect-legacy-pass-manager.ll vendor/llvm/dist-release_70/test/TableGen/JSON.td vendor/llvm/dist-release_70/test/ThinLTO/X86/cache.ll vendor/llvm/dist-release_70/test/Transforms/EarlyCSE/memoryssa.ll vendor/llvm/dist-release_70/test/Transforms/SLPVectorizer/AArch64/PR38339.ll vendor/llvm/dist-release_70/test/tools/gold/X86/common.ll vendor/llvm/dist-release_70/test/tools/gold/X86/v1.16/wrap-1.ll vendor/llvm/dist-release_70/test/tools/gold/X86/v1.16/wrap-2.ll vendor/llvm/dist-release_70/test/tools/llvm-cov/showLineExecutionCounts.cpp vendor/llvm/dist-release_70/test/tools/llvm-objcopy/auto-remove-shndx.test vendor/llvm/dist-release_70/test/tools/llvm-objcopy/many-sections.test vendor/llvm/dist-release_70/test/tools/llvm-objcopy/remove-shndx.test vendor/llvm/dist-release_70/test/tools/llvm-objcopy/strict-no-add.test vendor/llvm/dist-release_70/test/tools/llvm-symbolizer/pdb/pdb.test vendor/llvm/dist-release_70/test/tools/llvm-symbolizer/ppc64.test vendor/llvm/dist-release_70/unittests/Analysis/MemorySSA.cpp vendor/llvm/dist-release_70/utils/lit/lit/Test.py vendor/llvm/dist-release_70/utils/lit/lit/llvm/config.py vendor/llvm/dist-release_70/utils/lit/tests/Inputs/shtest-env/lit.cfg vendor/llvm/dist-release_70/utils/lit/tests/Inputs/shtest-format/external_shell/fail_with_bad_encoding.txt vendor/llvm/dist-release_70/utils/lit/tests/Inputs/shtest-format/lit.cfg vendor/llvm/dist-release_70/utils/lit/tests/Inputs/shtest-shell/dev-null.txt vendor/llvm/dist-release_70/utils/lit/tests/Inputs/shtest-shell/lit.cfg vendor/llvm/dist-release_70/utils/lit/tests/Inputs/shtest-shell/redirects.txt vendor/llvm/dist-release_70/utils/lit/tests/Inputs/shtest-shell/valid-shell.txt vendor/llvm/dist-release_70/utils/lit/tests/Inputs/shtest-timeout/lit.cfg vendor/llvm/dist-release_70/utils/lit/tests/lit.cfg Modified: vendor/llvm/dist-release_70/cmake/modules/HandleLLVMOptions.cmake ============================================================================== --- vendor/llvm/dist-release_70/cmake/modules/HandleLLVMOptions.cmake Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/cmake/modules/HandleLLVMOptions.cmake Sat Aug 18 08:26:46 2018 (r338000) @@ -149,6 +149,7 @@ endif() # is unloaded. if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,nodelete") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,nodelete") endif() Modified: vendor/llvm/dist-release_70/docs/ReleaseNotes.rst ============================================================================== --- vendor/llvm/dist-release_70/docs/ReleaseNotes.rst Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/docs/ReleaseNotes.rst Sat Aug 18 08:26:46 2018 (r338000) @@ -121,6 +121,16 @@ Non-comprehensive list of changes in this release not to be compliant, and higher optimization levels will still emit some information in v4 format. +* Added support for the ``.rva`` assembler directive for COFF targets. + +* The :program:`llvm-rc` tool (Windows Resource Compiler) has been improved + a bit. There are still known missing features, but it is generally usable + in many cases. (The tool still doesn't preprocess input files automatically, + but it can now handle leftover C declarations in preprocessor output, if + given output from a preprocessor run externally.) + +* CodeView debug info can now be emitted MinGW configurations, if requested. + * Note.. .. NOTE @@ -144,12 +154,36 @@ Changes to the LLVM IR * invariant.group metadata can now refer only empty metadata nodes. -Changes to the ARM Backend --------------------------- +Changes to the AArch64 Target +----------------------------- - During this release ... +* The ``.inst`` assembler directive is now usable on both COFF and Mach-O + targets, in addition to ELF. +* Support for most remaining COFF relocations have been added. +* Support for TLS on Windows has been added. + +Changes to the ARM Target +------------------------- + +* The ``.inst`` assembler directive is now usable on both COFF and Mach-O + targets, in addition to ELF. For Thumb, it can now also automatically + deduce the instruction size, without having to specify it with + e.g. ``.inst.w`` as before. + +Changes to the Hexagon Target +----------------------------- + +* Hexagon now supports auto-vectorization for HVX. It is disabled by default + and can be turned on with ``-fvectorize``. For auto-vectorization to take + effect, code generation for HVX needs to be enabled with ``-mhvx``. + The complete set of options should include ``-fvectorize``, ``-mhvx``, + and ``-mhvx-length={64b|128b}``. + +* The support for Hexagon ISA V4 is deprecated and will be removed in the + next release. + Changes to the MIPS Target -------------------------- @@ -184,7 +218,13 @@ During this release the SystemZ target has: Changes to the X86 Target ------------------------- - During this release ... +* The calling convention for the ``f80`` data type on MinGW targets has been + fixed. Normally, the calling convention for this type is handled within clang, + but if an intrinsic is used, which LLVM expands into a libcall, the + proper calling convention needs to be supported in LLVM as well. (Note, + on Windows, this data type is only used for long doubles in MinGW + environments - in MSVC environments, long doubles are the same size as + normal doubles.) Changes to the AMDGPU Target ----------------------------- Modified: vendor/llvm/dist-release_70/lib/Analysis/BasicAliasAnalysis.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Analysis/BasicAliasAnalysis.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/Analysis/BasicAliasAnalysis.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -801,14 +801,15 @@ ModRefInfo BasicAAResult::getModRefInfo(ImmutableCallS const Value *Object = GetUnderlyingObject(Loc.Ptr, DL); - // If this is a tail call and Loc.Ptr points to a stack location, we know that - // the tail call cannot access or modify the local stack. - // We cannot exclude byval arguments here; these belong to the caller of - // the current function not to the current function, and a tail callee - // may reference them. + // Calls marked 'tail' cannot read or write allocas from the current frame + // because the current frame might be destroyed by the time they run. However, + // a tail call may use an alloca with byval. Calling with byval copies the + // contents of the alloca into argument registers or stack slots, so there is + // no lifetime issue. if (isa(Object)) if (const CallInst *CI = dyn_cast(CS.getInstruction())) - if (CI->isTailCall()) + if (CI->isTailCall() && + !CI->getAttributes().hasAttrSomewhere(Attribute::ByVal)) return ModRefInfo::NoModRef; // If the pointer is to a locally allocated object that does not escape, Modified: vendor/llvm/dist-release_70/lib/Analysis/InstructionSimplify.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Analysis/InstructionSimplify.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/Analysis/InstructionSimplify.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -1338,7 +1338,7 @@ static Value *SimplifyLShrInst(Value *Op0, Value *Op1, const KnownBits YKnown = computeKnownBits(Y, Q.DL, 0, Q.AC, Q.CxtI, Q.DT); const unsigned Width = Op0->getType()->getScalarSizeInBits(); const unsigned EffWidthY = Width - YKnown.countMinLeadingZeros(); - if (EffWidthY <= ShRAmt->getZExtValue()) + if (ShRAmt->uge(EffWidthY)) return X; } @@ -1878,9 +1878,9 @@ static Value *SimplifyAndInst(Value *Op0, Value *Op1, match(Op0, m_c_Or(m_CombineAnd(m_NUWShl(m_Value(X), m_APInt(ShAmt)), m_Value(XShifted)), m_Value(Y)))) { - const unsigned ShftCnt = ShAmt->getZExtValue(); - const KnownBits YKnown = computeKnownBits(Y, Q.DL, 0, Q.AC, Q.CxtI, Q.DT); const unsigned Width = Op0->getType()->getScalarSizeInBits(); + const unsigned ShftCnt = ShAmt->getLimitedValue(Width); + const KnownBits YKnown = computeKnownBits(Y, Q.DL, 0, Q.AC, Q.CxtI, Q.DT); const unsigned EffWidthY = Width - YKnown.countMinLeadingZeros(); if (EffWidthY <= ShftCnt) { const KnownBits XKnown = computeKnownBits(X, Q.DL, 0, Q.AC, Q.CxtI, Modified: vendor/llvm/dist-release_70/lib/Analysis/MemorySSA.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Analysis/MemorySSA.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/Analysis/MemorySSA.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -258,13 +258,18 @@ static ClobberAlias instructionClobbersQuery(MemoryDef if (const IntrinsicInst *II = dyn_cast(DefInst)) { // These intrinsics will show up as affecting memory, but they are just - // markers. + // markers, mostly. + // + // FIXME: We probably don't actually want MemorySSA to model these at all + // (including creating MemoryAccesses for them): we just end up inventing + // clobbers where they don't really exist at all. Please see D43269 for + // context. switch (II->getIntrinsicID()) { case Intrinsic::lifetime_start: if (UseCS) return {false, NoAlias}; AR = AA.alias(MemoryLocation(II->getArgOperand(1)), UseLoc); - return {AR == MustAlias, AR}; + return {AR != NoAlias, AR}; case Intrinsic::lifetime_end: case Intrinsic::invariant_start: case Intrinsic::invariant_end: Modified: vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -1778,15 +1778,16 @@ SDValue DAGTypeLegalizer::PromoteFloatOp_BITCAST(SDNod SDValue Op = N->getOperand(0); EVT OpVT = Op->getValueType(0); - EVT IVT = EVT::getIntegerVT(*DAG.getContext(), OpVT.getSizeInBits()); - assert (IVT == N->getValueType(0) && "Bitcast to type of different size"); - SDValue Promoted = GetPromotedFloat(N->getOperand(0)); EVT PromotedVT = Promoted->getValueType(0); // Convert the promoted float value to the desired IVT. - return DAG.getNode(GetPromotionOpcode(PromotedVT, OpVT), SDLoc(N), IVT, - Promoted); + EVT IVT = EVT::getIntegerVT(*DAG.getContext(), OpVT.getSizeInBits()); + SDValue Convert = DAG.getNode(GetPromotionOpcode(PromotedVT, OpVT), SDLoc(N), + IVT, Promoted); + // The final result type might not be an scalar so we need a bitcast. The + // bitcast will be further legalized if needed. + return DAG.getBitcast(N->getValueType(0), Convert); } // Promote Operand 1 of FCOPYSIGN. Operand 0 ought to be handled by @@ -1941,8 +1942,12 @@ void DAGTypeLegalizer::PromoteFloatResult(SDNode *N, u SDValue DAGTypeLegalizer::PromoteFloatRes_BITCAST(SDNode *N) { EVT VT = N->getValueType(0); EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT); - return DAG.getNode(GetPromotionOpcode(VT, NVT), SDLoc(N), NVT, - N->getOperand(0)); + // Input type isn't guaranteed to be a scalar int so bitcast if not. The + // bitcast will be legalized further if necessary. + EVT IVT = EVT::getIntegerVT(*DAG.getContext(), + N->getOperand(0).getValueType().getSizeInBits()); + SDValue Cast = DAG.getBitcast(IVT, N->getOperand(0)); + return DAG.getNode(GetPromotionOpcode(VT, NVT), SDLoc(N), NVT, Cast); } SDValue DAGTypeLegalizer::PromoteFloatRes_ConstantFP(SDNode *N) { Modified: vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -269,8 +269,8 @@ SDValue DAGTypeLegalizer::PromoteIntRes_BITCAST(SDNode return DAG.getNode(ISD::ANY_EXTEND, dl, NOutVT, GetSoftenedFloat(InOp)); case TargetLowering::TypePromoteFloat: { // Convert the promoted float by hand. - SDValue PromotedOp = GetPromotedFloat(InOp); - return DAG.getNode(ISD::FP_TO_FP16, dl, NOutVT, PromotedOp); + if (!NOutVT.isVector()) + return DAG.getNode(ISD::FP_TO_FP16, dl, NOutVT, GetPromotedFloat(InOp)); break; } case TargetLowering::TypeExpandInteger: Modified: vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/SelectionDAG.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -2374,7 +2374,7 @@ void SelectionDAG::computeKnownBits(SDValue Op, KnownB if (SubIdx && SubIdx->getAPIntValue().ule(NumSrcElts - NumElts)) { // Offset the demanded elts by the subvector index. uint64_t Idx = SubIdx->getZExtValue(); - APInt DemandedSrc = DemandedElts.zext(NumSrcElts).shl(Idx); + APInt DemandedSrc = DemandedElts.zextOrSelf(NumSrcElts).shl(Idx); computeKnownBits(Src, Known, DemandedSrc, Depth + 1); } else { computeKnownBits(Src, Known, Depth + 1); @@ -3533,7 +3533,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, if (SubIdx && SubIdx->getAPIntValue().ule(NumSrcElts - NumElts)) { // Offset the demanded elts by the subvector index. uint64_t Idx = SubIdx->getZExtValue(); - APInt DemandedSrc = DemandedElts.zext(NumSrcElts).shl(Idx); + APInt DemandedSrc = DemandedElts.zextOrSelf(NumSrcElts).shl(Idx); return ComputeNumSignBits(Src, DemandedSrc, Depth + 1); } return ComputeNumSignBits(Src, Depth + 1); Modified: vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -7768,10 +7768,29 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCall SDValue Val = RetValRegs.getCopyFromRegs(DAG, FuncInfo, getCurSDLoc(), Chain, &Flag, CS.getInstruction()); - // FIXME: Why don't we do this for inline asms with MRVs? - if (CS.getType()->isSingleValueType() && CS.getType()->isSized()) { - EVT ResultType = TLI.getValueType(DAG.getDataLayout(), CS.getType()); - + llvm::Type *CSResultType = CS.getType(); + unsigned numRet; + ArrayRef ResultTypes; + SmallVector ResultValues(1); + if (CSResultType->isSingleValueType()) { + numRet = 1; + ResultValues[0] = Val; + ResultTypes = makeArrayRef(CSResultType); + } else { + numRet = CSResultType->getNumContainedTypes(); + assert(Val->getNumOperands() == numRet && + "Mismatch in number of output operands in asm result"); + ResultTypes = CSResultType->subtypes(); + ArrayRef ValueUses = Val->ops(); + ResultValues.resize(numRet); + std::transform(ValueUses.begin(), ValueUses.end(), ResultValues.begin(), + [](const SDUse &u) -> SDValue { return u.get(); }); + } + SmallVector ResultVTs(numRet); + for (unsigned i = 0; i < numRet; i++) { + EVT ResultVT = TLI.getValueType(DAG.getDataLayout(), ResultTypes[i]); + SDValue Val = ResultValues[i]; + assert(ResultTypes[i]->isSized() && "Unexpected unsized type"); // If the type of the inline asm call site return value is different but // has same size as the type of the asm output bitcast it. One example // of this is for vectors with different width / number of elements. @@ -7782,22 +7801,24 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCall // This can also happen for a return value that disagrees with the // register class it is put in, eg. a double in a general-purpose // register on a 32-bit machine. - if (ResultType != Val.getValueType() && - ResultType.getSizeInBits() == Val.getValueSizeInBits()) { - Val = DAG.getNode(ISD::BITCAST, getCurSDLoc(), - ResultType, Val); - - } else if (ResultType != Val.getValueType() && - ResultType.isInteger() && Val.getValueType().isInteger()) { - // If a result value was tied to an input value, the computed result may - // have a wider width than the expected result. Extract the relevant - // portion. - Val = DAG.getNode(ISD::TRUNCATE, getCurSDLoc(), ResultType, Val); + if (ResultVT != Val.getValueType() && + ResultVT.getSizeInBits() == Val.getValueSizeInBits()) + Val = DAG.getNode(ISD::BITCAST, getCurSDLoc(), ResultVT, Val); + else if (ResultVT != Val.getValueType() && ResultVT.isInteger() && + Val.getValueType().isInteger()) { + // If a result value was tied to an input value, the computed result + // may have a wider width than the expected result. Extract the + // relevant portion. + Val = DAG.getNode(ISD::TRUNCATE, getCurSDLoc(), ResultVT, Val); } - assert(ResultType == Val.getValueType() && "Asm result value mismatch!"); + assert(ResultVT == Val.getValueType() && "Asm result value mismatch!"); + ResultVTs[i] = ResultVT; + ResultValues[i] = Val; } + Val = DAG.getNode(ISD::MERGE_VALUES, getCurSDLoc(), + DAG.getVTList(ResultVTs), ResultValues); setValue(CS.getInstruction(), Val); // Don't need to use this as a chain in this case. if (!IA->hasSideEffects() && !hasMemory && IndirectStoresToEmit.empty()) Modified: vendor/llvm/dist-release_70/lib/Target/PowerPC/PPCISelLowering.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Target/PowerPC/PPCISelLowering.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/Target/PowerPC/PPCISelLowering.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -12007,10 +12007,15 @@ static SDValue combineBVOfVecSExt(SDNode *N, Selection auto isSExtOfVecExtract = [&](SDValue Op) -> bool { if (!Op) return false; - if (Op.getOpcode() != ISD::SIGN_EXTEND) + if (Op.getOpcode() != ISD::SIGN_EXTEND && + Op.getOpcode() != ISD::SIGN_EXTEND_INREG) return false; + // A SIGN_EXTEND_INREG might be fed by an ANY_EXTEND to produce a value + // of the right width. SDValue Extract = Op.getOperand(0); + if (Extract.getOpcode() == ISD::ANY_EXTEND) + Extract = Extract.getOperand(0); if (Extract.getOpcode() != ISD::EXTRACT_VECTOR_ELT) return false; @@ -12098,8 +12103,10 @@ SDValue PPCTargetLowering::DAGCombineBuildVector(SDNod return Reduced; // If we're building a vector out of extended elements from another vector - // we have P9 vector integer extend instructions. - if (Subtarget.hasP9Altivec()) { + // we have P9 vector integer extend instructions. The code assumes legal + // input types (i.e. it can't handle things like v4i16) so do not run before + // legalization. + if (Subtarget.hasP9Altivec() && !DCI.isBeforeLegalize()) { Reduced = combineBVOfVecSExt(N, DAG); if (Reduced) return Reduced; Modified: vendor/llvm/dist-release_70/lib/Target/X86/X86FlagsCopyLowering.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Target/X86/X86FlagsCopyLowering.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/Target/X86/X86FlagsCopyLowering.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -97,6 +97,7 @@ class X86FlagsCopyLoweringPass : public MachineFunctio private: MachineRegisterInfo *MRI; + const X86Subtarget *Subtarget; const X86InstrInfo *TII; const TargetRegisterInfo *TRI; const TargetRegisterClass *PromoteRC; @@ -346,10 +347,10 @@ bool X86FlagsCopyLoweringPass::runOnMachineFunction(Ma LLVM_DEBUG(dbgs() << "********** " << getPassName() << " : " << MF.getName() << " **********\n"); - auto &Subtarget = MF.getSubtarget(); + Subtarget = &MF.getSubtarget(); MRI = &MF.getRegInfo(); - TII = Subtarget.getInstrInfo(); - TRI = Subtarget.getRegisterInfo(); + TII = Subtarget->getInstrInfo(); + TRI = Subtarget->getRegisterInfo(); MDT = &getAnalysis(); PromoteRC = &X86::GR8RegClass; @@ -960,10 +961,14 @@ void X86FlagsCopyLoweringPass::rewriteSetCarryExtended .addReg(Reg) .addImm(SubRegIdx[OrigRegSize]); } else if (OrigRegSize > TargetRegSize) { - BuildMI(MBB, SetPos, SetLoc, TII->get(TargetOpcode::EXTRACT_SUBREG), + if (TargetRegSize == 1 && !Subtarget->is64Bit()) { + // Need to constrain the register class. + MRI->constrainRegClass(Reg, &X86::GR32_ABCDRegClass); + } + + BuildMI(MBB, SetPos, SetLoc, TII->get(TargetOpcode::COPY), NewReg) - .addReg(Reg) - .addImm(SubRegIdx[TargetRegSize]); + .addReg(Reg, 0, SubRegIdx[TargetRegSize]); } else { BuildMI(MBB, SetPos, SetLoc, TII->get(TargetOpcode::COPY), NewReg) .addReg(Reg); Modified: vendor/llvm/dist-release_70/lib/Transforms/Vectorize/SLPVectorizer.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Transforms/Vectorize/SLPVectorizer.cpp Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/lib/Transforms/Vectorize/SLPVectorizer.cpp Sat Aug 18 08:26:46 2018 (r338000) @@ -3109,14 +3109,8 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) { } if (NeedToShuffleReuses) { // TODO: Merge this shuffle with the ReorderShuffleMask. - if (!E->ReorderIndices.empty()) + if (E->ReorderIndices.empty()) Builder.SetInsertPoint(VL0); - else if (auto *I = dyn_cast(V)) - Builder.SetInsertPoint(I->getParent(), - std::next(I->getIterator())); - else - Builder.SetInsertPoint(&F->getEntryBlock(), - F->getEntryBlock().getFirstInsertionPt()); V = Builder.CreateShuffleVector(V, UndefValue::get(VecTy), E->ReuseShuffleIndices, "shuffle"); } Added: vendor/llvm/dist-release_70/test/Analysis/BasicAA/tail-byval.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist-release_70/test/Analysis/BasicAA/tail-byval.ll Sat Aug 18 08:26:46 2018 (r338000) @@ -0,0 +1,15 @@ +; RUN: opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output < %s 2>&1 | FileCheck %s + +declare void @takebyval(i32* byval %p) + +define i32 @tailbyval() { +entry: + %p = alloca i32 + store i32 42, i32* %p + tail call void @takebyval(i32* byval %p) + %rv = load i32, i32* %p + ret i32 %rv +} +; FIXME: This should be Just Ref. +; CHECK-LABEL: Function: tailbyval: 1 pointers, 1 call sites +; CHECK-NEXT: Both ModRef: Ptr: i32* %p <-> tail call void @takebyval(i32* byval %p) Modified: vendor/llvm/dist-release_70/test/BugPoint/compile-custom.ll ============================================================================== --- vendor/llvm/dist-release_70/test/BugPoint/compile-custom.ll Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/test/BugPoint/compile-custom.ll Sat Aug 18 08:26:46 2018 (r338000) @@ -1,4 +1,4 @@ -; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext --compile-custom --compile-command="%python %/s.py arg1 arg2" --opt-command opt --output-prefix %t %s | FileCheck %s +; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext --compile-custom --compile-command="%/s.py arg1 arg2" --opt-command opt --output-prefix %t %s | FileCheck %s ; REQUIRES: loadable_module ; Test that arguments are correctly passed in --compile-command. The output Modified: vendor/llvm/dist-release_70/test/BugPoint/unsymbolized.ll ============================================================================== --- vendor/llvm/dist-release_70/test/BugPoint/unsymbolized.ll Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/test/BugPoint/unsymbolized.ll Sat Aug 18 08:26:46 2018 (r338000) @@ -2,7 +2,7 @@ ; RUN: echo "import sys" > %t.py ; RUN: echo "print('args = ' + str(sys.argv))" >> %t.py ; RUN: echo "exit(1)" >> %t.py -; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -opt-command="%python" -opt-args %t.py | FileCheck %s +; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -opt-command=%python -opt-args %t.py | FileCheck %s ; RUN: not --crash opt -load %llvmshlibdir/BugpointPasses%shlibext %s -bugpoint-crashcalls -disable-symbolication 2>&1 | FileCheck --check-prefix=CRASH %s ; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -opt-command=%t.non.existent.opt.binary -opt-args %t.py 2>&1 | FileCheck %s --check-prefix=BAD-OPT Added: vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/extract-subvector-equal-length.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/extract-subvector-equal-length.ll Sat Aug 18 08:26:46 2018 (r338000) @@ -0,0 +1,30 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -march=amdgcn -mtriple=amdgcn-- -verify-machineinstrs < %s | FileCheck %s + +; Test for ICE in SelectionDAG::computeKnownBits when visiting EXTRACT_SUBVECTOR +; with DemandedElts already as wide as the source vector. + +define <3 x i32> @quux() #0 { +; CHECK-LABEL: quux: +; CHECK: ; %bb.0: ; %bb +; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) +; CHECK-NEXT: v_mov_b32_e32 v0, 0 +; CHECK-NEXT: v_mov_b32_e32 v1, 1 +; CHECK-NEXT: v_mov_b32_e32 v2, 1 +; CHECK-NEXT: s_setpc_b64 s[30:31] +bb: + %tmp = shufflevector <4 x i8> , <4 x i8> undef, <3 x i32> + %tmp1 = extractelement <3 x i8> %tmp, i64 0 + %tmp2 = zext i8 %tmp1 to i32 + %tmp3 = insertelement <3 x i32> undef, i32 %tmp2, i32 0 + %tmp4 = extractelement <3 x i8> %tmp, i64 1 + %tmp5 = zext i8 %tmp4 to i32 + %tmp6 = insertelement <3 x i32> %tmp3, i32 %tmp5, i32 1 + %tmp7 = extractelement <3 x i8> %tmp, i64 2 + %tmp8 = zext i8 %tmp7 to i32 + %tmp9 = insertelement <3 x i32> %tmp6, i32 %tmp8, i32 2 + %tmp10 = lshr <3 x i32> %tmp9, + ret <3 x i32> %tmp10 +} + +attributes #0 = { noinline optnone } Added: vendor/llvm/dist-release_70/test/CodeGen/ARM/inlineasm-operand-implicit-cast.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist-release_70/test/CodeGen/ARM/inlineasm-operand-implicit-cast.ll Sat Aug 18 08:26:46 2018 (r338000) @@ -0,0 +1,307 @@ +; RUN: llc -mtriple armv7-arm-linux-gnueabihf -O2 -mcpu=cortex-a7 < %s | FileCheck %s + +%struct.twofloat = type { float, float } +%struct.twodouble = type { double, double } + +; Check support for returning a float in GPR with soft float ABI +define arm_aapcscc float @zerobits_float_soft() #0 { +; CHECK-LABEL: zerobits_float_soft +; CHECK: mov r0, #0 + %1 = tail call float asm "mov ${0}, #0", "=&r"() + ret float %1 +} + +; Check support for returning a double in GPR with soft float ABI +define arm_aapcscc double @zerobits_double_soft() #0 { +; CHECK-LABEL: zerobits_double_soft +; CHECK: mov r0, #0 +; CHECK-NEXT: mov r1, #0 + %1 = tail call double asm "mov ${0:Q}, #0\0Amov ${0:R}, #0", "=&r"() + ret double %1 +} + +; Check support for returning a float in GPR with matching float input with +; soft float ABI +define arm_aapcscc float @flt_gpr_matching_in_op_soft(float %f) #0 { +; CHECK-LABEL: flt_gpr_matching_in_op_soft +; CHECK: mov r0, r0 + %1 = call float asm "mov $0, $1", "=&r,0"(float %f) + ret float %1 +} + +; Check support for returning a double in GPR with matching double input with +; soft float ABI +define arm_aapcscc double @dbl_gpr_matching_in_op_soft(double %d) #0 { +; CHECK-LABEL: dbl_gpr_matching_in_op_soft +; CHECK: mov r1, r0 + %1 = call double asm "mov ${0:R}, ${1:Q}", "=&r,0"(double %d) + ret double %1 +} + +; Check support for returning a float in specific GPR with matching float input +; with soft float ABI +define arm_aapcscc float @flt_gpr_matching_spec_reg_in_op_soft(float %f) #0 { +; CHECK-LABEL: flt_gpr_matching_spec_reg_in_op_soft +; CHECK: mov r3, r3 + %1 = call float asm "mov $0, $1", "=&{r3},0"(float %f) + ret float %1 +} + +; Check support for returning a double in specific GPR with matching double +; input with soft float ABI +define arm_aapcscc double @dbl_gpr_matching_spec_reg_in_op_soft(double %d) #0 { +; CHECK-LABEL: dbl_gpr_matching_spec_reg_in_op_soft +; CHECK: mov r3, r2 + %1 = call double asm "mov ${0:R}, ${1:Q}", "=&{r2},0"(double %d) + ret double %1 +} + +; Check support for returning several float in GPR +define arm_aapcscc float @zerobits_float_convoluted_soft() #0 { +; CHECK-LABEL: zerobits_float_convoluted_soft +; CHECK: mov r0, #0 +; CHECK-NEXT: mov r1, #0 + %1 = call { float, float } asm "mov $0, #0; mov $1, #0", "=r,=r"() + %asmresult = extractvalue { float, float } %1, 0 + %asmresult1 = extractvalue { float, float } %1, 1 + %add = fadd float %asmresult, %asmresult1 + ret float %add +} + +; Check support for returning several double in GPR +define double @zerobits_double_convoluted_soft() #0 { +; CHECK-LABEL: zerobits_double_convoluted_soft +; CHECK: mov r0, #0 +; CHECK-NEXT: mov r1, #0 +; CHECK-NEXT: mov r2, #0 +; CHECK-NEXT: mov r3, #0 + %1 = call { double, double } asm "mov ${0:Q}, #0; mov ${0:R}, #0; mov ${1:Q}, #0; mov ${1:R}, #0", "=r,=r"() + %asmresult = extractvalue { double, double } %1, 0 + %asmresult1 = extractvalue { double, double } %1, 1 + %add = fadd double %asmresult, %asmresult1 + ret double %add +} + +; Check support for returning several floats in GPRs with matching float inputs +; with soft float ABI +define arm_aapcscc float @flt_gprs_matching_in_op_soft(float %f1, float %f2) #0 { +; CHECK-LABEL: flt_gprs_matching_in_op_soft +; CHECK: mov r0, r0 +; CHECK-NEXT: mov r1, r1 + %1 = call { float, float } asm "mov $0, $2; mov $1, $3", "=&r,=&r,0,1"(float %f1, float %f2) + %asmresult1 = extractvalue { float, float } %1, 0 + %asmresult2 = extractvalue { float, float } %1, 1 + %add = fadd float %asmresult1, %asmresult2 + ret float %add +} + +; Check support for returning several double in GPRs with matching double input +; with soft float ABI +define arm_aapcscc double @dbl_gprs_matching_in_op_soft(double %d1, double %d2) #0 { +; CHECK-LABEL: dbl_gprs_matching_in_op_soft +; CHECK: mov r1, r0 +; CHECK-NEXT: mov r3, r2 + %1 = call { double, double } asm "mov ${0:R}, ${2:Q}; mov ${1:R}, ${3:Q}", "=&r,=&r,0,1"(double %d1, double %d2) + %asmresult1 = extractvalue { double, double } %1, 0 + %asmresult2 = extractvalue { double, double } %1, 1 + %add = fadd double %asmresult1, %asmresult2 + ret double %add +} + +; Check support for returning several float in specific GPRs with matching +; float input with soft float ABI +define arm_aapcscc float @flt_gprs_matching_spec_reg_in_op_soft(float %f1, float %f2) #0 { +; CHECK-LABEL: flt_gprs_matching_spec_reg_in_op_soft +; CHECK: mov r3, r3 +; CHECK-NEXT: mov r4, r4 + %1 = call { float, float } asm "mov $0, $2; mov $1, $3", "=&{r3},=&{r4},0,1"(float %f1, float %f2) + %asmresult1 = extractvalue { float, float } %1, 0 + %asmresult2 = extractvalue { float, float } %1, 1 + %add = fadd float %asmresult1, %asmresult2 + ret float %add +} + +; Check support for returning several double in specific GPRs with matching +; double input with soft float ABI +define arm_aapcscc double @dbl_gprs_matching_spec_reg_in_op_soft(double %d1, double %d2) #0 { +; CHECK-LABEL: dbl_gprs_matching_spec_reg_in_op_soft +; CHECK: mov r3, r2 +; CHECK-NEXT: mov r5, r4 + %1 = call { double, double } asm "mov ${0:R}, ${2:Q}; mov ${1:R}, ${3:Q}", "=&{r2},=&{r4},0,1"(double %d1, double %d2) + %asmresult1 = extractvalue { double, double } %1, 0 + %asmresult2 = extractvalue { double, double } %1, 1 + %add = fadd double %asmresult1, %asmresult2 + ret double %add +} + +attributes #0 = { nounwind "target-features"="+d16,+vfp2,+vfp3,-fp-only-sp" "use-soft-float"="true" } + + +; Check support for returning a float in GPR with hard float ABI +define float @zerobits_float_hard() #1 { +; CHECK-LABEL: zerobits_float_hard +; CHECK: mov r0, #0 +; CHECK: vmov s0, r0 + %1 = tail call float asm "mov ${0}, #0", "=&r"() + ret float %1 +} + +; Check support for returning a double in GPR with hard float ABI +define double @zerobits_double_hard() #1 { +; CHECK-LABEL: zerobits_double_hard +; CHECK: mov r0, #0 +; CHECK-NEXT: mov r1, #0 +; CHECK: vmov d0, r0, r1 + %1 = tail call double asm "mov ${0:Q}, #0\0Amov ${0:R}, #0", "=&r"() + ret double %1 +} + +; Check support for returning a float in GPR with matching float input with +; hard float ABI +define float @flt_gpr_matching_in_op_hard(float %f) #1 { +; CHECK-LABEL: flt_gpr_matching_in_op_hard +; CHECK: vmov r0, s0 +; CHECK: mov r0, r0 +; CHECK: vmov s0, r0 + %1 = call float asm "mov $0, $1", "=&r,0"(float %f) + ret float %1 +} + +; Check support for returning a double in GPR with matching double input with +; hard float ABI +define double @dbl_gpr_matching_in_op_hard(double %d) #1 { +; CHECK-LABEL: dbl_gpr_matching_in_op_hard +; CHECK: vmov r0, r1, d0 +; CHECK: mov r1, r0 +; CHECK: vmov d0, r0, r1 + %1 = call double asm "mov ${0:R}, ${1:Q}", "=&r,0"(double %d) + ret double %1 +} + +; Check support for returning a float in specific GPR with matching float +; input with hard float ABI +define float @flt_gpr_matching_spec_reg_in_op_hard(float %f) #1 { +; CHECK-LABEL: flt_gpr_matching_spec_reg_in_op_hard +; CHECK: vmov r3, s0 +; CHECK: mov r3, r3 +; CHECK: vmov s0, r3 + %1 = call float asm "mov $0, $1", "=&{r3},0"(float %f) + ret float %1 +} + +; Check support for returning a double in specific GPR with matching double +; input with hard float ABI +define double @dbl_gpr_matching_spec_reg_in_op_hard(double %d) #1 { +; CHECK-LABEL: dbl_gpr_matching_spec_reg_in_op_hard +; CHECK: vmov r2, r3, d0 +; CHECK: mov r3, r2 +; CHECK: vmov d0, r2, r3 + %1 = call double asm "mov ${0:R}, ${1:Q}", "=&{r2},0"(double %d) + ret double %1 +} + +; Check support for returning several float in GPR +define %struct.twofloat @zerobits_float_convoluted_hard() #1 { +; CHECK-LABEL: zerobits_float_convoluted_hard +; CHECK: mov r0, #0 +; CHECK-NEXT: mov r1, #0 +; CHECK: vmov s0, r0 +; CHECK-NEXT: vmov s1, r1 + %1 = call { float, float } asm "mov $0, #0; mov $1, #0", "=r,=r"() + %asmresult1 = extractvalue { float, float } %1, 0 + %asmresult2 = extractvalue { float, float } %1, 1 + %partialres = insertvalue %struct.twofloat undef, float %asmresult1, 0 + %res = insertvalue %struct.twofloat %partialres, float %asmresult2, 1 + ret %struct.twofloat %res +} + +; Check support for returning several double in GPR +define %struct.twodouble @zerobits_double_convoluted_hard() #1 { +; CHECK-LABEL: zerobits_double_convoluted_hard +; CHECK: mov r0, #0 +; CHECK-NEXT: mov r1, #0 +; CHECK-NEXT: mov r2, #0 +; CHECK-NEXT: mov r3, #0 +; CHECK: vmov d0, r0, r1 +; CHECK-NEXT: vmov d1, r2, r3 + %1 = call { double, double } asm "mov ${0:Q}, #0; mov ${0:R}, #0; mov ${1:Q}, #0; mov ${1:R}, #0", "=r,=r"() + %asmresult1 = extractvalue { double, double } %1, 0 + %asmresult2 = extractvalue { double, double } %1, 1 + %partialres = insertvalue %struct.twodouble undef, double %asmresult1, 0 + %res = insertvalue %struct.twodouble %partialres, double %asmresult2, 1 + ret %struct.twodouble %res +} + +; Check support for returning several floats in GPRs with matching float inputs +; with hard float ABI +define %struct.twofloat @flt_gprs_matching_in_op_hard(float %f1, float %f2) #1 { +; CHECK-LABEL: flt_gprs_matching_in_op_hard +; CHECK: vmov r0, s0 +; CHECK-NEXT: vmov r1, s1 +; CHECK: mov r0, r0 +; CHECK-NEXT: mov r1, r1 +; CHECK: vmov s0, r0 +; CHECK-NEXT: vmov s1, r1 + %1 = call { float, float } asm "mov $0, $2; mov $1, $3", "=&r,=&r,0,1"(float %f1, float %f2) + %asmresult1 = extractvalue { float, float } %1, 0 + %asmresult2 = extractvalue { float, float } %1, 1 + %partialres = insertvalue %struct.twofloat undef, float %asmresult1, 0 + %res = insertvalue %struct.twofloat %partialres, float %asmresult2, 1 + ret %struct.twofloat %res +} + +; Check support for returning several double in GPRs with matching double input +; with hard float ABI +define %struct.twodouble @dbl_gprs_matching_in_op_hard(double %d1, double %d2) #1 { +; CHECK-LABEL: dbl_gprs_matching_in_op_hard +; CHECK: vmov r0, r1, d0 +; CHECK-NEXT: vmov r2, r3, d1 +; CHECK: mov r1, r0 +; CHECK-NEXT: mov r3, r2 +; CHECK: vmov d0, r0, r1 +; CHECK-NEXT: vmov d1, r2, r3 + %1 = call { double, double } asm "mov ${0:R}, ${2:Q}; mov ${1:R}, ${3:Q}", "=&r,=&r,0,1"(double %d1, double %d2) + %asmresult1 = extractvalue { double, double } %1, 0 + %asmresult2 = extractvalue { double, double } %1, 1 + %partialres = insertvalue %struct.twodouble undef, double %asmresult1, 0 + %res = insertvalue %struct.twodouble %partialres, double %asmresult2, 1 + ret %struct.twodouble %res +} + +; Check support for returning several float in specific GPRs with matching +; float input with hard float ABI +define %struct.twofloat @flt_gprs_matching_spec_reg_in_op_hard(float %f1, float %f2) #1 { +; CHECK-LABEL: flt_gprs_matching_spec_reg_in_op_hard +; CHECK: vmov r3, s0 +; CHECK-NEXT: vmov r4, s1 +; CHECK: mov r3, r3 +; CHECK-NEXT: mov r4, r4 +; CHECK: vmov s0, r3 +; CHECK-NEXT: vmov s1, r4 + %1 = call { float, float } asm "mov $0, $2; mov $1, $3", "=&{r3},=&{r4},0,1"(float %f1, float %f2) + %asmresult1 = extractvalue { float, float } %1, 0 + %asmresult2 = extractvalue { float, float } %1, 1 + %partialres = insertvalue %struct.twofloat undef, float %asmresult1, 0 + %res = insertvalue %struct.twofloat %partialres, float %asmresult2, 1 + ret %struct.twofloat %res +} + +; Check support for returning several double in specific GPRs with matching +; double input with hard float ABI +define %struct.twodouble @dbl_gprs_matching_spec_reg_in_op_hard(double %d1, double %d2) #1 { +; CHECK-LABEL: dbl_gprs_matching_spec_reg_in_op_hard +; CHECK: vmov r2, r3, d0 +; CHECK-NEXT: vmov r4, r5, d1 +; CHECK: mov r3, r2 +; CHECK-NEXT: mov r5, r4 +; CHECK: vmov d0, r2, r3 +; CHECK-NEXT: vmov d1, r4, r5 + %1 = call { double, double } asm "mov ${0:R}, ${2:Q}; mov ${1:R}, ${3:Q}", "=&{r2},=&{r4},0,1"(double %d1, double %d2) + %asmresult1 = extractvalue { double, double } %1, 0 + %asmresult2 = extractvalue { double, double } %1, 1 + %partialres = insertvalue %struct.twodouble undef, double %asmresult1, 0 + %res = insertvalue %struct.twodouble %partialres, double %asmresult2, 1 + ret %struct.twodouble %res +} + +attributes #1 = { nounwind "target-features"="+d16,+vfp2,+vfp3,-fp-only-sp" "use-soft-float"="false" } Added: vendor/llvm/dist-release_70/test/CodeGen/PowerPC/pr38087.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist-release_70/test/CodeGen/PowerPC/pr38087.ll Sat Aug 18 08:26:46 2018 (r338000) @@ -0,0 +1,56 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -verify-machineinstrs -mcpu=pwr9 -ppc-vsr-nums-as-vr \ +; RUN: -mtriple=powerpc64le-unknown-unknown -ppc-asm-full-reg-names < %s | \ +; RUN: FileCheck %s +; Function Attrs: nounwind readnone speculatable +declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) #0 + +; Function Attrs: nounwind readnone speculatable +declare { i32, i1 } @llvm.usub.with.overflow.i32(i32, i32) #0 + +define void @draw_llvm_vs_variant0() { +; CHECK-LABEL: draw_llvm_vs_variant0: +; CHECK: # %bb.0: # %entry +; CHECK-NEXT: ldx r3, 0, r3 +; CHECK-NEXT: mtvsrd f0, r3 +; CHECK-NEXT: xxswapd v2, vs0 +; CHECK-NEXT: vmrglh v2, v2, v2 +; CHECK-NEXT: vextsh2w v2, v2 +; CHECK-NEXT: xvcvsxwsp vs0, v2 +; CHECK-NEXT: xxspltw vs0, vs0, 2 +; CHECK-NEXT: xvmaddasp vs0, vs0, vs0 +; CHECK-NEXT: stxvx vs0, 0, r3 +; CHECK-NEXT: blr +entry: + %.size = load i32, i32* undef + %0 = call { i32, i1 } @llvm.usub.with.overflow.i32(i32 %.size, i32 7) + %1 = extractvalue { i32, i1 } %0, 0 + %2 = call { i32, i1 } @llvm.usub.with.overflow.i32(i32 %1, i32 0) + %3 = extractvalue { i32, i1 } %2, 0 + %4 = select i1 false, i32 0, i32 %3 + %5 = xor i1 false, true + %6 = sext i1 %5 to i32 + %7 = load <4 x i16>, <4 x i16>* undef, align 2 + %8 = extractelement <4 x i16> %7, i32 0 + %9 = sext i16 %8 to i32 + %10 = insertelement <4 x i32> undef, i32 %9, i32 0 + %11 = extractelement <4 x i16> %7, i32 1 + %12 = sext i16 %11 to i32 + %13 = insertelement <4 x i32> %10, i32 %12, i32 1 + %14 = extractelement <4 x i16> %7, i32 2 + %15 = sext i16 %14 to i32 + %16 = insertelement <4 x i32> %13, i32 %15, i32 2 + %17 = extractelement <4 x i16> %7, i32 3 + %18 = sext i16 %17 to i32 + %19 = insertelement <4 x i32> %16, i32 %18, i32 3 + %20 = sitofp <4 x i32> %19 to <4 x float> + %21 = insertelement <4 x i32> undef, i32 %6, i32 0 + %22 = shufflevector <4 x i32> %21, <4 x i32> undef, <4 x i32> zeroinitializer + %23 = bitcast <4 x float> %20 to <4 x i32> + %24 = and <4 x i32> %23, %22 + %25 = bitcast <4 x i32> %24 to <4 x float> + %26 = shufflevector <4 x float> %25, <4 x float> undef, <4 x i32> + %27 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> undef, <4 x float> undef, <4 x float> %26) + store <4 x float> %27, <4 x float>* undef + ret void +} Modified: vendor/llvm/dist-release_70/test/CodeGen/X86/flags-copy-lowering.mir ============================================================================== --- vendor/llvm/dist-release_70/test/CodeGen/X86/flags-copy-lowering.mir Sat Aug 18 06:33:51 2018 (r337999) +++ vendor/llvm/dist-release_70/test/CodeGen/X86/flags-copy-lowering.mir Sat Aug 18 08:26:46 2018 (r338000) @@ -545,7 +545,7 @@ body: | MOV8mr $rsp, 1, $noreg, -16, $noreg, killed %4 ; CHECK-NOT: $eflags = ; CHECK: %[[ZERO:[^:]*]]:gr32 = MOV32r0 implicit-def $eflags - ; CHECK-NEXT: %[[ZERO_SUBREG:[^:]*]]:gr8 = EXTRACT_SUBREG %[[ZERO]], %subreg.sub_8bit + ; CHECK-NEXT: %[[ZERO_SUBREG:[^:]*]]:gr8 = COPY %[[ZERO]].sub_8bit ; CHECK-NEXT: %[[REPLACEMENT:[^:]*]]:gr8 = SUB8rr %[[ZERO_SUBREG]], %[[CF_REG]] ; CHECK-NEXT: MOV8mr $rsp, 1, $noreg, -16, $noreg, killed %[[REPLACEMENT]] @@ -554,9 +554,9 @@ body: | MOV16mr $rsp, 1, $noreg, -16, $noreg, killed %5 ; CHECK-NOT: $eflags = ; CHECK: %[[CF_EXT:[^:]*]]:gr32 = MOVZX32rr8 %[[CF_REG]] - ; CHECK-NEXT: %[[CF_TRUNC:[^:]*]]:gr16 = EXTRACT_SUBREG %[[CF_EXT]], %subreg.sub_16bit + ; CHECK-NEXT: %[[CF_TRUNC:[^:]*]]:gr16 = COPY %[[CF_EXT]].sub_16bit ; CHECK-NEXT: %[[ZERO:[^:]*]]:gr32 = MOV32r0 implicit-def $eflags - ; CHECK-NEXT: %[[ZERO_SUBREG:[^:]*]]:gr16 = EXTRACT_SUBREG %[[ZERO]], %subreg.sub_16bit + ; CHECK-NEXT: %[[ZERO_SUBREG:[^:]*]]:gr16 = COPY %[[ZERO]].sub_16bit ; CHECK-NEXT: %[[REPLACEMENT:[^:]*]]:gr16 = SUB16rr %[[ZERO_SUBREG]], %[[CF_TRUNC]] ; CHECK-NEXT: MOV16mr $rsp, 1, $noreg, -16, $noreg, killed %[[REPLACEMENT]] Added: vendor/llvm/dist-release_70/test/CodeGen/X86/pr38533.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist-release_70/test/CodeGen/X86/pr38533.ll Sat Aug 18 08:26:46 2018 (r338000) @@ -0,0 +1,65 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefixes=CHECK,SSE +; RUN: llc < %s -mtriple=x86_64-unknown -mattr=avx512f | FileCheck %s --check-prefixes=CHECK,AVX512 + +; This test makes sure that a vector that needs to be promoted that is bitcasted to fp16 is legalized correctly without causing a width mismatch. +define void @constant_fold_vector_to_half() { +; CHECK-LABEL: constant_fold_vector_to_half: +; CHECK: # %bb.0: +; CHECK-NEXT: movw $16384, (%rax) # imm = 0x4000 +; CHECK-NEXT: retq + store volatile half bitcast (<4 x i4> to half), half* undef + ret void +} + +; Similarly this makes sure that the opposite bitcast of the above is also legalized without crashing. +define void @pr38533_2(half %x) { +; SSE-LABEL: pr38533_2: +; SSE: # %bb.0: +; SSE-NEXT: pushq %rax +; SSE-NEXT: .cfi_def_cfa_offset 16 +; SSE-NEXT: callq __gnu_f2h_ieee +; SSE-NEXT: movw %ax, {{[0-9]+}}(%rsp) +; SSE-NEXT: movzwl {{[0-9]+}}(%rsp), %eax +; SSE-NEXT: movw %ax, (%rax) +; SSE-NEXT: popq %rax +; SSE-NEXT: .cfi_def_cfa_offset 8 +; SSE-NEXT: retq +; +; AVX512-LABEL: pr38533_2: +; AVX512: # %bb.0: +; AVX512-NEXT: vcvtps2ph $4, %xmm0, %xmm0 +; AVX512-NEXT: vmovd %xmm0, %eax +; AVX512-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; AVX512-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax +; AVX512-NEXT: movw %ax, (%rax) +; AVX512-NEXT: retq + %a = bitcast half %x to <4 x i4> + store volatile <4 x i4> %a, <4 x i4>* undef + ret void +} + +; This case is a bitcast from fp16 to a 16-bit wide legal vector type. In this case the result type is legal when the bitcast gets type legalized. +define void @pr38533_3(half %x) { +; SSE-LABEL: pr38533_3: +; SSE: # %bb.0: +; SSE-NEXT: pushq %rax +; SSE-NEXT: .cfi_def_cfa_offset 16 +; SSE-NEXT: callq __gnu_f2h_ieee +; SSE-NEXT: movw %ax, (%rsp) +; SSE-NEXT: movzwl (%rsp), %eax +; SSE-NEXT: movw %ax, (%rax) +; SSE-NEXT: popq %rax +; SSE-NEXT: .cfi_def_cfa_offset 8 +; SSE-NEXT: retq +; +; AVX512-LABEL: pr38533_3: +; AVX512: # %bb.0: +; AVX512-NEXT: vcvtps2ph $4, %xmm0, %xmm0 +; AVX512-NEXT: vmovd %xmm0, %eax +; AVX512-NEXT: movw %ax, (%rax) +; AVX512-NEXT: retq + %a = bitcast half %x to <16 x i1> + store volatile <16 x i1> %a, <16 x i1>* undef + ret void +} Added: vendor/llvm/dist-release_70/test/CodeGen/X86/pr38539.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist-release_70/test/CodeGen/X86/pr38539.ll Sat Aug 18 08:26:46 2018 (r338000) @@ -0,0 +1,314 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=x86_64-unknown -verify-machineinstrs | FileCheck %s --check-prefix=X64 +; RUN: llc < %s -mtriple=i686-unknown -verify-machineinstrs | FileCheck %s --check-prefix=X86 + +; This test is targeted at 64-bit mode. It used to crash due to the creation of an EXTRACT_SUBREG after the peephole pass had ran. +define void @f() { +; X64-LABEL: f: +; X64: # %bb.0: # %BB +; X64-NEXT: pushq %rbp +; X64-NEXT: .cfi_def_cfa_offset 16 +; X64-NEXT: pushq %r14 +; X64-NEXT: .cfi_def_cfa_offset 24 +; X64-NEXT: pushq %rbx +; X64-NEXT: .cfi_def_cfa_offset 32 +; X64-NEXT: subq $16, %rsp +; X64-NEXT: .cfi_def_cfa_offset 48 +; X64-NEXT: .cfi_offset %rbx, -32 +; X64-NEXT: .cfi_offset %r14, -24 +; X64-NEXT: .cfi_offset %rbp, -16 +; X64-NEXT: movzbl {{[0-9]+}}(%rsp), %ebx +; X64-NEXT: movq %rbx, %rcx +; X64-NEXT: shlq $62, %rcx +; X64-NEXT: sarq $62, %rcx +; X64-NEXT: movq (%rsp), %r14 +; X64-NEXT: movb (%rax), %bpl +; X64-NEXT: xorl %edi, %edi +; X64-NEXT: xorl %esi, %esi +; X64-NEXT: movq %r14, %rdx +; X64-NEXT: callq __modti3 +; X64-NEXT: andl $3, %edx +; X64-NEXT: cmpq %rax, %r14 +; X64-NEXT: sbbq %rdx, %rbx +; X64-NEXT: setb %sil +; X64-NEXT: setae %bl +; X64-NEXT: testb %al, %al +; X64-NEXT: setne %dl +; X64-NEXT: setne (%rax) +; X64-NEXT: movzbl %bpl, %eax +; X64-NEXT: xorl %ecx, %ecx +; X64-NEXT: subb %sil, %cl +; X64-NEXT: # kill: def $eax killed $eax def $ax +; X64-NEXT: divb %al +; X64-NEXT: negb %bl +; X64-NEXT: cmpb %al, %al +; X64-NEXT: setle %al +; X64-NEXT: negb %al +; X64-NEXT: cbtw +; X64-NEXT: idivb %bl +; X64-NEXT: movsbl %ah, %eax +; X64-NEXT: movzbl %al, %eax +; X64-NEXT: andl $1, %eax +; X64-NEXT: shlq $4, %rax +; X64-NEXT: negq %rax +; X64-NEXT: negb %dl +; X64-NEXT: leaq -16(%rsp,%rax), %rax +; X64-NEXT: movq %rax, (%rax) +; X64-NEXT: movl %ecx, %eax +; X64-NEXT: cbtw +; X64-NEXT: idivb %dl +; X64-NEXT: movsbl %ah, %eax +; X64-NEXT: andb $1, %al +; X64-NEXT: movb %al, (%rax) +; X64-NEXT: addq $16, %rsp +; X64-NEXT: .cfi_def_cfa_offset 32 +; X64-NEXT: popq %rbx +; X64-NEXT: .cfi_def_cfa_offset 24 +; X64-NEXT: popq %r14 +; X64-NEXT: .cfi_def_cfa_offset 16 +; X64-NEXT: popq %rbp +; X64-NEXT: .cfi_def_cfa_offset 8 +; X64-NEXT: retq +; +; X86-LABEL: f: +; X86: # %bb.0: # %BB +; X86-NEXT: pushl %ebp +; X86-NEXT: .cfi_def_cfa_offset 8 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Aug 18 08:26:55 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 0957B108933E; Sat, 18 Aug 2018 08:26:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B365B87471; Sat, 18 Aug 2018 08:26:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BC9314F7A; Sat, 18 Aug 2018 08:26:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8Qsdu015942; Sat, 18 Aug 2018 08:26:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8QsaT015941; Sat, 18 Aug 2018 08:26:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180826.w7I8QsaT015941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338001 - vendor/llvm/llvm-release_70-r339999 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-release_70-r339999 X-SVN-Commit-Revision: 338001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:26:55 -0000 Author: dim Date: Sat Aug 18 08:26:54 2018 New Revision: 338001 URL: https://svnweb.freebsd.org/changeset/base/338001 Log: Tag llvm release_70 branch r339999. Added: vendor/llvm/llvm-release_70-r339999/ - copied from r338000, vendor/llvm/dist-release_70/ From owner-svn-src-all@freebsd.org Sat Aug 18 08:27: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 EBEAF10893A9; Sat, 18 Aug 2018 08:27:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CADAC875DC; Sat, 18 Aug 2018 08:27:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 399F014F7B; Sat, 18 Aug 2018 08:27:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8R26E016009; Sat, 18 Aug 2018 08:27:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8QxvI015991; Sat, 18 Aug 2018 08:26:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180826.w7I8QxvI015991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338002 - in vendor/clang/dist-release_70: docs include/clang/AST include/clang/Basic include/clang/Driver lib/AST lib/CodeGen lib/Driver/ToolChains lib/Frontend lib/Sema lib/Serializat... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist-release_70: docs include/clang/AST include/clang/Basic include/clang/Driver lib/AST lib/CodeGen lib/Driver/ToolChains lib/Frontend lib/Sema lib/Serialization test/CodeGenCXX test/... X-SVN-Commit-Revision: 338002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:27:06 -0000 Author: dim Date: Sat Aug 18 08:26:59 2018 New Revision: 338002 URL: https://svnweb.freebsd.org/changeset/base/338002 Log: Vendor import of clang release_70 branch r339999: https://llvm.org/svn/llvm-project/cfe/branches/release_70@339999 Added: vendor/clang/dist-release_70/test/Lexer/aligned-allocation.cpp (contents, props changed) Modified: vendor/clang/dist-release_70/docs/ReleaseNotes.rst vendor/clang/dist-release_70/include/clang/AST/ASTContext.h vendor/clang/dist-release_70/include/clang/AST/OpenMPClause.h vendor/clang/dist-release_70/include/clang/Basic/Attr.td vendor/clang/dist-release_70/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist-release_70/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist-release_70/include/clang/Driver/Options.td vendor/clang/dist-release_70/lib/AST/ASTContext.cpp vendor/clang/dist-release_70/lib/AST/DeclPrinter.cpp vendor/clang/dist-release_70/lib/AST/MicrosoftMangle.cpp vendor/clang/dist-release_70/lib/AST/OpenMPClause.cpp vendor/clang/dist-release_70/lib/CodeGen/CGException.cpp vendor/clang/dist-release_70/lib/CodeGen/CGObjCGNU.cpp vendor/clang/dist-release_70/lib/CodeGen/CGObjCRuntime.cpp vendor/clang/dist-release_70/lib/CodeGen/CGObjCRuntime.h vendor/clang/dist-release_70/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist-release_70/lib/CodeGen/CGOpenMPRuntime.h vendor/clang/dist-release_70/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp vendor/clang/dist-release_70/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist-release_70/lib/CodeGen/CodeGenFunction.h vendor/clang/dist-release_70/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist-release_70/lib/Driver/ToolChains/Darwin.cpp vendor/clang/dist-release_70/lib/Frontend/InitPreprocessor.cpp vendor/clang/dist-release_70/lib/Sema/SemaExprCXX.cpp vendor/clang/dist-release_70/lib/Sema/SemaOpenMP.cpp vendor/clang/dist-release_70/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/clang/dist-release_70/lib/Serialization/ASTReaderStmt.cpp vendor/clang/dist-release_70/lib/Serialization/ASTWriterStmt.cpp vendor/clang/dist-release_70/test/CodeGenCXX/attr-target-mv-member-funcs.cpp vendor/clang/dist-release_70/test/CodeGenObjC/gnu-init.m vendor/clang/dist-release_70/test/CodeGenObjC/gnustep2-proto.m vendor/clang/dist-release_70/test/CodeGenObjCXX/arc-marker-funclet.mm vendor/clang/dist-release_70/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm vendor/clang/dist-release_70/test/CodeGenObjCXX/msabi-objc-extensions.mm vendor/clang/dist-release_70/test/CodeGenObjCXX/msabi-objc-types.mm vendor/clang/dist-release_70/test/Driver/unavailable_aligned_allocation.cpp vendor/clang/dist-release_70/test/OpenMP/declare_target_ast_print.cpp vendor/clang/dist-release_70/test/OpenMP/ordered_doacross_codegen.c vendor/clang/dist-release_70/test/OpenMP/ordered_doacross_codegen.cpp vendor/clang/dist-release_70/test/OpenMP/parallel_for_simd_ast_print.cpp vendor/clang/dist-release_70/test/Tooling/clang-diff-json.cpp Modified: vendor/clang/dist-release_70/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist-release_70/docs/ReleaseNotes.rst Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/docs/ReleaseNotes.rst Sat Aug 18 08:26:59 2018 (r338002) @@ -186,6 +186,12 @@ Windows Support Visual Studio's default stdafx.h setup now uses precompiled headers with clang-cl. +- The alternative entry point names + (``wmain``/``WinMain``/``wWinMain``/``DllMain``) now are properly mangled + as plain C names in C++ contexts when targeting MinGW, without having to + explicit specify ``extern "C"``. (This was already the case for MSVC + targets.) + - ... Modified: vendor/clang/dist-release_70/include/clang/AST/ASTContext.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/ASTContext.h Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/include/clang/AST/ASTContext.h Sat Aug 18 08:26:59 2018 (r338002) @@ -2718,7 +2718,7 @@ class ASTContext : public RefCountedBase { /// predicate. void forEachMultiversionedFunctionVersion( const FunctionDecl *FD, - llvm::function_ref Pred) const; + llvm::function_ref Pred) const; const CXXConstructorDecl * getCopyConstructorForExceptionObject(CXXRecordDecl *RD); Modified: vendor/clang/dist-release_70/include/clang/AST/OpenMPClause.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/OpenMPClause.h Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/include/clang/AST/OpenMPClause.h Sat Aug 18 08:26:59 2018 (r338002) @@ -922,8 +922,11 @@ class OMPScheduleClause : public OMPClause, public OMP /// \endcode /// In this example directive '#pragma omp for' has 'ordered' clause with /// parameter 2. -class OMPOrderedClause : public OMPClause { +class OMPOrderedClause final + : public OMPClause, + private llvm::TrailingObjects { friend class OMPClauseReader; + friend TrailingObjects; /// Location of '('. SourceLocation LParenLoc; @@ -931,6 +934,26 @@ class OMPOrderedClause : public OMPClause { /// Number of for-loops. Stmt *NumForLoops = nullptr; + /// Real number of loops. + unsigned NumberOfLoops = 0; + + /// Build 'ordered' clause. + /// + /// \param Num Expression, possibly associated with this clause. + /// \param NumLoops Number of loops, associated with this clause. + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param EndLoc Ending location of the clause. + OMPOrderedClause(Expr *Num, unsigned NumLoops, SourceLocation StartLoc, + SourceLocation LParenLoc, SourceLocation EndLoc) + : OMPClause(OMPC_ordered, StartLoc, EndLoc), LParenLoc(LParenLoc), + NumForLoops(Num), NumberOfLoops(NumLoops) {} + + /// Build an empty clause. + explicit OMPOrderedClause(unsigned NumLoops) + : OMPClause(OMPC_ordered, SourceLocation(), SourceLocation()), + NumberOfLoops(NumLoops) {} + /// Set the number of associated for-loops. void setNumForLoops(Expr *Num) { NumForLoops = Num; } @@ -938,17 +961,17 @@ class OMPOrderedClause : public OMPClause { /// Build 'ordered' clause. /// /// \param Num Expression, possibly associated with this clause. + /// \param NumLoops Number of loops, associated with this clause. /// \param StartLoc Starting location of the clause. /// \param LParenLoc Location of '('. /// \param EndLoc Ending location of the clause. - OMPOrderedClause(Expr *Num, SourceLocation StartLoc, - SourceLocation LParenLoc, SourceLocation EndLoc) - : OMPClause(OMPC_ordered, StartLoc, EndLoc), LParenLoc(LParenLoc), - NumForLoops(Num) {} + static OMPOrderedClause *Create(const ASTContext &C, Expr *Num, + unsigned NumLoops, SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation EndLoc); /// Build an empty clause. - explicit OMPOrderedClause() - : OMPClause(OMPC_ordered, SourceLocation(), SourceLocation()) {} + static OMPOrderedClause* CreateEmpty(const ASTContext &C, unsigned NumLoops); /// Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } @@ -959,6 +982,17 @@ class OMPOrderedClause : public OMPClause { /// Return the number of associated for-loops. Expr *getNumForLoops() const { return cast_or_null(NumForLoops); } + /// Set number of iterations for the specified loop. + void setLoopNumIterations(unsigned NumLoop, Expr *NumIterations); + /// Get number of iterations for all the loops. + ArrayRef getLoopNumIterations() const; + + /// Set loop counter for the specified loop. + void setLoopCounter(unsigned NumLoop, Expr *Counter); + /// Get loops counter for the specified loop. + Expr *getLoopCunter(unsigned NumLoop); + const Expr *getLoopCunter(unsigned NumLoop) const; + child_range children() { return child_range(&NumForLoops, &NumForLoops + 1); } static bool classof(const OMPClause *T) { @@ -3087,24 +3121,32 @@ class OMPDependClause final /// Colon location. SourceLocation ColonLoc; + /// Number of loops, associated with the depend clause. + unsigned NumLoops = 0; + /// Build clause with number of variables \a N. /// /// \param StartLoc Starting location of the clause. /// \param LParenLoc Location of '('. /// \param EndLoc Ending location of the clause. /// \param N Number of the variables in the clause. + /// \param NumLoops Number of loops that is associated with this depend + /// clause. OMPDependClause(SourceLocation StartLoc, SourceLocation LParenLoc, - SourceLocation EndLoc, unsigned N) + SourceLocation EndLoc, unsigned N, unsigned NumLoops) : OMPVarListClause(OMPC_depend, StartLoc, LParenLoc, - EndLoc, N) {} + EndLoc, N), NumLoops(NumLoops) {} /// Build an empty clause. /// /// \param N Number of variables. - explicit OMPDependClause(unsigned N) + /// \param NumLoops Number of loops that is associated with this depend + /// clause. + explicit OMPDependClause(unsigned N, unsigned NumLoops) : OMPVarListClause(OMPC_depend, SourceLocation(), SourceLocation(), SourceLocation(), - N) {} + N), + NumLoops(NumLoops) {} /// Set dependency kind. void setDependencyKind(OpenMPDependClauseKind K) { DepKind = K; } @@ -3126,16 +3168,23 @@ class OMPDependClause final /// \param DepLoc Location of the dependency type. /// \param ColonLoc Colon location. /// \param VL List of references to the variables. - static OMPDependClause * - Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, - SourceLocation EndLoc, OpenMPDependClauseKind DepKind, - SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef VL); + /// \param NumLoops Number of loops that is associated with this depend + /// clause. + static OMPDependClause *Create(const ASTContext &C, SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation EndLoc, + OpenMPDependClauseKind DepKind, + SourceLocation DepLoc, SourceLocation ColonLoc, + ArrayRef VL, unsigned NumLoops); /// Creates an empty clause with \a N variables. /// /// \param C AST context. /// \param N The number of variables. - static OMPDependClause *CreateEmpty(const ASTContext &C, unsigned N); + /// \param NumLoops Number of loops that is associated with this depend + /// clause. + static OMPDependClause *CreateEmpty(const ASTContext &C, unsigned N, + unsigned NumLoops); /// Get dependency type. OpenMPDependClauseKind getDependencyKind() const { return DepKind; } @@ -3146,15 +3195,16 @@ class OMPDependClause final /// Get colon location. SourceLocation getColonLoc() const { return ColonLoc; } - /// Set the loop counter value for the depend clauses with 'sink|source' kind - /// of dependency. Required for codegen. - void setCounterValue(Expr *V); + /// Get number of loops associated with the clause. + unsigned getNumLoops() const { return NumLoops; } - /// Get the loop counter value. - Expr *getCounterValue(); + /// Set the loop data for the depend clauses with 'sink|source' kind of + /// dependency. + void setLoopData(unsigned NumLoop, Expr *Cnt); - /// Get the loop counter value. - const Expr *getCounterValue() const; + /// Get the loop data. + Expr *getLoopData(unsigned NumLoop); + const Expr *getLoopData(unsigned NumLoop) const; child_range children() { return child_range(reinterpret_cast(varlist_begin()), Modified: vendor/clang/dist-release_70/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist-release_70/include/clang/Basic/Attr.td Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/include/clang/Basic/Attr.td Sat Aug 18 08:26:59 2018 (r338002) @@ -2938,9 +2938,10 @@ def OMPDeclareSimdDecl : Attr { }]; } -def OMPDeclareTargetDecl : Attr { +def OMPDeclareTargetDecl : InheritableAttr { let Spellings = [Pragma<"omp", "declare target">]; let SemaHandler = 0; + let Subjects = SubjectList<[Function, SharedVar]>; let Documentation = [OMPDeclareTargetDocs]; let Args = [ EnumArgument<"MapType", "MapTypeTy", @@ -2952,6 +2953,15 @@ def OMPDeclareTargetDecl : Attr { // Use fake syntax because it is for testing and debugging purpose only. if (getMapType() != MT_To) OS << ' ' << ConvertMapTypeTyToStr(getMapType()); + } + static llvm::Optional + isDeclareTargetDeclaration(const ValueDecl *VD) { + if (!VD->hasAttrs()) + return llvm::None; + if (const auto *Attr = VD->getAttr()) + return Attr->getMapType(); + + return llvm::None; } }]; } Modified: vendor/clang/dist-release_70/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist-release_70/include/clang/Basic/DiagnosticGroups.td Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/include/clang/Basic/DiagnosticGroups.td Sat Aug 18 08:26:59 2018 (r338002) @@ -364,7 +364,6 @@ def NonVirtualDtor : DiagGroup<"non-virtual-dtor">; def NullPointerArithmetic : DiagGroup<"null-pointer-arithmetic">; def : DiagGroup<"effc++", [NonVirtualDtor]>; def OveralignedType : DiagGroup<"over-aligned">; -def AlignedAllocationUnavailable : DiagGroup<"aligned-allocation-unavailable">; def OldStyleCast : DiagGroup<"old-style-cast">; def : DiagGroup<"old-style-definition">; def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">; Modified: vendor/clang/dist-release_70/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist-release_70/include/clang/Basic/DiagnosticSemaKinds.td Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/include/clang/Basic/DiagnosticSemaKinds.td Sat Aug 18 08:26:59 2018 (r338002) @@ -6465,12 +6465,12 @@ def warn_overaligned_type : Warning< "type %0 requires %1 bytes of alignment and the default allocator only " "guarantees %2 bytes">, InGroup, DefaultIgnore; -def warn_aligned_allocation_unavailable :Warning< +def err_aligned_allocation_unavailable : Error< "aligned %select{allocation|deallocation}0 function of type '%1' is only " - "available on %2 %3 or newer">, InGroup, DefaultError; + "available on %2 %3 or newer">; def note_silence_unligned_allocation_unavailable : Note< "if you supply your own aligned allocation functions, use " - "-Wno-aligned-allocation-unavailable to silence this diagnostic">; + "-faligned-allocation to silence this diagnostic">; def err_conditional_void_nonvoid : Error< "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand " Modified: vendor/clang/dist-release_70/include/clang/Driver/Options.td ============================================================================== --- vendor/clang/dist-release_70/include/clang/Driver/Options.td Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/include/clang/Driver/Options.td Sat Aug 18 08:26:59 2018 (r338002) @@ -1488,7 +1488,7 @@ def fobjc_weak : Flag<["-"], "fobjc-weak">, Group; // Objective-C ABI options. -def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group, Flags<[CC1Option]>, +def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group, Flags<[CC1Option, CoreOption]>, HelpText<"Specify the target Objective-C runtime kind and version">; def fobjc_abi_version_EQ : Joined<["-"], "fobjc-abi-version=">, Group; def fobjc_nonfragile_abi_version_EQ : Joined<["-"], "fobjc-nonfragile-abi-version=">, Group; Modified: vendor/clang/dist-release_70/lib/AST/ASTContext.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/AST/ASTContext.cpp Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/lib/AST/ASTContext.cpp Sat Aug 18 08:26:59 2018 (r338002) @@ -9798,20 +9798,16 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) { return true; // If the decl is marked as `declare target`, it should be emitted. - for (const auto *Decl : D->redecls()) { - if (!Decl->hasAttrs()) - continue; - if (const auto *Attr = Decl->getAttr()) - if (Attr->getMapType() != OMPDeclareTargetDeclAttr::MT_Link) - return true; - } + if (const llvm::Optional Res = + OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(VD)) + return *Res != OMPDeclareTargetDeclAttr::MT_Link; return false; } void ASTContext::forEachMultiversionedFunctionVersion( const FunctionDecl *FD, - llvm::function_ref Pred) const { + llvm::function_ref Pred) const { assert(FD->isMultiVersion() && "Only valid for multiversioned functions"); llvm::SmallDenseSet SeenDecls; FD = FD->getCanonicalDecl(); Modified: vendor/clang/dist-release_70/lib/AST/DeclPrinter.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/AST/DeclPrinter.cpp Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/lib/AST/DeclPrinter.cpp Sat Aug 18 08:26:59 2018 (r338002) @@ -1091,6 +1091,10 @@ void DeclPrinter::VisitFunctionTemplateDecl(FunctionTe printTemplateParameters(FD->getTemplateParameterList(I)); } VisitRedeclarableTemplateDecl(D); + // Declare target attribute is special one, natural spelling for the pragma + // assumes "ending" construct so print it here. + if (D->getTemplatedDecl()->hasAttr()) + Out << "#pragma omp end declare target\n"; // Never print "instantiations" for deduction guides (they don't really // have them). Modified: vendor/clang/dist-release_70/lib/AST/MicrosoftMangle.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/AST/MicrosoftMangle.cpp Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/lib/AST/MicrosoftMangle.cpp Sat Aug 18 08:26:59 2018 (r338002) @@ -445,7 +445,7 @@ void MicrosoftCXXNameMangler::mangle(const NamedDecl * mangleFunctionEncoding(FD, Context.shouldMangleDeclName(FD)); else if (const VarDecl *VD = dyn_cast(D)) mangleVariableEncoding(VD); - else + else if (!isa(D)) llvm_unreachable("Tried to mangle unexpected NamedDecl!"); } @@ -1884,13 +1884,13 @@ void MicrosoftCXXNameMangler::mangleType(const Builtin llvm_unreachable("placeholder types shouldn't get to name mangling"); case BuiltinType::ObjCId: - mangleArtificalTagType(TTK_Struct, "objc_object"); + mangleArtificalTagType(TTK_Struct, ".objc_object"); break; case BuiltinType::ObjCClass: - mangleArtificalTagType(TTK_Struct, "objc_class"); + mangleArtificalTagType(TTK_Struct, ".objc_class"); break; case BuiltinType::ObjCSel: - mangleArtificalTagType(TTK_Struct, "objc_selector"); + mangleArtificalTagType(TTK_Struct, ".objc_selector"); break; #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ @@ -2570,9 +2570,10 @@ void MicrosoftCXXNameMangler::mangleType(const Depende void MicrosoftCXXNameMangler::mangleType(const ObjCInterfaceType *T, Qualifiers, SourceRange) { - // ObjC interfaces have structs underlying them. + // ObjC interfaces are mangled as if they were structs with a name that is + // not a valid C/C++ identifier mangleTagTypeKind(TTK_Struct); - mangleName(T->getDecl()); + mangle(T->getDecl(), ".objc_cls_"); } void MicrosoftCXXNameMangler::mangleType(const ObjCObjectType *T, Qualifiers, @@ -2590,11 +2591,11 @@ void MicrosoftCXXNameMangler::mangleType(const ObjCObj Out << "?$"; if (T->isObjCId()) - mangleSourceName("objc_object"); + mangleSourceName(".objc_object"); else if (T->isObjCClass()) - mangleSourceName("objc_class"); + mangleSourceName(".objc_class"); else - mangleSourceName(T->getInterface()->getName()); + mangleSourceName((".objc_cls_" + T->getInterface()->getName()).str()); for (const auto &Q : T->quals()) mangleObjCProtocol(Q); Modified: vendor/clang/dist-release_70/lib/AST/OpenMPClause.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/AST/OpenMPClause.cpp Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/lib/AST/OpenMPClause.cpp Sat Aug 18 08:26:59 2018 (r338002) @@ -181,6 +181,57 @@ const OMPClauseWithPostUpdate *OMPClauseWithPostUpdate return nullptr; } +OMPOrderedClause *OMPOrderedClause::Create(const ASTContext &C, Expr *Num, + unsigned NumLoops, + SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation EndLoc) { + void *Mem = C.Allocate(totalSizeToAlloc(2 * NumLoops)); + auto *Clause = + new (Mem) OMPOrderedClause(Num, NumLoops, StartLoc, LParenLoc, EndLoc); + for (unsigned I = 0; I < NumLoops; ++I) { + Clause->setLoopNumIterations(I, nullptr); + Clause->setLoopCounter(I, nullptr); + } + return Clause; +} + +OMPOrderedClause *OMPOrderedClause::CreateEmpty(const ASTContext &C, + unsigned NumLoops) { + void *Mem = C.Allocate(totalSizeToAlloc(2 * NumLoops)); + auto *Clause = new (Mem) OMPOrderedClause(NumLoops); + for (unsigned I = 0; I < NumLoops; ++I) { + Clause->setLoopNumIterations(I, nullptr); + Clause->setLoopCounter(I, nullptr); + } + return Clause; +} + +void OMPOrderedClause::setLoopNumIterations(unsigned NumLoop, + Expr *NumIterations) { + assert(NumLoop < NumberOfLoops && "out of loops number."); + getTrailingObjects()[NumLoop] = NumIterations; +} + +ArrayRef OMPOrderedClause::getLoopNumIterations() const { + return llvm::makeArrayRef(getTrailingObjects(), NumberOfLoops); +} + +void OMPOrderedClause::setLoopCounter(unsigned NumLoop, Expr *Counter) { + assert(NumLoop < NumberOfLoops && "out of loops number."); + getTrailingObjects()[NumberOfLoops + NumLoop] = Counter; +} + +Expr *OMPOrderedClause::getLoopCunter(unsigned NumLoop) { + assert(NumLoop < NumberOfLoops && "out of loops number."); + return getTrailingObjects()[NumberOfLoops + NumLoop]; +} + +const Expr *OMPOrderedClause::getLoopCunter(unsigned NumLoop) const { + assert(NumLoop < NumberOfLoops && "out of loops number."); + return getTrailingObjects()[NumberOfLoops + NumLoop]; +} + void OMPPrivateClause::setPrivateCopies(ArrayRef VL) { assert(VL.size() == varlist_size() && "Number of private copies is not the same as the preallocated buffer"); @@ -653,44 +704,58 @@ OMPFlushClause *OMPFlushClause::CreateEmpty(const ASTC return new (Mem) OMPFlushClause(N); } -OMPDependClause *OMPDependClause::Create( - const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, - SourceLocation EndLoc, OpenMPDependClauseKind DepKind, - SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef VL) { - void *Mem = C.Allocate(totalSizeToAlloc(VL.size() + 1)); - OMPDependClause *Clause = - new (Mem) OMPDependClause(StartLoc, LParenLoc, EndLoc, VL.size()); +OMPDependClause * +OMPDependClause::Create(const ASTContext &C, SourceLocation StartLoc, + SourceLocation LParenLoc, SourceLocation EndLoc, + OpenMPDependClauseKind DepKind, SourceLocation DepLoc, + SourceLocation ColonLoc, ArrayRef VL, + unsigned NumLoops) { + void *Mem = C.Allocate(totalSizeToAlloc(VL.size() + NumLoops)); + OMPDependClause *Clause = new (Mem) + OMPDependClause(StartLoc, LParenLoc, EndLoc, VL.size(), NumLoops); Clause->setVarRefs(VL); Clause->setDependencyKind(DepKind); Clause->setDependencyLoc(DepLoc); Clause->setColonLoc(ColonLoc); - Clause->setCounterValue(nullptr); + for (unsigned I = 0 ; I < NumLoops; ++I) + Clause->setLoopData(I, nullptr); return Clause; } -OMPDependClause *OMPDependClause::CreateEmpty(const ASTContext &C, unsigned N) { - void *Mem = C.Allocate(totalSizeToAlloc(N + 1)); - return new (Mem) OMPDependClause(N); +OMPDependClause *OMPDependClause::CreateEmpty(const ASTContext &C, unsigned N, + unsigned NumLoops) { + void *Mem = C.Allocate(totalSizeToAlloc(N + NumLoops)); + return new (Mem) OMPDependClause(N, NumLoops); } -void OMPDependClause::setCounterValue(Expr *V) { - assert(getDependencyKind() == OMPC_DEPEND_sink || - getDependencyKind() == OMPC_DEPEND_source || V == nullptr); - *getVarRefs().end() = V; +void OMPDependClause::setLoopData(unsigned NumLoop, Expr *Cnt) { + assert((getDependencyKind() == OMPC_DEPEND_sink || + getDependencyKind() == OMPC_DEPEND_source) && + NumLoop < NumLoops && + "Expected sink or source depend + loop index must be less number of " + "loops."); + auto It = std::next(getVarRefs().end(), NumLoop); + *It = Cnt; } -const Expr *OMPDependClause::getCounterValue() const { - auto *V = *getVarRefs().end(); - assert(getDependencyKind() == OMPC_DEPEND_sink || - getDependencyKind() == OMPC_DEPEND_source || V == nullptr); - return V; +Expr *OMPDependClause::getLoopData(unsigned NumLoop) { + assert((getDependencyKind() == OMPC_DEPEND_sink || + getDependencyKind() == OMPC_DEPEND_source) && + NumLoop < NumLoops && + "Expected sink or source depend + loop index must be less number of " + "loops."); + auto It = std::next(getVarRefs().end(), NumLoop); + return *It; } -Expr *OMPDependClause::getCounterValue() { - auto *V = *getVarRefs().end(); - assert(getDependencyKind() == OMPC_DEPEND_sink || - getDependencyKind() == OMPC_DEPEND_source || V == nullptr); - return V; +const Expr *OMPDependClause::getLoopData(unsigned NumLoop) const { + assert((getDependencyKind() == OMPC_DEPEND_sink || + getDependencyKind() == OMPC_DEPEND_source) && + NumLoop < NumLoops && + "Expected sink or source depend + loop index must be less number of " + "loops."); + auto It = std::next(getVarRefs().end(), NumLoop); + return *It; } unsigned OMPClauseMappableExprCommon::getComponentsTotalNumber( Modified: vendor/clang/dist-release_70/lib/CodeGen/CGException.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/CodeGen/CGException.cpp Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/lib/CodeGen/CGException.cpp Sat Aug 18 08:26:59 2018 (r338002) @@ -1829,7 +1829,7 @@ void CodeGenFunction::startOutlinedSEHHelper(CodeGenFu SmallString<128> Name; { llvm::raw_svector_ostream OS(Name); - const FunctionDecl *ParentSEHFn = ParentCGF.CurSEHParent; + const NamedDecl *ParentSEHFn = ParentCGF.CurSEHParent; assert(ParentSEHFn && "No CurSEHParent!"); MangleContext &Mangler = CGM.getCXXABI().getMangleContext(); if (IsFilter) @@ -1970,6 +1970,11 @@ llvm::Value *CodeGenFunction::EmitSEHAbnormalTerminati // helper. auto AI = CurFn->arg_begin(); return Builder.CreateZExt(&*AI, Int32Ty); +} + +void CodeGenFunction::pushSEHCleanup(CleanupKind Kind, + llvm::Function *FinallyFunc) { + EHStack.pushCleanup(Kind, FinallyFunc); } void CodeGenFunction::EnterSEHTryStmt(const SEHTryStmt &S) { Modified: vendor/clang/dist-release_70/lib/CodeGen/CGObjCGNU.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/CodeGen/CGObjCGNU.cpp Sat Aug 18 08:26:54 2018 (r338001) +++ vendor/clang/dist-release_70/lib/CodeGen/CGObjCGNU.cpp Sat Aug 18 08:26:59 2018 (r338002) @@ -18,6 +18,7 @@ #include "CGCleanup.h" #include "CodeGenFunction.h" #include "CodeGenModule.h" +#include "CGCXXABI.h" #include "clang/CodeGen/ConstantInitBuilder.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" @@ -178,6 +179,9 @@ class CGObjCGNU : public CGObjCRuntime { (protected) /// runtime provides some LLVM passes that can use this to do things like /// automatic IMP caching and speculative inlining. unsigned msgSendMDKind; + /// Does the current target use SEH-based exceptions? False implies + /// Itanium-style DWARF unwinding. + bool usesSEHExceptions; /// Helper to check if we are targeting a specific runtime version or later. bool isRuntime(ObjCRuntime::Kind kind, unsigned major, unsigned minor=0) { @@ -217,6 +221,7 @@ class CGObjCGNU : public CGObjCRuntime { (protected) llvm::Constant *value = llvm::ConstantDataArray::getString(VMContext,Str); auto *GV = new llvm::GlobalVariable(TheModule, value->getType(), true, llvm::GlobalValue::LinkOnceODRLinkage, value, name); + GV->setComdat(TheModule.getOrInsertComdat(name)); if (Private) GV->setVisibility(llvm::GlobalValue::HiddenVisibility); ConstStr = GV; @@ -510,8 +515,8 @@ class CGObjCGNU : public CGObjCRuntime { (protected) /// Returns a selector with the specified type encoding. An empty string is /// used to return an untyped selector (with the types field set to NULL). - virtual llvm::Value *GetSelector(CodeGenFunction &CGF, Selector Sel, - const std::string &TypeEncoding); + virtual llvm::Value *GetTypedSelector(CodeGenFunction &CGF, Selector Sel, + const std::string &TypeEncoding); /// Returns the name of ivar offset variables. In the GNUstep v1 ABI, this /// contains the class and ivar names, in the v2 ABI this contains the type @@ -810,8 +815,12 @@ class CGObjCGNUstep : public CGObjCGNU { // Slot_t objc_slot_lookup_super(struct objc_super*, SEL); SlotLookupSuperFn.init(&CGM, "objc_slot_lookup_super", SlotTy, PtrToObjCSuperTy, SelectorTy); - // If we're in ObjC++ mode, then we want to make - if (CGM.getLangOpts().CPlusPlus) { + // If we're in ObjC++ mode, then we want to make + if (usesSEHExceptions) { + llvm::Type *VoidTy = llvm::Type::getVoidTy(VMContext); + // void objc_exception_rethrow(void) + ExceptionReThrowFn.init(&CGM, "objc_exception_rethrow", VoidTy); + } else if (CGM.getLangOpts().CPlusPlus) { llvm::Type *VoidTy = llvm::Type::getVoidTy(VMContext); // void *__cxa_begin_catch(void *e) EnterCatchFn.init(&CGM, "__cxa_begin_catch", PtrTy, PtrTy); @@ -888,22 +897,25 @@ class CGObjCGNUstep : public CGObjCGNU { /// This is the ABI that provides a clean break with the legacy GCC ABI and /// cleans up a number of things that were added to work around 1980s linkers. class CGObjCGNUstep2 : public CGObjCGNUstep { - /// The section for selectors. - static constexpr const char *const SelSection = "__objc_selectors"; - /// The section for classes. - static constexpr const char *const ClsSection = "__objc_classes"; - /// The section for references to classes. - static constexpr const char *const ClsRefSection = "__objc_class_refs"; - /// The section for categories. - static constexpr const char *const CatSection = "__objc_cats"; - /// The section for protocols. - static constexpr const char *const ProtocolSection = "__objc_protocols"; - /// The section for protocol references. - static constexpr const char *const ProtocolRefSection = "__objc_protocol_refs"; - /// The section for class aliases - static constexpr const char *const ClassAliasSection = "__objc_class_aliases"; - /// The section for constexpr constant strings - static constexpr const char *const ConstantStringSection = "__objc_constant_string"; + enum SectionKind + { + SelectorSection = 0, + ClassSection, + ClassReferenceSection, + CategorySection, + ProtocolSection, + ProtocolReferenceSection, + ClassAliasSection, + ConstantStringSection + }; + static const char *const SectionsBaseNames[8]; + template + std::string sectionName() { + std::string name(SectionsBaseNames[K]); + if (CGM.getTriple().isOSBinFormatCOFF()) + name += "$m"; + return name; + } /// The GCC ABI superclass message lookup function. Takes a pointer to a /// structure describing the receiver and the class, and a selector as /// arguments. Returns the IMP for the corresponding method. @@ -1069,7 +1081,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { isNamed ? StringRef(StringName) : ".objc_string", Align, false, isNamed ? llvm::GlobalValue::LinkOnceODRLinkage : llvm::GlobalValue::PrivateLinkage); - ObjCStrGV->setSection(ConstantStringSection); + ObjCStrGV->setSection(sectionName()); if (isNamed) { ObjCStrGV->setComdat(TheModule.getOrInsertComdat(StringName)); ObjCStrGV->setVisibility(llvm::GlobalValue::HiddenVisibility); @@ -1247,9 +1259,10 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { assert(!TheModule.getGlobalVariable(RefName)); // Emit a reference symbol. auto GV = new llvm::GlobalVariable(TheModule, ProtocolPtrTy, - false, llvm::GlobalValue::ExternalLinkage, + false, llvm::GlobalValue::LinkOnceODRLinkage, llvm::ConstantExpr::getBitCast(Protocol, ProtocolPtrTy), RefName); - GV->setSection(ProtocolRefSection); + GV->setComdat(TheModule.getOrInsertComdat(RefName)); + GV->setSection(sectionName()); GV->setAlignment(CGM.getPointerAlign().getQuantity()); Ref = GV; } @@ -1282,9 +1295,22 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { EmittedProtocol = true; + auto SymName = SymbolForProtocol(ProtocolName); + auto *OldGV = TheModule.getGlobalVariable(SymName); + // Use the protocol definition, if there is one. if (const ObjCProtocolDecl *Def = PD->getDefinition()) PD = Def; + else { + // If there is no definition, then create an external linkage symbol and + // hope that someone else fills it in for us (and fail to link if they + // don't). + assert(!OldGV); + Protocol = new llvm::GlobalVariable(TheModule, ProtocolTy, + /*isConstant*/false, + llvm::GlobalValue::ExternalLinkage, nullptr, SymName); + return Protocol; + } SmallVector Protocols; for (const auto *PI : PD->protocols()) @@ -1301,8 +1327,6 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { EmitProtocolMethodList(PD->class_methods(), ClassMethodList, OptionalClassMethodList); - auto SymName = SymbolForProtocol(ProtocolName); - auto *OldGV = TheModule.getGlobalVariable(SymName); // The isa pointer must be set to a magic number so the runtime knows it's // the correct layout. ConstantInitBuilder builder(CGM); @@ -1326,7 +1350,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { auto *GV = ProtocolBuilder.finishAndCreateGlobal(SymName, CGM.getPointerAlign(), false, llvm::GlobalValue::ExternalLinkage); - GV->setSection(ProtocolSection); + GV->setSection(sectionName()); GV->setComdat(TheModule.getOrInsertComdat(SymName)); if (OldGV) { OldGV->replaceAllUsesWith(llvm::ConstantExpr::getBitCast(GV, @@ -1342,8 +1366,8 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { return Val; return llvm::ConstantExpr::getBitCast(Val, Ty); } - llvm::Value *GetSelector(CodeGenFunction &CGF, Selector Sel, - const std::string &TypeEncoding) override { + llvm::Value *GetTypedSelector(CodeGenFunction &CGF, Selector Sel, + const std::string &TypeEncoding) override { return GetConstantSelector(Sel, TypeEncoding); } llvm::Constant *GetTypeString(llvm::StringRef TypeEncoding) { @@ -1359,6 +1383,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { TypeEncoding); auto *GV = new llvm::GlobalVariable(TheModule, Init->getType(), true, llvm::GlobalValue::LinkOnceODRLinkage, Init, TypesVarName); + GV->setComdat(TheModule.getOrInsertComdat(TypesVarName)); GV->setVisibility(llvm::GlobalValue::HiddenVisibility); TypesGlobal = GV; } @@ -1387,12 +1412,41 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { CGM.getPointerAlign(), false, llvm::GlobalValue::LinkOnceODRLinkage); GV->setComdat(TheModule.getOrInsertComdat(SelVarName)); GV->setVisibility(llvm::GlobalValue::HiddenVisibility); - GV->setSection(SelSection); + GV->setSection(sectionName()); auto *SelVal = EnforceType(GV, SelectorTy); return SelVal; } + llvm::StructType *emptyStruct = nullptr; + + /// Return pointers to the start and end of a section. On ELF platforms, we + /// use the __start_ and __stop_ symbols that GNU-compatible linkers will set + /// to the start and end of section names, as long as those section names are + /// valid identifiers and the symbols are referenced but not defined. On + /// Windows, we use the fact that MSVC-compatible linkers will lexically sort + /// by subsections and place everything that we want to reference in a middle + /// subsection and then insert zero-sized symbols in subsections a and z. std::pair GetSectionBounds(StringRef Section) { + if (CGM.getTriple().isOSBinFormatCOFF()) { + if (emptyStruct == nullptr) { + emptyStruct = llvm::StructType::create(VMContext, ".objc_section_sentinel"); + emptyStruct->setBody({}, /*isPacked*/true); + } + auto ZeroInit = llvm::Constant::getNullValue(emptyStruct); + auto Sym = [&](StringRef Prefix, StringRef SecSuffix) { + auto *Sym = new llvm::GlobalVariable(TheModule, emptyStruct, + /*isConstant*/false, + llvm::GlobalValue::LinkOnceODRLinkage, ZeroInit, Prefix + + Section); + Sym->setVisibility(llvm::GlobalValue::HiddenVisibility); + Sym->setSection((Section + SecSuffix).str()); + Sym->setComdat(TheModule.getOrInsertComdat((Prefix + + Section).str())); + Sym->setAlignment(1); + return Sym; + }; + return { Sym("__start_", "$a"), Sym("__stop", "$z") }; + } auto *Start = new llvm::GlobalVariable(TheModule, PtrTy, /*isConstant*/false, llvm::GlobalValue::ExternalLinkage, nullptr, StringRef("__start_") + @@ -1405,6 +1459,9 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { Stop->setVisibility(llvm::GlobalValue::HiddenVisibility); return { Start, Stop }; } + CatchTypeInfo getCatchAllTypeInfo() override { + return CGM.getCXXABI().getCatchAllTypeInfo(); + } llvm::Function *ModuleInitFunction() override { llvm::Function *LoadFunction = llvm::Function::Create( llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext), false), @@ -1420,19 +1477,11 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { ConstantInitBuilder builder(CGM); auto InitStructBuilder = builder.beginStruct(); InitStructBuilder.addInt(Int64Ty, 0); - auto addSection = [&](const char *section) { - auto bounds = GetSectionBounds(section); + for (auto *s : SectionsBaseNames) { + auto bounds = GetSectionBounds(s); InitStructBuilder.add(bounds.first); InitStructBuilder.add(bounds.second); }; - addSection(SelSection); - addSection(ClsSection); - addSection(ClsRefSection); - addSection(CatSection); - addSection(ProtocolSection); - addSection(ProtocolRefSection); - addSection(ClassAliasSection); - addSection(ConstantStringSection); auto *InitStruct = InitStructBuilder.finishAndCreateGlobal(".objc_init", CGM.getPointerAlign(), false, llvm::GlobalValue::LinkOnceODRLinkage); InitStruct->setVisibility(llvm::GlobalValue::HiddenVisibility); @@ -1451,18 +1500,23 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { // Check that this hasn't been renamed. This shouldn't happen, because // this function should be called precisely once. assert(InitVar->getName() == ".objc_ctor"); - InitVar->setSection(".ctors"); + // In Windows, initialisers are sorted by the suffix. XCL is for library + // initialisers, which run before user initialisers. We are running + // Objective-C loads at the end of library load. This means +load methods + // will run before any other static constructors, but that static + // constructors can see a fully initialised Objective-C state. + if (CGM.getTriple().isOSBinFormatCOFF()) + InitVar->setSection(".CRT$XCLz"); + else + InitVar->setSection(".ctors"); InitVar->setVisibility(llvm::GlobalValue::HiddenVisibility); InitVar->setComdat(TheModule.getOrInsertComdat(".objc_ctor")); - CGM.addCompilerUsedGlobal(InitVar); + CGM.addUsedGlobal(InitVar); for (auto *C : Categories) { auto *Cat = cast(C->stripPointerCasts()); - Cat->setSection(CatSection); + Cat->setSection(sectionName()); CGM.addUsedGlobal(Cat); } - // Add a null value fore each special section so that we can always - // guarantee that the _start and _stop symbols will exist and be - // meaningful. auto createNullGlobal = [&](StringRef Name, ArrayRef Init, StringRef Section) { auto nullBuilder = builder.beginStruct(); @@ -1476,38 +1530,48 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { CGM.addUsedGlobal(GV); return GV; }; - createNullGlobal(".objc_null_selector", {NULLPtr, NULLPtr}, SelSection); - if (Categories.empty()) - createNullGlobal(".objc_null_category", {NULLPtr, NULLPtr, - NULLPtr, NULLPtr, NULLPtr, NULLPtr, NULLPtr}, CatSection); - if (!EmittedClass) { - createNullGlobal(".objc_null_cls_init_ref", NULLPtr, ClsSection); - createNullGlobal(".objc_null_class_ref", { NULLPtr, NULLPtr }, - ClsRefSection); + for (auto clsAlias : ClassAliases) + createNullGlobal(std::string(".objc_class_alias") + + clsAlias.second, { MakeConstantString(clsAlias.second), + GetClassVar(clsAlias.first) }, sectionName()); + // On ELF platforms, add a null value for each special section so that we + // can always guarantee that the _start and _stop symbols will exist and be + // meaningful. This is not required on COFF platforms, where our start and + // stop symbols will create the section. + if (!CGM.getTriple().isOSBinFormatCOFF()) { + createNullGlobal(".objc_null_selector", {NULLPtr, NULLPtr}, + sectionName()); + if (Categories.empty()) + createNullGlobal(".objc_null_category", {NULLPtr, NULLPtr, + NULLPtr, NULLPtr, NULLPtr, NULLPtr, NULLPtr}, + sectionName()); + if (!EmittedClass) { + createNullGlobal(".objc_null_cls_init_ref", NULLPtr, + sectionName()); + createNullGlobal(".objc_null_class_ref", { NULLPtr, NULLPtr }, + sectionName()); + } + if (!EmittedProtocol) + createNullGlobal(".objc_null_protocol", {NULLPtr, NULLPtr, NULLPtr, + NULLPtr, NULLPtr, NULLPtr, NULLPtr, NULLPtr, NULLPtr, NULLPtr, + NULLPtr}, sectionName()); + if (!EmittedProtocolRef) + createNullGlobal(".objc_null_protocol_ref", {NULLPtr}, + sectionName()); + if (ClassAliases.empty()) + createNullGlobal(".objc_null_class_alias", { NULLPtr, NULLPtr }, + sectionName()); + if (ConstantStrings.empty()) { + auto i32Zero = llvm::ConstantInt::get(Int32Ty, 0); + createNullGlobal(".objc_null_constant_string", { NULLPtr, i32Zero, + i32Zero, i32Zero, i32Zero, NULLPtr }, + sectionName()); + } } - if (!EmittedProtocol) - createNullGlobal(".objc_null_protocol", {NULLPtr, NULLPtr, NULLPtr, - NULLPtr, NULLPtr, NULLPtr, NULLPtr, NULLPtr, NULLPtr, NULLPtr, - NULLPtr}, ProtocolSection); - if (!EmittedProtocolRef) - createNullGlobal(".objc_null_protocol_ref", {NULLPtr}, ProtocolRefSection); - if (!ClassAliases.empty()) - for (auto clsAlias : ClassAliases) - createNullGlobal(std::string(".objc_class_alias") + - clsAlias.second, { MakeConstantString(clsAlias.second), - GetClassVar(clsAlias.first) }, ClassAliasSection); - else - createNullGlobal(".objc_null_class_alias", { NULLPtr, NULLPtr }, - ClassAliasSection); - if (ConstantStrings.empty()) { - auto i32Zero = llvm::ConstantInt::get(Int32Ty, 0); - createNullGlobal(".objc_null_constant_string", { NULLPtr, i32Zero, - i32Zero, i32Zero, i32Zero, NULLPtr }, ConstantStringSection); - } ConstantStrings.clear(); Categories.clear(); Classes.clear(); - return nullptr;//CGObjCGNU::ModuleInitFunction(); + return nullptr; } /// In the v2 ABI, ivar offset variables use the type encoding in their name /// to trigger linker failures if the types don't match. @@ -1774,7 +1838,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { } auto *classRefSymbol = GetClassVar(className); - classRefSymbol->setSection(ClsRefSection); + classRefSymbol->setSection(sectionName()); classRefSymbol->setInitializer(llvm::ConstantExpr::getBitCast(classStruct, IdTy)); @@ -1805,7 +1869,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { auto classInitRef = new llvm::GlobalVariable(TheModule, classStruct->getType(), false, llvm::GlobalValue::ExternalLinkage, classStruct, "._OBJC_INIT_CLASS_" + className); - classInitRef->setSection(ClsSection); + classInitRef->setSection(sectionName()); CGM.addUsedGlobal(classInitRef); EmittedClass = true; @@ -1829,6 +1893,18 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { }; +const char *const CGObjCGNUstep2::SectionsBaseNames[8] = +{ +"__objc_selectors", +"__objc_classes", +"__objc_class_refs", +"__objc_cats", +"__objc_protocols", +"__objc_protocol_refs", +"__objc_class_aliases", +"__objc_constant_string" +}; + /// Support for the ObjFW runtime. class CGObjCObjFW: public CGObjCGNU { protected: @@ -1931,6 +2007,8 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runt ProtocolVersion(protocolClassVersion), ClassABIVersion(classABI) { msgSendMDKind = VMContext.getMDKindID("GNUObjCMessageSend"); + usesSEHExceptions = + cgm.getContext().getTargetInfo().getTriple().isWindowsMSVCEnvironment(); CodeGenTypes &Types = CGM.getTypes(); IntTy = cast( @@ -2121,8 +2199,8 @@ llvm::Value *CGObjCGNU::EmitNSAutoreleasePoolClassRef( return Value; } -llvm::Value *CGObjCGNU::GetSelector(CodeGenFunction &CGF, Selector Sel, - const std::string &TypeEncoding) { +llvm::Value *CGObjCGNU::GetTypedSelector(CodeGenFunction &CGF, Selector Sel, + const std::string &TypeEncoding) { SmallVectorImpl &Types = SelectorTable[Sel]; llvm::GlobalAlias *SelValue = nullptr; @@ -2155,13 +2233,13 @@ Address CGObjCGNU::GetAddrOfSelector(CodeGenFunction & } llvm::Value *CGObjCGNU::GetSelector(CodeGenFunction &CGF, Selector Sel) { - return GetSelector(CGF, Sel, std::string()); + return GetTypedSelector(CGF, Sel, std::string()); } llvm::Value *CGObjCGNU::GetSelector(CodeGenFunction &CGF, const ObjCMethodDecl *Method) { std::string SelTypes = CGM.getContext().getObjCEncodingForMethodDecl(Method); - return GetSelector(CGF, Method->getSelector(), SelTypes); + return GetTypedSelector(CGF, Method->getSelector(), SelTypes); } llvm::Constant *CGObjCGNU::GetEHType(QualType T) { @@ -2186,6 +2264,9 @@ llvm::Constant *CGObjCGNU::GetEHType(QualType T) { } llvm::Constant *CGObjCGNUstep::GetEHType(QualType T) { + if (usesSEHExceptions) + return CGM.getCXXABI().getAddrOfRTTIDescriptor(T); + if (!CGM.getLangOpts().CPlusPlus) return CGObjCGNU::GetEHType(T); @@ -3726,6 +3807,7 @@ void CGObjCGNU::EmitThrowStmt(CodeGenFunction &CGF, const ObjCAtThrowStmt &S, bool ClearInsertionPoint) { llvm::Value *ExceptionAsObject; + bool isRethrow = false; if (const Expr *ThrowExpr = S.getThrowExpr()) { llvm::Value *Exception = CGF.EmitObjCThrowOperand(ThrowExpr); @@ -3734,11 +3816,24 @@ void CGObjCGNU::EmitThrowStmt(CodeGenFunction &CGF, assert((!CGF.ObjCEHValueStack.empty() && CGF.ObjCEHValueStack.back()) && "Unexpected rethrow outside @catch block."); ExceptionAsObject = CGF.ObjCEHValueStack.back(); + isRethrow = true; } - ExceptionAsObject = CGF.Builder.CreateBitCast(ExceptionAsObject, IdTy); - llvm::CallSite Throw = - CGF.EmitRuntimeCallOrInvoke(ExceptionThrowFn, ExceptionAsObject); - Throw.setDoesNotReturn(); + if (isRethrow && usesSEHExceptions) { + // For SEH, ExceptionAsObject may be undef, because the catch handler is + // not passed it for catchalls and so it is not visible to the catch + // funclet. The real thrown object will still be live on the stack at this + // point and will be rethrown. If we are explicitly rethrowing the object + // that was passed into the `@catch` block, then this code path is not + // reached and we will instead call `objc_exception_throw` with an explicit *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Aug 18 08:27: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 7E56C10893AD; Sat, 18 Aug 2018 08:27:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2133287639; Sat, 18 Aug 2018 08:27:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDC2A14F7C; Sat, 18 Aug 2018 08:27:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8R5me016057; Sat, 18 Aug 2018 08:27:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8R5LG016056; Sat, 18 Aug 2018 08:27:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180827.w7I8R5LG016056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338003 - vendor/clang/clang-release_70-r339999 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-release_70-r339999 X-SVN-Commit-Revision: 338003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:27:06 -0000 Author: dim Date: Sat Aug 18 08:27:05 2018 New Revision: 338003 URL: https://svnweb.freebsd.org/changeset/base/338003 Log: Tag clang release_70 branch r339999. Added: vendor/clang/clang-release_70-r339999/ - copied from r338002, vendor/clang/dist-release_70/ From owner-svn-src-all@freebsd.org Sat Aug 18 08:27: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 4F0D410893D9; Sat, 18 Aug 2018 08:27:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 578EE88058; Sat, 18 Aug 2018 08:27:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EA5B14F7D; Sat, 18 Aug 2018 08:27:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8R9ns016103; Sat, 18 Aug 2018 08:27:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8R9ca016102; Sat, 18 Aug 2018 08:27:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180827.w7I8R9ca016102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338004 - vendor/compiler-rt/compiler-rt-release_70-r339999 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-release_70-r339999 X-SVN-Commit-Revision: 338004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:27:12 -0000 Author: dim Date: Sat Aug 18 08:27:08 2018 New Revision: 338004 URL: https://svnweb.freebsd.org/changeset/base/338004 Log: Tag compiler-rt release_70 branch r339999. Added: vendor/compiler-rt/compiler-rt-release_70-r339999/ - copied from r338003, vendor/compiler-rt/dist-release_70/ From owner-svn-src-all@freebsd.org Sat Aug 18 08:27: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 C30DC1089434; Sat, 18 Aug 2018 08:27:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68DAA88251; Sat, 18 Aug 2018 08:27:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1334714F7F; Sat, 18 Aug 2018 08:27:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8RLIe016235; Sat, 18 Aug 2018 08:27:21 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8RLGX016234; Sat, 18 Aug 2018 08:27:21 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180827.w7I8RLGX016234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338006 - vendor/libc++/libc++-release_70-r339999 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-release_70-r339999 X-SVN-Commit-Revision: 338006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:27:25 -0000 Author: dim Date: Sat Aug 18 08:27:21 2018 New Revision: 338006 URL: https://svnweb.freebsd.org/changeset/base/338006 Log: Tag libc++ release_70 branch r339999. Added: vendor/libc++/libc++-release_70-r339999/ - copied from r338005, vendor/libc++/dist-release_70/ From owner-svn-src-all@freebsd.org Sat Aug 18 08: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 EB0AB1089453; Sat, 18 Aug 2018 08:27:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64FBF882AE; Sat, 18 Aug 2018 08:27:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C336614F80; Sat, 18 Aug 2018 08:27:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8RQ8q016293; Sat, 18 Aug 2018 08:27:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8ROeG016284; Sat, 18 Aug 2018 08:27:24 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180827.w7I8ROeG016284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338007 - in vendor/lld/dist-release_70: COFF ELF docs test/COFF test/COFF/Inputs test/ELF test/ELF/lto test/mach-o test/wasm/lto X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist-release_70: COFF ELF docs test/COFF test/COFF/Inputs test/ELF test/ELF/lto test/mach-o test/wasm/lto X-SVN-Commit-Revision: 338007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:27:29 -0000 Author: dim Date: Sat Aug 18 08:27:24 2018 New Revision: 338007 URL: https://svnweb.freebsd.org/changeset/base/338007 Log: Vendor import of lld release_70 branch r339999: https://llvm.org/svn/llvm-project/lld/branches/release_70@339999 Added: vendor/lld/dist-release_70/test/COFF/Inputs/common-replacement.s (contents, props changed) vendor/lld/dist-release_70/test/COFF/common-replacement.s (contents, props changed) Modified: vendor/lld/dist-release_70/COFF/Driver.cpp vendor/lld/dist-release_70/ELF/SyntheticSections.cpp vendor/lld/dist-release_70/docs/ReleaseNotes.rst vendor/lld/dist-release_70/test/ELF/lto/cache.ll vendor/lld/dist-release_70/test/ELF/x86-64-reloc-error2.s vendor/lld/dist-release_70/test/mach-o/dependency_info.yaml vendor/lld/dist-release_70/test/wasm/lto/cache.ll Modified: vendor/lld/dist-release_70/COFF/Driver.cpp ============================================================================== --- vendor/lld/dist-release_70/COFF/Driver.cpp Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/COFF/Driver.cpp Sat Aug 18 08:27:24 2018 (r338007) @@ -1551,11 +1551,11 @@ void LinkerDriver::link(ArrayRef ArgsArr continue; } + // If the symbol isn't common, it must have been replaced with a regular + // symbol, which will carry its own alignment. auto *DC = dyn_cast(Sym); - if (!DC) { - warn("/aligncomm symbol " + Name + " of wrong kind"); + if (!DC) continue; - } CommonChunk *C = DC->getChunk(); C->Alignment = std::max(C->Alignment, Alignment); Modified: vendor/lld/dist-release_70/ELF/SyntheticSections.cpp ============================================================================== --- vendor/lld/dist-release_70/ELF/SyntheticSections.cpp Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/ELF/SyntheticSections.cpp Sat Aug 18 08:27:24 2018 (r338007) @@ -2929,8 +2929,10 @@ void elf::mergeSections() { // We do not want to handle sections that are not alive, so just remove // them instead of trying to merge. - if (!MS->Live) + if (!MS->Live) { + S = nullptr; continue; + } StringRef OutsecName = getOutputSectionName(MS); uint32_t Alignment = std::max(MS->Alignment, MS->Entsize); Modified: vendor/lld/dist-release_70/docs/ReleaseNotes.rst ============================================================================== --- vendor/lld/dist-release_70/docs/ReleaseNotes.rst Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/docs/ReleaseNotes.rst Sat Aug 18 08:27:24 2018 (r338007) @@ -29,7 +29,13 @@ ELF Improvements COFF Improvements ----------------- -* Item 1. +* Improved correctness of exporting mangled stdcall symbols. + +* Completed support for ARM64 relocations. + +* Added support for outputting PDB debug info for MinGW targets. + +* Improved compatibility of output binaries with GNU binutils objcopy/strip. MachO Improvements ------------------ Added: vendor/lld/dist-release_70/test/COFF/Inputs/common-replacement.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_70/test/COFF/Inputs/common-replacement.s Sat Aug 18 08:27:24 2018 (r338007) @@ -0,0 +1,5 @@ + .globl foo + .data + .p2align 2, 0 +foo: + .long 42 Added: vendor/lld/dist-release_70/test/COFF/common-replacement.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_70/test/COFF/common-replacement.s Sat Aug 18 08:27:24 2018 (r338007) @@ -0,0 +1,35 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t1.obj +# RUN: llvm-mc -triple=x86_64-windows-gnu %S/Inputs/common-replacement.s -filetype=obj -o %t2.obj + +# RUN: lld-link -lldmingw -entry:main %t1.obj %t2.obj -out:%t.exe -verbose 2>&1 \ +# RUN: | FileCheck -check-prefix VERBOSE %s +# RUN: llvm-readobj -s %t.exe | FileCheck -check-prefix SECTIONS %s + +# VERBOSE: -aligncomm:"foo",2 + +# As long as the .comm symbol is replaced with actual data, RawDataSize +# below should be nonzero. + +# SECTIONS: Name: .data (2E 64 61 74 61 00 00 00) +# SECTIONS-NEXT: VirtualSize: 0x8 +# SECTIONS-NEXT: VirtualAddress: 0x2000 +# SECTIONS-NEXT: RawDataSize: 512 + + + .text + .def main; + .scl 2; + .type 32; + .endef + .globl main + .p2align 4, 0x90 +main: + movl foo(%rip), %eax + retq + +# This produces an aligncomm directive, but when linking in +# Inputs/common-replacement.s, this symbol is replaced by a normal defined +# symbol instead. + .comm foo, 4, 2 Modified: vendor/lld/dist-release_70/test/ELF/lto/cache.ll ============================================================================== --- vendor/lld/dist-release_70/test/ELF/lto/cache.ll Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/test/ELF/lto/cache.ll Sat Aug 18 08:27:24 2018 (r338007) @@ -13,7 +13,7 @@ ; RUN: ls %t.cache | count 4 ; Create a file of size 64KB. -; RUN: "%python" -c "print(' ' * 65536)" > %t.cache/llvmcache-foo +; RUN: %python -c "print(' ' * 65536)" > %t.cache/llvmcache-foo ; This should leave the file in place. ; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k:prune_interval=0s -o %t3 %t2.o %t.o Modified: vendor/lld/dist-release_70/test/ELF/x86-64-reloc-error2.s ============================================================================== --- vendor/lld/dist-release_70/test/ELF/x86-64-reloc-error2.s Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/test/ELF/x86-64-reloc-error2.s Sat Aug 18 08:27:24 2018 (r338007) @@ -1,14 +1,18 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s +# RUN: not ld.lld --entry=func --gc-sections %t.o -o /dev/null 2>&1 | FileCheck %s ## Check we are able to find a function symbol that encloses ## a given location when reporting error messages. # CHECK: {{.*}}.o:(function func): relocation R_X86_64_32S out of range: -281474974609408 is not in [-2147483648, 2147483647] +# This mergeable section will be garbage collected. We had a crash issue in that case. Test it. +.section .rodata.str1,"aMS",@progbits,1 +.asciz "a" + .section .text.func, "ax", %progbits .globl func .type func,@function -.size func, 0x10 func: - movq func - 0x1000000000000, %rdx + movq $func - 0x1000000000000, %rdx +.size func, .-func Modified: vendor/lld/dist-release_70/test/mach-o/dependency_info.yaml ============================================================================== --- vendor/lld/dist-release_70/test/mach-o/dependency_info.yaml Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/test/mach-o/dependency_info.yaml Sat Aug 18 08:27:24 2018 (r338007) @@ -9,7 +9,7 @@ # RUN: -F/Custom/Frameworks \ # RUN: -framework Bar \ # RUN: -framework Foo -# RUN: '%python' %p/Inputs/DependencyDump.py %t.info | FileCheck %s +# RUN: %python %p/Inputs/DependencyDump.py %t.info | FileCheck %s # CHECK: linker-vers: lld Modified: vendor/lld/dist-release_70/test/wasm/lto/cache.ll ============================================================================== --- vendor/lld/dist-release_70/test/wasm/lto/cache.ll Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/test/wasm/lto/cache.ll Sat Aug 18 08:27:24 2018 (r338007) @@ -11,7 +11,7 @@ ; RUN: ls %t.cache | count 4 ; Create a file of size 64KB. -; RUN: "%python" -c "print(' ' * 65536)" > %t.cache/llvmcache-foo +; RUN: %python -c "print(' ' * 65536)" > %t.cache/llvmcache-foo ; This should leave the file in place. ; RUN: wasm-ld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k:prune_interval=0s -o %t.wasm %t2.o %t.o From owner-svn-src-all@freebsd.org Sat Aug 18 08:27:25 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 31427108943A; Sat, 18 Aug 2018 08:27:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B7EF881D9; Sat, 18 Aug 2018 08:27:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21CF014F7E; Sat, 18 Aug 2018 08:27:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8RIKg016189; Sat, 18 Aug 2018 08:27:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8RClX016153; Sat, 18 Aug 2018 08:27:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180827.w7I8RClX016153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338005 - in vendor/libc++/dist-release_70: . docs docs/DesignDocs include test/libcxx/language.support test/libcxx/memory test/std/depr/depr.c.headers test/std/language.support/support... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/libc++/dist-release_70: . docs docs/DesignDocs include test/libcxx/language.support test/libcxx/memory test/std/depr/depr.c.headers test/std/language.support/support.dynamic/new.delete/new.d... X-SVN-Commit-Revision: 338005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:27:25 -0000 Author: dim Date: Sat Aug 18 08:27:12 2018 New Revision: 338005 URL: https://svnweb.freebsd.org/changeset/base/338005 Log: Vendor import of libc++ release_70 branch r339999: https://llvm.org/svn/llvm-project/libcxx/branches/release_70@339999 Added: vendor/libc++/dist-release_70/test/libcxx/memory/aligned_allocation_macro.pass.cpp (contents, props changed) vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp (contents, props changed) vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp (contents, props changed) vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp (contents, props changed) vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp (contents, props changed) vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp (contents, props changed) vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp (contents, props changed) Deleted: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.fail.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.fail.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.fail.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.fail.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.fail.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.fail.cpp Modified: vendor/libc++/dist-release_70/CMakeLists.txt vendor/libc++/dist-release_70/docs/BuildingLibcxx.rst vendor/libc++/dist-release_70/docs/DesignDocs/VisibilityMacros.rst vendor/libc++/dist-release_70/include/__config vendor/libc++/dist-release_70/include/__config_site.in vendor/libc++/dist-release_70/include/cstdlib vendor/libc++/dist-release_70/include/ctime vendor/libc++/dist-release_70/include/new vendor/libc++/dist-release_70/test/libcxx/language.support/has_c11_features.pass.cpp vendor/libc++/dist-release_70/test/std/depr/depr.c.headers/float_h.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.runtime/ctime.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit.pass.cpp vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit_check1.fail.cpp vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit_check2.fail.cpp vendor/libc++/dist-release_70/test/std/utilities/time/date.time/ctime.pass.cpp vendor/libc++/dist-release_70/test/support/nasty_macros.hpp vendor/libc++/dist-release_70/test/support/test_macros.h vendor/libc++/dist-release_70/utils/libcxx/test/config.py Modified: vendor/libc++/dist-release_70/CMakeLists.txt ============================================================================== --- vendor/libc++/dist-release_70/CMakeLists.txt Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/CMakeLists.txt Sat Aug 18 08:27:12 2018 (r338005) @@ -120,6 +120,7 @@ set(LIBCXX_ABI_VERSION ${DEFAULT_ABI_VERSION} CACHE ST option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF) option(LIBCXX_ABI_FORCE_ITANIUM "Ignore auto-detection and force use of the Itanium ABI.") option(LIBCXX_ABI_FORCE_MICROSOFT "Ignore auto-detection and force use of the Microsoft ABI.") +option(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT "Enable per TU ABI insulation by default. To be used by vendors." OFF) set(LIBCXX_ABI_DEFINES "" CACHE STRING "A semicolon separated list of ABI macros to define in the site config header.") option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF) @@ -175,7 +176,7 @@ cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_S cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY "Statically link the ABI library to shared library" ON - "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF) + "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_SHARED" OFF) # Generate and install a linker script inplace of libc++.so. The linker script # will link libc++ to the correct ABI library. This option is on by default @@ -662,6 +663,7 @@ endif() config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE) config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCPP_ABI_FORCE_ITANIUM) config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCPP_ABI_FORCE_MICROSOFT) +config_define_if(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT) config_define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE) config_define_if_not(LIBCXX_ENABLE_STDIN _LIBCPP_HAS_NO_STDIN) Modified: vendor/libc++/dist-release_70/docs/BuildingLibcxx.rst ============================================================================== --- vendor/libc++/dist-release_70/docs/BuildingLibcxx.rst Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/docs/BuildingLibcxx.rst Sat Aug 18 08:27:12 2018 (r338005) @@ -332,6 +332,15 @@ libc++ Feature Options Use the specified GCC toolchain and standard library when building the native stdlib benchmark tests. +.. option:: LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT:BOOL + + **Default**: ``OFF`` + + Pick the default for whether to constrain ABI-unstable symbols to + each individual translation unit. This setting controls whether + `_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT` is defined by default -- + see the documentation of that macro for details. + libc++ ABI Feature Options -------------------------- Modified: vendor/libc++/dist-release_70/docs/DesignDocs/VisibilityMacros.rst ============================================================================== --- vendor/libc++/dist-release_70/docs/DesignDocs/VisibilityMacros.rst Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/docs/DesignDocs/VisibilityMacros.rst Sat Aug 18 08:27:12 2018 (r338005) @@ -42,9 +42,42 @@ Visibility Macros **_LIBCPP_HIDE_FROM_ABI** Mark a function as not being part of the ABI of any final linked image that - uses it, and also as being internal to each TU that uses that function. In - other words, the address of a function marked with this attribute is not - guaranteed to be the same across translation units. + uses it. + +**_LIBCPP_HIDE_FROM_ABI_PER_TU** + This macro controls whether symbols hidden from the ABI with `_LIBCPP_HIDE_FROM_ABI` + are local to each translation unit in addition to being local to each final + linked image. This macro is defined to either 0 or 1. When it is defined to + 1, translation units compiled with different versions of libc++ can be linked + together, since all non ABI-facing functions are local to each translation unit. + This allows static archives built with different versions of libc++ to be linked + together. This also means that functions marked with `_LIBCPP_HIDE_FROM_ABI` + are not guaranteed to have the same address across translation unit boundaries. + + When the macro is defined to 0, there is no guarantee that translation units + compiled with different versions of libc++ can interoperate. However, this + leads to code size improvements, since non ABI-facing functions can be + deduplicated across translation unit boundaries. + + This macro can be defined by users to control the behavior they want from + libc++. The default value of this macro (0 or 1) is controlled by whether + `_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT` is defined, which is intended to + be used by vendors only (see below). + +**_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT** + This macro controls the default value for `_LIBCPP_HIDE_FROM_ABI_PER_TU`. + When the macro is defined, per TU ABI insulation is enabled by default, and + `_LIBCPP_HIDE_FROM_ABI_PER_TU` is defined to 1 unless overriden by users. + Otherwise, per TU ABI insulation is disabled by default, and + `_LIBCPP_HIDE_FROM_ABI_PER_TU` is defined to 0 unless overriden by users. + + This macro is intended for vendors to control whether they want to ship + libc++ with per TU ABI insulation enabled by default. Users can always + control the behavior they want by defining `_LIBCPP_HIDE_FROM_ABI_PER_TU` + appropriately. + + By default, this macro is not defined, which means that per TU ABI insulation + is not provided unless explicitly overriden by users. **_LIBCPP_TYPE_VIS** Mark a type's typeinfo, vtable and members as having default visibility. Modified: vendor/libc++/dist-release_70/include/__config ============================================================================== --- vendor/libc++/dist-release_70/include/__config Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/include/__config Sat Aug 18 08:27:12 2018 (r338005) @@ -328,6 +328,31 @@ # define _LIBCPP_NO_CFI #endif +#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L +# if defined(__FreeBSD__) +# define _LIBCPP_HAS_QUICK_EXIT +# define _LIBCPP_HAS_C11_FEATURES +# elif defined(__Fuchsia__) +# define _LIBCPP_HAS_QUICK_EXIT +# define _LIBCPP_HAS_TIMESPEC_GET +# define _LIBCPP_HAS_C11_FEATURES +# elif defined(__linux__) +# if !defined(_LIBCPP_HAS_MUSL_LIBC) +# if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__) +# define _LIBCPP_HAS_QUICK_EXIT +# endif +# if _LIBCPP_GLIBC_PREREQ(2, 17) +# define _LIBCPP_HAS_C11_FEATURES +# define _LIBCPP_HAS_TIMESPEC_GET +# endif +# else // defined(_LIBCPP_HAS_MUSL_LIBC) +# define _LIBCPP_HAS_QUICK_EXIT +# define _LIBCPP_HAS_TIMESPEC_GET +# define _LIBCPP_HAS_C11_FEATURES +# endif +# endif // __linux__ +#endif + #if defined(_LIBCPP_COMPILER_CLANG) // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for @@ -430,28 +455,6 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES #endif -#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L -# if defined(__FreeBSD__) -# define _LIBCPP_HAS_QUICK_EXIT -# define _LIBCPP_HAS_C11_FEATURES -# elif defined(__Fuchsia__) -# define _LIBCPP_HAS_QUICK_EXIT -# define _LIBCPP_HAS_C11_FEATURES -# elif defined(__linux__) -# if !defined(_LIBCPP_HAS_MUSL_LIBC) -# if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__) -# define _LIBCPP_HAS_QUICK_EXIT -# endif -# if _LIBCPP_GLIBC_PREREQ(2, 17) -# define _LIBCPP_HAS_C11_FEATURES -# endif -# else // defined(_LIBCPP_HAS_MUSL_LIBC) -# define _LIBCPP_HAS_QUICK_EXIT -# define _LIBCPP_HAS_C11_FEATURES -# endif -# endif // __linux__ -#endif - #if !(__has_feature(cxx_noexcept)) #define _LIBCPP_HAS_NO_NOEXCEPT #endif @@ -801,8 +804,20 @@ namespace std { # define _LIBCPP_INTERNAL_LINKAGE _LIBCPP_ALWAYS_INLINE #endif +#ifndef _LIBCPP_HIDE_FROM_ABI_PER_TU +# ifndef _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT +# define _LIBCPP_HIDE_FROM_ABI_PER_TU 0 +# else +# define _LIBCPP_HIDE_FROM_ABI_PER_TU 1 +# endif +#endif + #ifndef _LIBCPP_HIDE_FROM_ABI -# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE +# if _LIBCPP_HIDE_FROM_ABI_PER_TU +# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE +# else +# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_ALWAYS_INLINE +# endif #endif // Just so we can migrate to _LIBCPP_HIDE_FROM_ABI gradually. @@ -991,6 +1006,11 @@ template struct __static_assert_check {}; # endif #endif // defined(__APPLE__) +#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) && \ + !defined(_LIBCPP_BUILDING_LIBRARY) && \ + (!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606) +# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION +#endif #if defined(__APPLE__) || defined(__FreeBSD__) #define _LIBCPP_HAS_DEFAULTRUNELOCALE Modified: vendor/libc++/dist-release_70/include/__config_site.in ============================================================================== --- vendor/libc++/dist-release_70/include/__config_site.in Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/include/__config_site.in Sat Aug 18 08:27:12 2018 (r338005) @@ -14,6 +14,7 @@ #cmakedefine _LIBCPP_ABI_UNSTABLE #cmakedefine _LIBCPP_ABI_FORCE_ITANIUM #cmakedefine _LIBCPP_ABI_FORCE_MICROSOFT +#cmakedefine _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT #cmakedefine _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE #cmakedefine _LIBCPP_HAS_NO_STDIN #cmakedefine _LIBCPP_HAS_NO_STDOUT Modified: vendor/libc++/dist-release_70/include/cstdlib ============================================================================== --- vendor/libc++/dist-release_70/include/cstdlib Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/include/cstdlib Sat Aug 18 08:27:12 2018 (r338005) @@ -151,11 +151,11 @@ using ::mbtowc; using ::wctomb; using ::mbstowcs; using ::wcstombs; -#ifdef _LIBCPP_HAS_QUICK_EXIT +#if !defined(_LIBCPP_CXX03_LANG) && defined(_LIBCPP_HAS_QUICK_EXIT) using ::at_quick_exit; using ::quick_exit; #endif -#ifdef _LIBCPP_HAS_C11_FEATURES +#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES) using ::aligned_alloc; #endif Modified: vendor/libc++/dist-release_70/include/ctime ============================================================================== --- vendor/libc++/dist-release_70/include/ctime Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/include/ctime Sat Aug 18 08:27:12 2018 (r338005) @@ -73,7 +73,7 @@ using ::gmtime; using ::localtime; #endif using ::strftime; -#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES) +#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) using ::timespec_get; #endif Modified: vendor/libc++/dist-release_70/include/new ============================================================================== --- vendor/libc++/dist-release_70/include/new Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/include/new Sat Aug 18 08:27:12 2018 (r338005) @@ -108,13 +108,6 @@ void operator delete[](void* ptr, void*) noexcept; # define _LIBCPP_HAS_NO_SIZED_DEALLOCATION #endif -#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) && \ - (!(defined(_LIBCPP_BUILDING_LIBRARY) || _LIBCPP_STD_VER > 14 || \ - (defined(__cpp_aligned_new) && __cpp_aligned_new >= 201606))) -# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION -#endif - - #if !__has_builtin(__builtin_operator_new) || \ __has_builtin(__builtin_operator_new) < 201802L || \ defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || \ Modified: vendor/libc++/dist-release_70/test/libcxx/language.support/has_c11_features.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/libcxx/language.support/has_c11_features.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/libcxx/language.support/has_c11_features.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -14,6 +14,9 @@ // _LIBCPP_HAS_C11_FEATURES - which is defined in <__config> // They should always be the same +#include <__config> +#include "test_macros.h" + #ifdef TEST_HAS_C11_FEATURES # ifndef _LIBCPP_HAS_C11_FEATURES # error "TEST_HAS_C11_FEATURES is defined, but _LIBCPP_HAS_C11_FEATURES is not" Added: vendor/libc++/dist-release_70/test/libcxx/memory/aligned_allocation_macro.pass.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist-release_70/test/libcxx/memory/aligned_allocation_macro.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// aligned allocation functions are not provided prior to macosx10.13 +// XFAIL: macosx10.12 +// XFAIL: macosx10.11 +// XFAIL: macosx10.10 +// XFAIL: macosx10.9 +// XFAIL: macosx10.8 +// XFAIL: macosx10.7 + +#include + + +#ifdef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION +# error "libc++ should have aligned allocation in C++17 and up when targeting a platform that supports it" +#endif + +int main() { } Modified: vendor/libc++/dist-release_70/test/std/depr/depr.c.headers/float_h.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/depr/depr.c.headers/float_h.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/depr/depr.c.headers/float_h.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -11,6 +11,8 @@ #include +#include "test_macros.h" + #ifndef FLT_ROUNDS #error FLT_ROUNDS not defined #endif @@ -23,7 +25,7 @@ #error FLT_RADIX not defined #endif -#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0 #ifndef FLT_HAS_SUBNORM #error FLT_HAS_SUBNORM not defined #endif @@ -53,7 +55,7 @@ #error DECIMAL_DIG not defined #endif -#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0 #ifndef FLT_DECIMAL_DIG #error FLT_DECIMAL_DIG not defined #endif @@ -163,7 +165,7 @@ #error LDBL_MIN not defined #endif -#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0 #ifndef FLT_TRUE_MIN #error FLT_TRUE_MIN not defined #endif Modified: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -12,17 +12,27 @@ // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14 // Older Clang versions do not support this -// XFAIL: clang-3, apple-clang-7, apple-clang-8 +// UNSUPPORTED: clang-3, apple-clang-7, apple-clang-8 // None of the current GCC compilers support this. -// XFAIL: gcc-5, gcc-6 +// UNSUPPORTED: gcc-5, gcc-6 -// XFAIL: with_system_cxx_lib=macosx10.12 -// XFAIL: with_system_cxx_lib=macosx10.11 -// XFAIL: with_system_cxx_lib=macosx10.10 -// XFAIL: with_system_cxx_lib=macosx10.9 -// XFAIL: with_system_cxx_lib=macosx10.7 -// XFAIL: with_system_cxx_lib=macosx10.8 +// dylibs shipped before macosx10.13 do not provide aligned allocation, so that's a link error +// UNSUPPORTED: with_system_cxx_lib=macosx10.12 +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 +// UNSUPPORTED: with_system_cxx_lib=macosx10.8 +// UNSUPPORTED: with_system_cxx_lib=macosx10.7 + +// Using aligned allocation functions is a compiler error when deploying to +// platforms older than macosx10.13 +// UNSUPPORTED: macosx10.12 +// UNSUPPORTED: macosx10.11 +// UNSUPPORTED: macosx10.10 +// UNSUPPORTED: macosx10.9 +// UNSUPPORTED: macosx10.8 +// UNSUPPORTED: macosx10.7 // On Windows libc++ doesn't provide its own definitions for new/delete // but instead depends on the ones in VCRuntime. However VCRuntime does not Modified: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -15,13 +15,22 @@ // FIXME change this to XFAIL. // UNSUPPORTED: no-aligned-allocation && !gcc -// XFAIL: with_system_cxx_lib=macosx10.12 -// XFAIL: with_system_cxx_lib=macosx10.11 -// XFAIL: with_system_cxx_lib=macosx10.10 -// XFAIL: with_system_cxx_lib=macosx10.9 -// XFAIL: with_system_cxx_lib=macosx10.7 -// XFAIL: with_system_cxx_lib=macosx10.8 +// dylibs shipped before macosx10.13 do not provide aligned allocation, so that's a link error +// UNSUPPORTED: with_system_cxx_lib=macosx10.12 +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 +// UNSUPPORTED: with_system_cxx_lib=macosx10.8 +// UNSUPPORTED: with_system_cxx_lib=macosx10.7 +// Using aligned allocation functions is a compiler error when deploying to +// platforms older than macosx10.13 +// UNSUPPORTED: macosx10.12 +// UNSUPPORTED: macosx10.11 +// UNSUPPORTED: macosx10.10 +// UNSUPPORTED: macosx10.9 +// UNSUPPORTED: macosx10.8 +// UNSUPPORTED: macosx10.7 // On Windows libc++ doesn't provide its own definitions for new/delete // but instead depends on the ones in VCRuntime. However VCRuntime does not Modified: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -15,12 +15,22 @@ // FIXME turn this into an XFAIL // UNSUPPORTED: no-aligned-allocation && !gcc -// XFAIL: with_system_cxx_lib=macosx10.12 -// XFAIL: with_system_cxx_lib=macosx10.11 -// XFAIL: with_system_cxx_lib=macosx10.10 -// XFAIL: with_system_cxx_lib=macosx10.9 -// XFAIL: with_system_cxx_lib=macosx10.7 -// XFAIL: with_system_cxx_lib=macosx10.8 +// dylibs shipped before macosx10.13 do not provide aligned allocation, so that's a link error +// UNSUPPORTED: with_system_cxx_lib=macosx10.12 +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 +// UNSUPPORTED: with_system_cxx_lib=macosx10.8 +// UNSUPPORTED: with_system_cxx_lib=macosx10.7 + +// Using aligned allocation functions is a compiler error when deploying to +// platforms older than macosx10.13 +// UNSUPPORTED: macosx10.12 +// UNSUPPORTED: macosx10.11 +// UNSUPPORTED: macosx10.10 +// UNSUPPORTED: macosx10.9 +// UNSUPPORTED: macosx10.8 +// UNSUPPORTED: macosx10.7 // On Windows libc++ doesn't provide its own definitions for new/delete // but instead depends on the ones in VCRuntime. However VCRuntime does not Modified: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -10,12 +10,24 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // UNSUPPORTED: sanitizer-new-delete -// XFAIL: with_system_cxx_lib=macosx10.12 -// XFAIL: with_system_cxx_lib=macosx10.11 -// XFAIL: with_system_cxx_lib=macosx10.10 -// XFAIL: with_system_cxx_lib=macosx10.9 -// XFAIL: with_system_cxx_lib=macosx10.7 -// XFAIL: with_system_cxx_lib=macosx10.8 +// dylibs shipped before macosx10.13 do not provide aligned allocation, so our +// custom aligned allocation functions are not called and the test fails +// UNSUPPORTED: with_system_cxx_lib=macosx10.12 +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 +// UNSUPPORTED: with_system_cxx_lib=macosx10.8 +// UNSUPPORTED: with_system_cxx_lib=macosx10.7 + +// Our custom aligned allocation functions are not called when deploying to +// platforms older than macosx10.13, since those platforms don't support +// aligned allocation. +// UNSUPPORTED: macosx10.12 +// UNSUPPORTED: macosx10.11 +// UNSUPPORTED: macosx10.10 +// UNSUPPORTED: macosx10.9 +// UNSUPPORTED: macosx10.8 +// UNSUPPORTED: macosx10.7 // XFAIL: no-aligned-allocation && !gcc Added: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -0,0 +1,26 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// void* operator new[](std::size_t); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +// REQUIRES: -faligned-allocation +// RUN: %compile %verify -faligned-allocation + +#include + +int main () +{ + ::operator new[](4); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} +} Added: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -0,0 +1,26 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// void* operator new[](std::size_t, std::align_val_t); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +// REQUIRES: -faligned-allocation +// RUN: %compile %verify -faligned-allocation + +#include + +int main () +{ + ::operator new[](4, std::align_val_t{4}); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} +} Added: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -0,0 +1,26 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// void* operator new[](std::size_t, std::align_val_t, std::nothrow_t &); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +// REQUIRES: -faligned-allocation +// RUN: %compile %verify -faligned-allocation + +#include + +int main () +{ + ::operator new[](4, std::align_val_t{4}, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} +} Added: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -0,0 +1,26 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// void* operator new[](std::size_t, std::nothrow_t &); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +// REQUIRES: -faligned-allocation +// RUN: %compile %verify -faligned-allocation + +#include + +int main () +{ + ::operator new[](4, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} +} Modified: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -11,17 +11,27 @@ // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14 // Older Clang versions do not support this -// XFAIL: clang-3, apple-clang-7, apple-clang-8 +// UNSUPPORTED: clang-3, apple-clang-7, apple-clang-8 // None of the current GCC compilers support this. -// XFAIL: gcc-5, gcc-6 +// UNSUPPORTED: gcc-5, gcc-6 -// XFAIL: with_system_cxx_lib=macosx10.12 -// XFAIL: with_system_cxx_lib=macosx10.11 -// XFAIL: with_system_cxx_lib=macosx10.10 -// XFAIL: with_system_cxx_lib=macosx10.9 -// XFAIL: with_system_cxx_lib=macosx10.7 -// XFAIL: with_system_cxx_lib=macosx10.8 +// dylibs shipped before macosx10.13 do not provide aligned allocation, so that's a link error +// UNSUPPORTED: with_system_cxx_lib=macosx10.12 +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 +// UNSUPPORTED: with_system_cxx_lib=macosx10.8 +// UNSUPPORTED: with_system_cxx_lib=macosx10.7 + +// Using aligned allocation functions is a compiler error when deploying to +// platforms older than macosx10.13 +// UNSUPPORTED: macosx10.12 +// UNSUPPORTED: macosx10.11 +// UNSUPPORTED: macosx10.10 +// UNSUPPORTED: macosx10.9 +// UNSUPPORTED: macosx10.8 +// UNSUPPORTED: macosx10.7 // On Windows libc++ doesn't provide its own definitions for new/delete // but instead depends on the ones in VCRuntime. However VCRuntime does not Modified: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -9,12 +9,22 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: with_system_cxx_lib=macosx10.12 -// XFAIL: with_system_cxx_lib=macosx10.11 -// XFAIL: with_system_cxx_lib=macosx10.10 -// XFAIL: with_system_cxx_lib=macosx10.9 -// XFAIL: with_system_cxx_lib=macosx10.7 -// XFAIL: with_system_cxx_lib=macosx10.8 +// dylibs shipped before macosx10.13 do not provide aligned allocation, so that's a link error +// UNSUPPORTED: with_system_cxx_lib=macosx10.12 +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 +// UNSUPPORTED: with_system_cxx_lib=macosx10.8 +// UNSUPPORTED: with_system_cxx_lib=macosx10.7 + +// Using aligned allocation functions is a compiler error when deploying to +// platforms older than macosx10.13 +// UNSUPPORTED: macosx10.12 +// UNSUPPORTED: macosx10.11 +// UNSUPPORTED: macosx10.10 +// UNSUPPORTED: macosx10.9 +// UNSUPPORTED: macosx10.8 +// UNSUPPORTED: macosx10.7 // asan and msan will not call the new handler. // UNSUPPORTED: sanitizer-new-delete Modified: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -9,12 +9,22 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: with_system_cxx_lib=macosx10.12 -// XFAIL: with_system_cxx_lib=macosx10.11 -// XFAIL: with_system_cxx_lib=macosx10.10 -// XFAIL: with_system_cxx_lib=macosx10.9 -// XFAIL: with_system_cxx_lib=macosx10.7 -// XFAIL: with_system_cxx_lib=macosx10.8 +// dylibs shipped before macosx10.13 do not provide aligned allocation, so that's a link error +// UNSUPPORTED: with_system_cxx_lib=macosx10.12 +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 +// UNSUPPORTED: with_system_cxx_lib=macosx10.8 +// UNSUPPORTED: with_system_cxx_lib=macosx10.7 + +// Using aligned allocation functions is a compiler error when deploying to +// platforms older than macosx10.13 +// UNSUPPORTED: macosx10.12 +// UNSUPPORTED: macosx10.11 +// UNSUPPORTED: macosx10.10 +// UNSUPPORTED: macosx10.9 +// UNSUPPORTED: macosx10.8 +// UNSUPPORTED: macosx10.7 // asan and msan will not call the new handler. // UNSUPPORTED: sanitizer-new-delete Modified: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -10,12 +10,24 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // UNSUPPORTED: sanitizer-new-delete -// XFAIL: with_system_cxx_lib=macosx10.12 -// XFAIL: with_system_cxx_lib=macosx10.11 -// XFAIL: with_system_cxx_lib=macosx10.10 -// XFAIL: with_system_cxx_lib=macosx10.9 -// XFAIL: with_system_cxx_lib=macosx10.7 -// XFAIL: with_system_cxx_lib=macosx10.8 +// dylibs shipped before macosx10.13 do not provide aligned allocation, so our +// custom aligned allocation functions are not called and the test fails +// UNSUPPORTED: with_system_cxx_lib=macosx10.12 +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 +// UNSUPPORTED: with_system_cxx_lib=macosx10.8 +// UNSUPPORTED: with_system_cxx_lib=macosx10.7 + +// Our custom aligned allocation functions are not called when deploying to +// platforms older than macosx10.13, since those platforms don't support +// aligned allocation. +// UNSUPPORTED: macosx10.12 +// UNSUPPORTED: macosx10.11 +// UNSUPPORTED: macosx10.10 +// UNSUPPORTED: macosx10.9 +// UNSUPPORTED: macosx10.8 +// UNSUPPORTED: macosx10.7 // NOTE: gcc doesn't provide -faligned-allocation flag to test for // XFAIL: no-aligned-allocation && !gcc Added: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -0,0 +1,26 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// void* operator new(std::size_t, std::align_val_t); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +// REQUIRES: -faligned-allocation +// RUN: %compile %verify -faligned-allocation + +#include + +int main () +{ + ::operator new(4, std::align_val_t{4}); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} +} Added: vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist-release_70/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -0,0 +1,26 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// void* operator new(std::size_t, std::align_val_t, std::nothrow_t &); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +// REQUIRES: -faligned-allocation +// RUN: %compile %verify -faligned-allocation + +#include + +int main () +{ + ::operator new(4, std::align_val_t{4}, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} +} Modified: vendor/libc++/dist-release_70/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -11,6 +11,8 @@ #include +#include "test_macros.h" + #ifndef FLT_ROUNDS #error FLT_ROUNDS not defined #endif @@ -23,7 +25,7 @@ #error FLT_RADIX not defined #endif -#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0 #ifndef FLT_HAS_SUBNORM #error FLT_HAS_SUBNORM not defined #endif @@ -53,7 +55,7 @@ #error DECIMAL_DIG not defined #endif -#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0 #ifndef FLT_DECIMAL_DIG #error FLT_DECIMAL_DIG not defined #endif @@ -163,7 +165,7 @@ #error LDBL_MIN not defined #endif -#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0 #ifndef FLT_TRUE_MIN #error FLT_TRUE_MIN not defined #endif Modified: vendor/libc++/dist-release_70/test/std/language.support/support.runtime/ctime.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.runtime/ctime.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.runtime/ctime.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -45,7 +45,7 @@ int main() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#if TEST_STD_VER > 14 && defined(TEST_HAS_TIMESPEC_GET) static_assert((std::is_same::value), ""); #endif #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS Modified: vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -6,7 +6,7 @@ // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// +// UNSUPPORTED: c++98, c++03 // test quick_exit and at_quick_exit Modified: vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit_check1.fail.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit_check1.fail.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit_check1.fail.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // +// UNSUPPORTED: c++98, c++03 // test that referencing at_quick_exit when _LIBCPP_HAS_QUICK_EXIT is not defined // results in a compile error. Modified: vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit_check2.fail.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit_check2.fail.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/language.support/support.start.term/quick_exit_check2.fail.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -6,7 +6,7 @@ // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// +// UNSUPPORTED: c++98, c++03 // test that referencing quick_exit when _LIBCPP_HAS_QUICK_EXIT is not defined // results in a compile error. Modified: vendor/libc++/dist-release_70/test/std/utilities/time/date.time/ctime.pass.cpp ============================================================================== --- vendor/libc++/dist-release_70/test/std/utilities/time/date.time/ctime.pass.cpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/std/utilities/time/date.time/ctime.pass.cpp Sat Aug 18 08:27:12 2018 (r338005) @@ -47,7 +47,7 @@ int main() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); -#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#if TEST_STD_VER > 14 && defined(TEST_HAS_TIMESPEC_GET) static_assert((std::is_same::value), ""); #endif #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS Modified: vendor/libc++/dist-release_70/test/support/nasty_macros.hpp ============================================================================== --- vendor/libc++/dist-release_70/test/support/nasty_macros.hpp Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/support/nasty_macros.hpp Sat Aug 18 08:27:12 2018 (r338005) @@ -22,7 +22,11 @@ #define _J NASTY_MACRO #define _K NASTY_MACRO #define _L NASTY_MACRO +// Because FreeBSD uses _M in its , and it is hard to avoid +// including that header, only define _M for other operating systems. +#ifndef __FreeBSD__ #define _M NASTY_MACRO +#endif #define _N NASTY_MACRO #define _O NASTY_MACRO #define _P NASTY_MACRO Modified: vendor/libc++/dist-release_70/test/support/test_macros.h ============================================================================== --- vendor/libc++/dist-release_70/test/support/test_macros.h Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/test/support/test_macros.h Sat Aug 18 08:27:12 2018 (r338005) @@ -124,22 +124,29 @@ // Sniff out to see if the underling C library has C11 features // Note that at this time (July 2018), MacOS X and iOS do NOT. -#if __ISO_C_VISIBLE >= 2011 +// This is cribbed from __config; but lives here as well because we can't assume libc++ +#if __ISO_C_VISIBLE >= 2011 || TEST_STD_VER >= 11 # if defined(__FreeBSD__) +// Specifically, FreeBSD does NOT have timespec_get, even though they have all +// the rest of C11 - this is PR#38495 # define TEST_HAS_C11_FEATURES # elif defined(__Fuchsia__) # define TEST_HAS_C11_FEATURES +# define TEST_HAS_TIMESPEC_GET # elif defined(__linux__) # if !defined(_LIBCPP_HAS_MUSL_LIBC) # if _LIBCPP_GLIBC_PREREQ(2, 17) +# define TEST_HAS_TIMESPEC_GET # define TEST_HAS_C11_FEATURES # endif # else // defined(_LIBCPP_HAS_MUSL_LIBC) # define TEST_HAS_C11_FEATURES +# define TEST_HAS_TIMESPEC_GET # endif # elif defined(_WIN32) # if defined(_MSC_VER) && !defined(__MINGW32__) # define TEST_HAS_C11_FEATURES // Using Microsoft's C Runtime library +# define TEST_HAS_TIMESPEC_GET # endif # endif #endif Modified: vendor/libc++/dist-release_70/utils/libcxx/test/config.py ============================================================================== --- vendor/libc++/dist-release_70/utils/libcxx/test/config.py Sat Aug 18 08:27:08 2018 (r338004) +++ vendor/libc++/dist-release_70/utils/libcxx/test/config.py Sat Aug 18 08:27:12 2018 (r338005) @@ -677,7 +677,8 @@ class Configuration(object): if feature_macros[m]: define += '=%s' % (feature_macros[m]) self.cxx.compile_flags += [define] - if m == '_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS': + if m == '_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS' or \ + m == '_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT': continue if m == '_LIBCPP_ABI_VERSION': self.config.available_features.add('libcpp-abi-version-v%s' From owner-svn-src-all@freebsd.org Sat Aug 18 08:27: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 7D4C1108947E; Sat, 18 Aug 2018 08:27:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9735588363; Sat, 18 Aug 2018 08:27:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0461714F81; Sat, 18 Aug 2018 08:27:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8RT5T016340; Sat, 18 Aug 2018 08:27:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8RTHQ016339; Sat, 18 Aug 2018 08:27:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180827.w7I8RTHQ016339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338008 - vendor/lld/lld-release_70-r339999 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-release_70-r339999 X-SVN-Commit-Revision: 338008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:27:32 -0000 Author: dim Date: Sat Aug 18 08:27:29 2018 New Revision: 338008 URL: https://svnweb.freebsd.org/changeset/base/338008 Log: Tag lld release_70 branch r339999. Added: vendor/lld/lld-release_70-r339999/ - copied from r338007, vendor/lld/dist-release_70/ From owner-svn-src-all@freebsd.org Sat Aug 18 08:27: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 0FC8E10894DD; Sat, 18 Aug 2018 08:27:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 707FF8847F; Sat, 18 Aug 2018 08:27:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D47CE14F83; Sat, 18 Aug 2018 08:27:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8RZC2016435; Sat, 18 Aug 2018 08:27:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8RZXv016434; Sat, 18 Aug 2018 08:27:35 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180827.w7I8RZXv016434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338010 - vendor/lldb/lldb-release_70-r339999 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-release_70-r339999 X-SVN-Commit-Revision: 338010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:27:39 -0000 Author: dim Date: Sat Aug 18 08:27:35 2018 New Revision: 338010 URL: https://svnweb.freebsd.org/changeset/base/338010 Log: Tag lldb release_70 branch r339999. Added: vendor/lldb/lldb-release_70-r339999/ - copied from r338009, vendor/lldb/dist-release_70/ From owner-svn-src-all@freebsd.org Sat Aug 18 08:27: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 0263510894C7; Sat, 18 Aug 2018 08:27:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E26D2883ED; Sat, 18 Aug 2018 08:27:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEB8C14F82; Sat, 18 Aug 2018 08:27:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7I8RWjK016389; Sat, 18 Aug 2018 08:27:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8RWPn016388; Sat, 18 Aug 2018 08:27:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808180827.w7I8RWPn016388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 08:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338009 - vendor/lldb/dist-release_70/lit X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/dist-release_70/lit X-SVN-Commit-Revision: 338009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:27:38 -0000 Author: dim Date: Sat Aug 18 08:27:32 2018 New Revision: 338009 URL: https://svnweb.freebsd.org/changeset/base/338009 Log: Vendor import of lldb release_70 branch r339999: https://llvm.org/svn/llvm-project/lldb/branches/release_70@339999 Modified: vendor/lldb/dist-release_70/lit/lit.cfg Modified: vendor/lldb/dist-release_70/lit/lit.cfg ============================================================================== --- vendor/lldb/dist-release_70/lit/lit.cfg Sat Aug 18 08:27:29 2018 (r338008) +++ vendor/lldb/dist-release_70/lit/lit.cfg Sat Aug 18 08:27:32 2018 (r338009) @@ -54,7 +54,7 @@ config.environment['LLVM_SRC_ROOT'] = getattr(config, config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable', '') # Register substitutions -config.substitutions.append(('%python', config.python_executable)) +config.substitutions.append(('%python', "'%s'" % (config.python_executable))) debugserver = lit.util.which('debugserver', lldb_tools_dir) lldb = "%s -S %s/lit-lldb-init" % (lit.util.which('lldb', lldb_tools_dir), From owner-svn-src-all@freebsd.org Sat Aug 18 08:32:22 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 91C8210899A2; Sat, 18 Aug 2018 08:32:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480A288E65; Sat, 18 Aug 2018 08:32:22 +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 2AC0F150F9; Sat, 18 Aug 2018 08:32:22 +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 w7I8WMe5021431; Sat, 18 Aug 2018 08:32:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7I8WMwV021430; Sat, 18 Aug 2018 08:32:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808180832.w7I8WMwV021430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 18 Aug 2018 08:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338011 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 338011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 08:32:22 -0000 Author: delphij Date: Sat Aug 18 08:32:21 2018 New Revision: 338011 URL: https://svnweb.freebsd.org/changeset/base/338011 Log: Workaround ECAPMODE for kernels between revision [331280, 337999) where getrandom(2) is not available in capability mode. Modified: head/lib/libc/gen/getentropy.c Modified: head/lib/libc/gen/getentropy.c ============================================================================== --- head/lib/libc/gen/getentropy.c Sat Aug 18 08:27:35 2018 (r338010) +++ head/lib/libc/gen/getentropy.c Sat Aug 18 08:32:21 2018 (r338011) @@ -85,7 +85,7 @@ getentropy(void *buf, size_t buflen) if (rd == -1) { if (errno == EINTR) continue; - else if (errno == ENOSYS) + else if (errno == ENOSYS || errno == ECAPMODE) return (getentropy_fallback(buf, buflen)); else return (-1); From owner-svn-src-all@freebsd.org Sat Aug 18 10:14: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 B449D108BD69; Sat, 18 Aug 2018 10:14:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 697EC8C2E0; Sat, 18 Aug 2018 10:14:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B007161BB; Sat, 18 Aug 2018 10:14:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IAE3MY073652; Sat, 18 Aug 2018 10:14:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IAE2qG073649; Sat, 18 Aug 2018 10:14:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808181014.w7IAE2qG073649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Aug 2018 10:14: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: r338012 - in stable/11/sys: kern sys vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: kern sys vm X-SVN-Commit-Revision: 338012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 10:14:04 -0000 Author: kib Date: Sat Aug 18 10:14:02 2018 New Revision: 338012 URL: https://svnweb.freebsd.org/changeset/base/338012 Log: MFC r337330: Swap in WKILLED processes. Modified: stable/11/sys/kern/kern_sig.c stable/11/sys/kern/sys_process.c stable/11/sys/sys/proc.h stable/11/sys/vm/vm_swapout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sig.c ============================================================================== --- stable/11/sys/kern/kern_sig.c Sat Aug 18 08:32:21 2018 (r338011) +++ stable/11/sys/kern/kern_sig.c Sat Aug 18 10:14:02 2018 (r338012) @@ -3075,6 +3075,23 @@ postsig(int sig) return (1); } +void +proc_wkilled(struct proc *p) +{ + + PROC_LOCK_ASSERT(p, MA_OWNED); + if ((p->p_flag & P_WKILLED) == 0) { + p->p_flag |= P_WKILLED; + /* + * Notify swapper that there is a process to swap in. + * The notification is racy, at worst it would take 10 + * seconds for the swapper process to notice. + */ + if ((p->p_flag & (P_INMEM | P_SWAPPINGIN)) == 0) + wakeup(&proc0); + } +} + /* * Kill the current process for stated reason. */ @@ -3087,7 +3104,7 @@ killproc(struct proc *p, char *why) p->p_comm); log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid, p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, why); - p->p_flag |= P_WKILLED; + proc_wkilled(p); kern_psignal(p, SIGKILL); } Modified: stable/11/sys/kern/sys_process.c ============================================================================== --- stable/11/sys/kern/sys_process.c Sat Aug 18 08:32:21 2018 (r338011) +++ stable/11/sys/kern/sys_process.c Sat Aug 18 10:14:02 2018 (r338012) @@ -1157,7 +1157,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi * accommodate any new signals. */ if (data == SIGKILL) - p->p_flag |= P_WKILLED; + proc_wkilled(p); if (req == PT_DETACH) { FOREACH_THREAD_IN_PROC(p, td3) Modified: stable/11/sys/sys/proc.h ============================================================================== --- stable/11/sys/sys/proc.h Sat Aug 18 08:32:21 2018 (r338011) +++ stable/11/sys/sys/proc.h Sat Aug 18 10:14:02 2018 (r338012) @@ -1037,6 +1037,7 @@ struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent); void proc_set_traced(struct proc *p, bool stop); +void proc_wkilled(struct proc *p); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); void pstats_free(struct pstats *ps); Modified: stable/11/sys/vm/vm_swapout.c ============================================================================== --- stable/11/sys/vm/vm_swapout.c Sat Aug 18 08:32:21 2018 (r338011) +++ stable/11/sys/vm/vm_swapout.c Sat Aug 18 10:14:02 2018 (r338012) @@ -156,13 +156,14 @@ static struct mtx vm_daemon_mtx; /* Allow for use by vm_pageout before vm_daemon is initialized. */ MTX_SYSINIT(vm_daemon, &vm_daemon_mtx, "vm daemon", MTX_DEF); +static int swapped_cnt; + static void swapclear(struct proc *); static int swapout(struct proc *); static void vm_swapout_map_deactivate_pages(vm_map_t, long); static void vm_swapout_object_deactivate_pages(pmap_t, vm_object_t, long); static void swapout_procs(int action); static void vm_req_vmdaemon(int req); -static void vm_thread_swapin(struct thread *td); static void vm_thread_swapout(struct thread *td); /* @@ -554,7 +555,7 @@ vm_thread_swapout(struct thread *td) * Bring the kernel stack for a specified thread back in. */ static void -vm_thread_swapin(struct thread *td) +vm_thread_swapin(struct thread *td, int oom_alloc) { vm_object_t ksobj; vm_page_t ma[KSTACK_MAX_PAGES]; @@ -563,7 +564,7 @@ vm_thread_swapin(struct thread *td) pages = td->td_kstack_pages; ksobj = td->td_kstack_obj; VM_OBJECT_WLOCK(ksobj); - (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma, + (void)vm_page_grab_pages(ksobj, 0, oom_alloc | VM_ALLOC_WIRED, ma, pages); for (i = 0; i < pages;) { vm_page_assert_xbusied(ma[i]); @@ -596,8 +597,10 @@ void faultin(struct proc *p) { struct thread *td; + int oom_alloc; PROC_LOCK_ASSERT(p, MA_OWNED); + /* * If another process is swapping in this process, * just wait until it finishes. @@ -607,7 +610,11 @@ faultin(struct proc *p) msleep(&p->p_flag, &p->p_mtx, PVM, "faultin", 0); return; } + if ((p->p_flag & P_INMEM) == 0) { + oom_alloc = (p->p_flag & P_WKILLED) != 0 ? VM_ALLOC_SYSTEM : + VM_ALLOC_NORMAL; + /* * Don't let another thread swap process p out while we are * busy swapping it in. @@ -615,6 +622,10 @@ faultin(struct proc *p) ++p->p_lock; p->p_flag |= P_SWAPPINGIN; PROC_UNLOCK(p); + sx_xlock(&allproc_lock); + MPASS(swapped_cnt > 0); + swapped_cnt--; + sx_xunlock(&allproc_lock); /* * We hold no lock here because the list of threads @@ -622,14 +633,14 @@ faultin(struct proc *p) * swapped out. */ FOREACH_THREAD_IN_PROC(p, td) - vm_thread_swapin(td); + vm_thread_swapin(td, oom_alloc); + PROC_LOCK(p); swapclear(p); p->p_swtick = ticks; - wakeup(&p->p_flag); - /* Allow other threads to swap p out now. */ + wakeup(&p->p_flag); --p->p_lock; } } @@ -639,29 +650,41 @@ faultin(struct proc *p) * is enough space for them. Of course, if a process waits for a long * time, it will be swapped in anyway. */ -void -swapper(void) + +static struct proc * +swapper_selector(void) { - struct proc *p, *pp; + struct proc *p, *res; struct thread *td; - int ppri, pri, slptime, swtime; + int min_flag, ppri, pri, slptime, swtime; -loop: - if (vm_page_count_min()) { - VM_WAIT; - goto loop; - } - - pp = NULL; + sx_assert(&allproc_lock, SA_SLOCKED); + if (swapped_cnt == 0) + return (NULL); + res = NULL; ppri = INT_MIN; - sx_slock(&allproc_lock); + min_flag = vm_page_count_min(); FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); - if (p->p_state == PRS_NEW || - p->p_flag & (P_SWAPPINGOUT | P_SWAPPINGIN | P_INMEM)) { + if (p->p_state == PRS_NEW || (p->p_flag & (P_SWAPPINGOUT | + P_SWAPPINGIN | P_INMEM)) != 0) { PROC_UNLOCK(p); continue; } + if (p->p_state == PRS_NORMAL && (p->p_flag & P_WKILLED) != 0) { + /* + * A swapped-out process might have mapped a + * large portion of the system's pages as + * anonymous memory. There is no other way to + * release the memory other than to kill the + * process, for which we need to swap it in. + */ + return (p); + } + if (min_flag) { + PROC_UNLOCK(p); + continue; + } swtime = (ticks - p->p_swtick) / hz; FOREACH_THREAD_IN_PROC(p, td) { /* @@ -681,7 +704,7 @@ loop: * selection. */ if (pri > ppri) { - pp = p; + res = p; ppri = pri; } } @@ -689,33 +712,40 @@ loop: } PROC_UNLOCK(p); } - sx_sunlock(&allproc_lock); + if (res != NULL) + PROC_LOCK(res); + return (res); +} - /* - * Nothing to do, back to sleep. - */ - if ((p = pp) == NULL) { - tsleep(&proc0, PVM, "swapin", MAXSLP * hz / 2); - goto loop; - } - PROC_LOCK(p); +void +swapper(void) +{ + struct proc *p; - /* - * Another process may be bringing or may have already - * brought this process in while we traverse all threads. - * Or, this process may even be being swapped out again. - */ - if (p->p_flag & (P_INMEM | P_SWAPPINGOUT | P_SWAPPINGIN)) { - PROC_UNLOCK(p); - goto loop; - } + for (;;) { + sx_slock(&allproc_lock); + p = swapper_selector(); + sx_sunlock(&allproc_lock); - /* - * We would like to bring someone in. - */ - faultin(p); - PROC_UNLOCK(p); - goto loop; + if (p == NULL) { + tsleep(&proc0, PVM, "swapin", MAXSLP * hz / 2); + } else { + PROC_LOCK_ASSERT(p, MA_OWNED); + + /* + * Another process may be bringing or may have + * already brought this process in while we + * traverse all threads. Or, this process may + * have exited or even being swapped out + * again. + */ + if (p->p_state == PRS_NORMAL && (p->p_flag & (P_INMEM | + P_SWAPPINGOUT | P_SWAPPINGIN)) == 0) { + faultin(p); + } + PROC_UNLOCK(p); + } + } } /* @@ -794,7 +824,12 @@ swapout_procs(int action) didswap = true; PROC_UNLOCK(p); - sx_slock(&allproc_lock); + if (didswap) { + sx_xlock(&allproc_lock); + swapped_cnt++; + sx_downgrade(&allproc_lock); + } else + sx_slock(&allproc_lock); PRELE(p); } sx_sunlock(&allproc_lock); From owner-svn-src-all@freebsd.org Sat Aug 18 10:58: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 9B4A2108C8FF; Sat, 18 Aug 2018 10:58:46 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44BA98D56A; Sat, 18 Aug 2018 10:58:46 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C45D168DC; Sat, 18 Aug 2018 10:58:46 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IAwjTL094622; Sat, 18 Aug 2018 10:58:45 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IAwjEV094618; Sat, 18 Aug 2018 10:58:45 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201808181058.w7IAwjEV094618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 18 Aug 2018 10:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338013 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/contrib/bsnmp/snmp_mibII X-SVN-Commit-Revision: 338013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 10:58:46 -0000 Author: eugen Date: Sat Aug 18 10:58:44 2018 New Revision: 338013 URL: https://svnweb.freebsd.org/changeset/base/338013 Log: bsnmpd(8): fix and optimize interface description processing * correctly prepare a buffer to obtain interface description from a kernel and truncate long description instead of dropping it altogether and spamming logs; * skip calling strlen() for each description and each SNMP request for MIB-II/ifXTable's ifAlias. * teach bsnmpd to allocate memory dynamically for interface descriptions to decrease memory usage for common case and not to break if long description occurs; PR: 217763 Reviewed by: harti and others MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D16459 Modified: head/contrib/bsnmp/snmp_mibII/mibII.c head/contrib/bsnmp/snmp_mibII/mibII.h head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c head/contrib/bsnmp/snmp_mibII/snmp_mibII.h Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Sat Aug 18 10:14:02 2018 (r338012) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Sat Aug 18 10:58:44 2018 (r338013) @@ -439,11 +439,15 @@ mibif_restart_mibII_poll_timer(void) int mib_fetch_ifmib(struct mibif *ifp) { + static int kmib[2] = { -1, 0 }; /* for sysctl net.ifdescr_maxlen */ + int name[6]; + size_t kmiblen = nitems(kmib); size_t len; void *newmib; struct ifmibdata oldmib = ifp->mib; struct ifreq irr; + unsigned int alias_maxlen = MIBIF_ALIAS_SIZE_MAX; if (fetch_generic_mib(ifp, &oldmib) == -1) return (-1); @@ -515,18 +519,69 @@ mib_fetch_ifmib(struct mibif *ifp) } out: + + /* + * Find sysctl mib for net.ifdescr_maxlen (one time). + * kmib[0] == -1 at first call to mib_fetch_ifmib(). + * Then kmib[0] > 0 if we found sysctl mib for net.ifdescr_maxlen. + * Else, kmib[0] == 0 (unexpected error from a kernel). + */ + if (kmib[0] < 0 && + sysctlnametomib("net.ifdescr_maxlen", kmib, &kmiblen) < 0) { + kmib[0] = 0; + syslog(LOG_WARNING, "sysctlnametomib net.ifdescr_maxlen: %m"); + } + + /* + * Fetch net.ifdescr_maxlen value every time to catch up with changes. + */ + len = sizeof(alias_maxlen); + if (kmib[0] > 0 && sysctl(kmib, 2, &alias_maxlen, &len, NULL, 0) < 0) { + /* unexpected error from the kernel, use default value */ + alias_maxlen = MIBIF_ALIAS_SIZE_MAX; + syslog(LOG_WARNING, "sysctl net.ifdescr_maxlen: %m"); + } + + /* + * Kernel limit might be decreased after interfaces got + * their descriptions assigned. Try to obtain them anyway. + */ + if (alias_maxlen == 0) + alias_maxlen = MIBIF_ALIAS_SIZE_MAX; + + /* + * Allocate maximum memory for a buffer and later reallocate + * to free extra memory. + */ + if ((ifp->alias = malloc(alias_maxlen)) == NULL) { + syslog(LOG_WARNING, "malloc(%d) failed: %m", (int)alias_maxlen); + goto fin; + } + strlcpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name)); - irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias; - irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias); + irr.ifr_buffer.buffer = ifp->alias; + irr.ifr_buffer.length = alias_maxlen; if (ioctl(mib_netsock, SIOCGIFDESCR, &irr) == -1) { - MIBIF_PRIV(ifp)->alias[0] = 0; + free(ifp->alias); + ifp->alias = NULL; if (errno != ENOMSG) syslog(LOG_WARNING, "SIOCGIFDESCR (%s): %m", ifp->name); } else if (irr.ifr_buffer.buffer == NULL) { - MIBIF_PRIV(ifp)->alias[0] = 0; + free(ifp->alias); + ifp->alias = NULL; syslog(LOG_WARNING, "SIOCGIFDESCR (%s): too long (%zu)", ifp->name, irr.ifr_buffer.length); + } else { + ifp->alias_size = strnlen(ifp->alias, alias_maxlen) + 1; + + if (ifp->alias_size > MIBIF_ALIAS_SIZE) + ifp->alias_size = MIBIF_ALIAS_SIZE; + + if (ifp->alias_size < alias_maxlen) + ifp->alias = realloc(ifp->alias, ifp->alias_size); } + +fin: ifp->mibtick = get_ticks(); return (0); } @@ -706,6 +761,10 @@ mibif_free(struct mibif *ifp) mibif_reset_hc_timer(); } + if (ifp->alias != NULL) { + free(ifp->alias); + ifp->alias = NULL; + } free(ifp->private); ifp->private = NULL; free(ifp->physaddr); Modified: head/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.h Sat Aug 18 10:14:02 2018 (r338012) +++ head/contrib/bsnmp/snmp_mibII/mibII.h Sat Aug 18 10:58:44 2018 (r338013) @@ -57,8 +57,9 @@ #include "snmp_mibII.h" #include "mibII_tree.h" -/* maximum size of the interface alias */ +/* maximum size of the interface alias unless overridden with net.ifdescr_maxlen */ #define MIBIF_ALIAS_SIZE (64 + 1) +#define MIBIF_ALIAS_SIZE_MAX 1024 /* * Interface list and flags. @@ -81,8 +82,6 @@ struct mibif_private { uint64_t hc_imcasts; uint64_t hc_ipackets; - /* this should be made public */ - char alias[MIBIF_ALIAS_SIZE]; }; #define MIBIF_PRIV(IFP) ((struct mibif_private *)((IFP)->private)) Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Aug 18 10:14:02 2018 (r338012) +++ head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Sat Aug 18 10:58:44 2018 (r338013) @@ -528,7 +528,7 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu break; case LEAF_ifAlias: - ret = string_get(value, MIBIF_PRIV(ifp)->alias, -1); + ret = string_get(value, ifp->alias, ifp->alias_size - 1); break; case LEAF_ifCounterDiscontinuityTime: Modified: head/contrib/bsnmp/snmp_mibII/snmp_mibII.h ============================================================================== --- head/contrib/bsnmp/snmp_mibII/snmp_mibII.h Sat Aug 18 10:14:02 2018 (r338012) +++ head/contrib/bsnmp/snmp_mibII/snmp_mibII.h Sat Aug 18 10:58:44 2018 (r338013) @@ -80,6 +80,9 @@ struct mibif { /* to be set by ifType specific modules. This is ifSpecific. */ struct asn_oid spec_oid; + char *alias; + size_t alias_size; + /* private data - don't touch */ void *private; }; From owner-svn-src-all@freebsd.org Sat Aug 18 12:13: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 A08B1106B000; Sat, 18 Aug 2018 12:13:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4896A8FBD9; Sat, 18 Aug 2018 12:13:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D2644F825; Sat, 18 Aug 2018 12:13:57 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f47.google.com with SMTP id v22-v6so7704679lfe.8; Sat, 18 Aug 2018 05:13:57 -0700 (PDT) X-Gm-Message-State: AOUpUlHkJG1EmyqUj6cvk1IdpC6RwKLVQj0kBg7xBjLn/ECjz+23YOB2 mqsIyPXBU1uOvKs9kc0YSHiq9G3JlZ0bsS9L/g4= X-Google-Smtp-Source: AA+uWPxreZJ+IMVdWstxpnWGngiW5bLLuJPzwQ5cY6uEMbk09oxGDiwvaCg4LYNyf7TH1HPE75WFr1/sr1XuyJjKr54= X-Received: by 2002:a19:ea52:: with SMTP id i79-v6mr125806lfh.75.1534594436243; Sat, 18 Aug 2018 05:13:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Sat, 18 Aug 2018 05:13:35 -0700 (PDT) In-Reply-To: <201808180535.w7I5ZfsS062952@pdx.rh.CN85.dnsmgr.net> References: <201808171549.w7HFndsp059932@pdx.rh.CN85.dnsmgr.net> <201808180535.w7I5ZfsS062952@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Sat, 18 Aug 2018 07:13:35 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337956 - in head: . bin/ls To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 12:13:58 -0000 On Sat, Aug 18, 2018 at 12:35 AM, Rodney W. Grimes wrote: >> > On Fri, Aug 17, 2018 at 10:26 AM, Kyle Evans wrote: >> > > On Fri, Aug 17, 2018 at 10:24 AM, Rodney W. Grimes >> > > wrote: >> > >>> Author: kevans >> > >>> Date: Fri Aug 17 04:15:51 2018 >> > >>> New Revision: 337956 >> > >>> URL: https://svnweb.freebsd.org/changeset/base/337956 >> > >>> >> > >>> Log: >> > >>> ls(1): Add --color=when >> > >>> >> > >>> --color may be set to one of: 'auto', 'always', and 'never'. >> > >>> >> > >>> 'auto' is the default behavior- output colors only if -G or COLORTERM are >> > >> >> > >> Why different than coreutils ls? Default for coreutils is none. >> > > >> > > I guess this was worded poorly and you skipped both the review and >> > > reading the diff... this is still contingent on environment variables >> > > or -G being specified. >> > > >> > >>> set, and only if stdout is a tty. >> > >>> >> > >>> 'always' is a new behavior- output colors always. termcap(5) will be >> > >>> consulted unless TERM is unset or not a recognized terminal, in which case >> > >>> ls(1) will fall back to explicitly outputting ANSI escape sequences. >> > >>> >> > >>> 'never' to turn off any environment variable and -G usage. >> > >> Why different than core utils? Coreutils uses none. >> > > >> > > I guess this was worded poorly and you skipped both the review and >> > > reading the diff... this is still contingent on environment variables >> > > or -G being specified. >> > > >> > >> > ... copy-paste-o. The version of coreutils ls(1) that I have uses >> > 'never' for this. There is no valid 'none' value. >> >> Oh boy, we need to investiage that then, cause it seems >> as if the official page says none. Does your say it >> has a different default value too? > > And our package of gnu coreutils also says never, so ignore my > raising the issue of none vs never, that needs to be raised > with the gnu folks as it seems as if there online manual and > the code is in conflict. Ooopss.. retract that here we go... > I have our pkg coreutils installed: This is what I was afraid of. =( > root@x230a:~ # gls --color=none > 828phone.tgz Desktop Downloads firefox.core soffice.bin.core > root@x230a:~ # gls --color=never > 828phone.tgz Desktop Downloads firefox.core soffice.bin.core > root@x230a:~ # gls --color=theychangedit > gls: invalid argument 'theychangedit' for '--color' > Valid arguments are: > - 'always', 'yes', 'force' > - 'never', 'no', 'none' > - 'auto', 'tty', 'if-tty' > Try 'gls --help' for more information. Except that's even worse than I thought... I assumed it was "always"; "never", "none"; "auto" having kept both "never" and "none" for backwards compat. =\ > So it looks as if we need to add a we bit > more to make our use of --color match what > coreutils actually allows. > > *Runs and ducks* cause Kyle has already gone way above > the call of duty on this one! More than happy to add all of these aliases so that we do the right thing if the user is explicit. =) I generally just don't want to change the default behavior away from respecting the environment/-G since we've done this for so long now. I believe in compatibility with GNU tools so that user doesn't get surprised when an option they want doesn't exist (see: the various long options commits I've made in the past), but I believe a lot less in bending how we do things by default to match when we already have our own precedent set. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Sat Aug 18 12:17: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 0F559106B13D; Sat, 18 Aug 2018 12:17:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A74F88FE43; Sat, 18 Aug 2018 12:17:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8267D175D0; Sat, 18 Aug 2018 12:17:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ICH6h7036531; Sat, 18 Aug 2018 12:17:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ICH6cr036530; Sat, 18 Aug 2018 12:17:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808181217.w7ICH6cr036530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Aug 2018 12:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338016 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 338016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 12:17:07 -0000 Author: kib Date: Sat Aug 18 12:17:05 2018 New Revision: 338016 URL: https://svnweb.freebsd.org/changeset/base/338016 Log: Print L1D FLUSH feature. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sat Aug 18 12:15:54 2018 (r338015) +++ head/sys/x86/x86/identcpu.c Sat Aug 18 12:17:05 2018 (r338016) @@ -989,6 +989,7 @@ printcpuinfo(void) "\020" "\033IBPB" "\034STIBP" + "\035L1DFL" "\036ARCH_CAP" "\040SSBD" ); From owner-svn-src-all@freebsd.org Sat Aug 18 16:03:16 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 DBB0D107047E; Sat, 18 Aug 2018 16:03:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E51D96581; Sat, 18 Aug 2018 16:03:16 +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 5B0B419B37; Sat, 18 Aug 2018 16:03:16 +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 w7IG3Gps063861; Sat, 18 Aug 2018 16:03:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IG3FbF063859; Sat, 18 Aug 2018 16:03:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808181603.w7IG3FbF063859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Aug 2018 16:03: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: r338017 - in stable/11: . share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: . share/mk X-SVN-Commit-Revision: 338017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 16:03:17 -0000 Author: kib Date: Sat Aug 18 16:03:15 2018 New Revision: 338017 URL: https://svnweb.freebsd.org/changeset/base/338017 Log: MFC r336570: Enable OFED build (without extras) by default. For stable/11, this is only done on amd64. Relnotes: yes Sponsored by: Mellanox Technologies Modified: stable/11/UPDATING stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Sat Aug 18 12:17:05 2018 (r338016) +++ stable/11/UPDATING Sat Aug 18 16:03:15 2018 (r338017) @@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20180818: + WITH_OFED option now only enables the build for the OFED libraries + and some fundamental client utilities. OpenSM and rest of the + debugging tools are enabled by WITH_OFED_EXTRA build switch. + WITH_OFED is turned on by default on amd64. + 20180714: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 6.0.1. Please see the 20141231 entry below for information about Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Sat Aug 18 12:17:05 2018 (r338016) +++ stable/11/share/mk/src.opts.mk Sat Aug 18 16:03:15 2018 (r338017) @@ -196,7 +196,6 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ NAND \ - OFED \ OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ @@ -314,6 +313,12 @@ __DEFAULT_YES_OPTIONS+=MLX5TOOL .else __DEFAULT_NO_OPTIONS+=CXGBETOOL __DEFAULT_NO_OPTIONS+=MLX5TOOL +.endif + +.if ${__T} == "amd64" +__DEFAULT_YES_OPTIONS+=OFED +.else +__DEFAULT_NO_OPTIONS+=OFED .endif .include From owner-svn-src-all@freebsd.org Sat Aug 18 18:33: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 077CF1072C43; Sat, 18 Aug 2018 18:33:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 988D471DC6; Sat, 18 Aug 2018 18:33:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7615D1B418; Sat, 18 Aug 2018 18:33:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IIXphA040292; Sat, 18 Aug 2018 18:33:51 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IIXodt040289; Sat, 18 Aug 2018 18:33:50 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201808181833.w7IIXodt040289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 18 Aug 2018 18:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338018 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 338018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 18:33:52 -0000 Author: alc Date: Sat Aug 18 18:33:50 2018 New Revision: 338018 URL: https://svnweb.freebsd.org/changeset/base/338018 Log: Eliminate the arena parameter to kmem_malloc_domain(). It is redundant. The domain and flags parameters suffice. In fact, the related functions kmem_alloc_{attr,contig}_domain() don't have an arena parameter. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D16713 Modified: head/sys/vm/uma_core.c head/sys/vm/vm_extern.h head/sys/vm/vm_kern.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Aug 18 16:03:15 2018 (r338017) +++ head/sys/vm/uma_core.c Sat Aug 18 18:33:50 2018 (r338018) @@ -1169,7 +1169,7 @@ page_alloc(uma_zone_t zone, vm_size_t bytes, int domai void *p; /* Returned page */ *pflag = UMA_SLAB_KERNEL; - p = (void *) kmem_malloc_domain(kernel_arena, domain, bytes, wait); + p = (void *) kmem_malloc_domain(domain, bytes, wait); return (p); } @@ -3680,32 +3680,22 @@ uma_zone_exhausted_nolock(uma_zone_t zone) void * uma_large_malloc_domain(vm_size_t size, int domain, int wait) { - struct vmem *arena; vm_offset_t addr; uma_slab_t slab; -#if VM_NRESERVLEVEL > 0 - if (__predict_true((wait & M_EXEC) == 0)) - arena = kernel_arena; - else - arena = kernel_rwx_arena; -#else - arena = kernel_arena; -#endif - slab = zone_alloc_item(slabzone, NULL, domain, wait); if (slab == NULL) return (NULL); if (domain == UMA_ANYDOMAIN) - addr = kmem_malloc(arena, size, wait); + addr = kmem_malloc(NULL, size, wait); else - addr = kmem_malloc_domain(arena, domain, size, wait); + addr = kmem_malloc_domain(domain, size, wait); if (addr != 0) { vsetslab(addr, slab); slab->us_data = (void *)addr; slab->us_flags = UMA_SLAB_KERNEL | UMA_SLAB_MALLOC; #if VM_NRESERVLEVEL > 0 - if (__predict_false(arena == kernel_rwx_arena)) + if (__predict_false((wait & M_EXEC) != 0)) slab->us_flags |= UMA_SLAB_KRWX; #endif slab->us_size = size; Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Sat Aug 18 16:03:15 2018 (r338017) +++ head/sys/vm/vm_extern.h Sat Aug 18 18:33:50 2018 (r338018) @@ -65,8 +65,7 @@ vm_offset_t kmem_alloc_contig_domain(int domain, vm_si vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); vm_offset_t kmem_malloc(struct vmem *, vm_size_t size, int flags); -vm_offset_t kmem_malloc_domain(struct vmem *, int domain, vm_size_t size, - int flags); +vm_offset_t kmem_malloc_domain(int domain, vm_size_t size, int flags); void kmem_free(struct vmem *, vm_offset_t, vm_size_t); /* This provides memory for previously allocated address space. */ Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Sat Aug 18 16:03:15 2018 (r338017) +++ head/sys/vm/vm_kern.c Sat Aug 18 18:33:50 2018 (r338018) @@ -372,23 +372,18 @@ kmem_suballoc(vm_map_t parent, vm_offset_t *min, vm_of * Allocate wired-down pages in the kernel's address space. */ vm_offset_t -kmem_malloc_domain(struct vmem *vmem, int domain, vm_size_t size, int flags) +kmem_malloc_domain(int domain, vm_size_t size, int flags) { vmem_t *arena; vm_offset_t addr; int rv; #if VM_NRESERVLEVEL > 0 - KASSERT(vmem == kernel_arena || vmem == kernel_rwx_arena, - ("kmem_malloc_domain: Only kernel_arena or kernel_rwx_arena " - "are supported.")); - if (__predict_true(vmem == kernel_arena)) + if (__predict_true((flags & M_EXEC) == 0)) arena = vm_dom[domain].vmd_kernel_arena; else arena = vm_dom[domain].vmd_kernel_rwx_arena; #else - KASSERT(vmem == kernel_arena, - ("kmem_malloc_domain: Only kernel_arena is supported.")); arena = vm_dom[domain].vmd_kernel_arena; #endif size = round_page(size); @@ -404,7 +399,7 @@ kmem_malloc_domain(struct vmem *vmem, int domain, vm_s } vm_offset_t -kmem_malloc(struct vmem *vmem, vm_size_t size, int flags) +kmem_malloc(struct vmem *vmem __unused, vm_size_t size, int flags) { struct vm_domainset_iter di; vm_offset_t addr; @@ -412,7 +407,7 @@ kmem_malloc(struct vmem *vmem, vm_size_t size, int fla vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); do { - addr = kmem_malloc_domain(vmem, domain, size, flags); + addr = kmem_malloc_domain(domain, size, flags); if (addr != 0) break; } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); From owner-svn-src-all@freebsd.org Sat Aug 18 19:14: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 9287410735D0; Sat, 18 Aug 2018 19:14:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45AED72C0F; Sat, 18 Aug 2018 19:14:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C9E11BA80; Sat, 18 Aug 2018 19:14:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IJE6QU060702; Sat, 18 Aug 2018 19:14:06 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IJE670060701; Sat, 18 Aug 2018 19:14:06 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808181914.w7IJE670060701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 18 Aug 2018 19:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338019 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 338019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 19:14:07 -0000 Author: rmacklem Date: Sat Aug 18 19:14:06 2018 New Revision: 338019 URL: https://svnweb.freebsd.org/changeset/base/338019 Log: Fix LORs between vn_start_write() and vn_lock() in nfsrv_copymr(). When coding the pNFS server, I added vn_start_write() calls in nfsrv_copymr() done while the vnodes were locked, not realizing I had introduced LORs and possible deadlock when an exported file system on the MDS is suspended. This patch fixes the LORs by moving the vn_start_write() calls up to before where the vnodes are locked. For "tvp", the vn_start_write() probaby isn't necessary, because NFS mounts can't be suspended. However, I think doing so is harmless. Thanks go to kib@ for letting me know that I had introduced these LORs. This patch only affects the behaviour of the pNFS server when pnfsdscopymr(8) is used to recover a mirrored DS. Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 18 18:33:50 2018 (r338018) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 18 19:14:06 2018 (r338019) @@ -7979,7 +7979,7 @@ nfsrv_copymr(vnode_t vp, vnode_t fvp, vnode_t dvp, str struct nfslayouthash *lhyp; struct nfslayout *lyp, *nlyp; struct nfslayouthead thl; - struct mount *mp; + struct mount *mp, *tvmp; struct acl *aclp; struct vattr va; struct timespec mtime; @@ -8042,6 +8042,7 @@ nfsrv_copymr(vnode_t vp, vnode_t fvp, vnode_t dvp, str NFSDRECALLUNLOCK(); ret = 0; + mp = tvmp = NULL; didprintf = 0; TAILQ_INIT(&thl); /* Unlock the MDS vp, so that a LayoutReturn can be done on it. */ @@ -8116,6 +8117,20 @@ tryagain2: nfsrv_freelayout(&thl, lyp); /* + * Do the vn_start_write() calls here, before the MDS vnode is + * locked and the tvp is created (locked) in the NFS file system + * that dvp is in. + * For tvmp, this probably isn't necessary, since it will be an + * NFS mount and they are not suspendable at this time. + */ + if (ret == 0) + ret = vn_start_write(vp, &mp, V_WAIT | PCATCH); + if (ret == 0) { + tvmp = dvp->v_mount; + ret = vn_start_write(NULL, &tvmp, V_WAIT | PCATCH); + } + + /* * LK_EXCLUSIVE lock the MDS vnode, so that any * proxied writes through the MDS will be blocked until we have * completed the copy and update of the extended attributes. @@ -8123,7 +8138,7 @@ tryagain2: * changed until the copy is complete. */ NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); - if ((vp->v_iflag & VI_DOOMED) != 0) { + if (ret == 0 && (vp->v_iflag & VI_DOOMED) != 0) { NFSD_DEBUG(4, "nfsrv_copymr: lk_exclusive doomed\n"); ret = ESTALE; } @@ -8148,10 +8163,7 @@ tryagain2: nfsrv_zeropnfsdat = malloc(PNFSDS_COPYSIZ, M_TEMP, M_WAITOK | M_ZERO); rdpos = wrpos = 0; - mp = NULL; - ret = vn_start_write(tvp, &mp, V_WAIT | PCATCH); - if (ret == 0) - ret = VOP_GETATTR(fvp, &va, cred); + ret = VOP_GETATTR(fvp, &va, cred); aresid = 0; while (ret == 0 && aresid == 0) { ret = vn_rdwr(UIO_READ, fvp, dat, PNFSDS_COPYSIZ, @@ -8191,8 +8203,6 @@ tryagain2: ret = 0; } - if (mp != NULL) - vn_finished_write(mp); if (ret == 0) ret = VOP_FSYNC(tvp, MNT_WAIT, p); @@ -8210,18 +8220,16 @@ tryagain2: acl_free(aclp); free(dat, M_TEMP); } + if (tvmp != NULL) + vn_finished_write(tvmp); /* Update the extended attributes for the newly created DS file. */ - if (ret == 0) { - mp = NULL; - ret = vn_start_write(vp, &mp, V_WAIT | PCATCH); - if (ret == 0) - ret = vn_extattr_set(vp, IO_NODELOCKED, - EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsfile", - sizeof(*wpf) * mirrorcnt, (char *)wpf, p); - if (mp != NULL) - vn_finished_write(mp); - } + if (ret == 0) + ret = vn_extattr_set(vp, IO_NODELOCKED, + EXTATTR_NAMESPACE_SYSTEM, "pnfsd.dsfile", + sizeof(*wpf) * mirrorcnt, (char *)wpf, p); + if (mp != NULL) + vn_finished_write(mp); /* Get rid of the dontlist entry, so that Layouts can be issued. */ NFSDDONTLISTLOCK(); From owner-svn-src-all@freebsd.org Sat Aug 18 19:45: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 B8FB4107420B; Sat, 18 Aug 2018 19:45:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51309738B6; Sat, 18 Aug 2018 19:45:57 +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 2CC0B1BF80; Sat, 18 Aug 2018 19:45:57 +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 w7IJjusD075818; Sat, 18 Aug 2018 19:45:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IJjuos075817; Sat, 18 Aug 2018 19:45:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808181945.w7IJjuos075817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 18 Aug 2018 19:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338020 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 338020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 19:45:58 -0000 Author: kevans Date: Sat Aug 18 19:45:56 2018 New Revision: 338020 URL: https://svnweb.freebsd.org/changeset/base/338020 Log: res_find: Fix fallback logic The fallback logic was broken if hints were found in multiple environments. If we found a hint in either the loader environment or the static environment, fallback would be incremented excessively when we returned to the environment-selection bits. These checks should have also been guarded by the fbacklvl checks. As a result, fbacklvl could quickly get to a point where we skip either the static environment and/or the static hints depending on which environments contained valid hints. The impact of this bug is minimal, mostly affecting mips boards that use static hints and may have hints in either the loader environment or the static environment. There may be better ways to express the searchable environments and describing their characteristics (immutable, already searched, etc.) but this may be revisited after 12 branches. Reported by: Dan Nelson Triaged by: Dan Nelson MFC after: 3 days Modified: head/sys/kern/subr_hints.c Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Sat Aug 18 19:14:06 2018 (r338019) +++ head/sys/kern/subr_hints.c Sat Aug 18 19:45:56 2018 (r338020) @@ -174,30 +174,37 @@ fallback: if (dyn_used || fbacklvl >= FBACK_STATIC) return (ENOENT); - if (fbacklvl <= FBACK_MDENV && - _res_checkenv(md_envp)) { - hintp = md_envp; - goto found; - } - fbacklvl++; + switch (fbacklvl) { + case FBACK_MDENV: + fbacklvl++; + if (_res_checkenv(md_envp)) { + hintp = md_envp; + break; + } - if (!stenv_skip && fbacklvl <= FBACK_STENV && - _res_checkenv(kern_envp)) { - hintp = kern_envp; - goto found; - } else - stenv_skip = true; + /* FALLTHROUGH */ + case FBACK_STENV: + fbacklvl++; + if (!stenv_skip && _res_checkenv(kern_envp)) { + hintp = kern_envp; + break; + } else + stenv_skip = true; - fbacklvl++; + /* FALLTHROUGH */ + case FBACK_STATIC: + fbacklvl++; + /* We'll fallback to static_hints if needed/can */ + if (!sthints_skip && + _res_checkenv(static_hints)) + hintp = static_hints; + else + sthints_skip = true; - /* We'll fallback to static_hints if needed/can */ - if (!sthints_skip && fbacklvl <= FBACK_STATIC && - _res_checkenv(static_hints)) - hintp = static_hints; - else - sthints_skip = true; -found: - fbacklvl++; + break; + default: + return (ENOENT); + } } if (hintp == NULL) From owner-svn-src-all@freebsd.org Sat Aug 18 20:23: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 5F6B61074B1A; Sat, 18 Aug 2018 20:23:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11319746D3; Sat, 18 Aug 2018 20:23:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E644B1C5E7; Sat, 18 Aug 2018 20:23:53 +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 w7IKNr28095985; Sat, 18 Aug 2018 20:23:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IKNrei095984; Sat, 18 Aug 2018 20:23:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808182023.w7IKNrei095984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Aug 2018 20:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338021 - head/usr.bin/kdump X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/kdump X-SVN-Commit-Revision: 338021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 20:23:54 -0000 Author: jhb Date: Sat Aug 18 20:23:53 2018 New Revision: 338021 URL: https://svnweb.freebsd.org/changeset/base/338021 Log: Use 'bool' instead of 'int' for various boolean flags. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16611 Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sat Aug 18 19:45:56 2018 (r338020) +++ head/usr.bin/kdump/kdump.c Sat Aug 18 20:23:53 2018 (r338021) @@ -125,8 +125,9 @@ void usage(void); #define TIMESTAMP_ELAPSED 0x2 #define TIMESTAMP_RELATIVE 0x4 -static int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, - resolv = 0, abiflag = 0, syscallno = 0; +static bool abiflag, decimal, fancy = true, resolv, suppressdata, syscallno, + tail, threads; +static int timestamp, maxdata; static const char *tracefile = DEF_TRACEFILE; static struct ktr_header ktr_header; @@ -363,40 +364,40 @@ main(int argc, char *argv[]) while ((ch = getopt(argc,argv,"f:dElm:np:AHRrSsTt:")) != -1) switch (ch) { case 'A': - abiflag = 1; + abiflag = true; break; case 'f': tracefile = optarg; break; case 'd': - decimal = 1; + decimal = true; break; case 'l': - tail = 1; + tail = true; break; case 'm': maxdata = atoi(optarg); break; case 'n': - fancy = 0; + fancy = false; break; case 'p': pid = atoi(optarg); break; case 'r': - resolv = 1; + resolv = true; break; case 'S': - syscallno = 1; + syscallno = true; break; case 's': - suppressdata = 1; + suppressdata = true; break; case 'E': timestamp |= TIMESTAMP_ELAPSED; break; case 'H': - threads = 1; + threads = true; break; case 'R': timestamp |= TIMESTAMP_RELATIVE; @@ -427,18 +428,18 @@ main(int argc, char *argv[]) caph_cache_tzdata(); #ifdef WITH_CASPER - if (resolv != 0) { + if (resolv) { if (cappwdgrp_setup(&cappwd, &capgrp) < 0) { cappwd = NULL; capgrp = NULL; } } - if (resolv == 0 || (cappwd != NULL && capgrp != NULL)) { + if (!resolv || (cappwd != NULL && capgrp != NULL)) { if (caph_enter() < 0) err(1, "unable to enter capability mode"); } #else - if (resolv == 0) { + if (!resolv) { if (caph_enter() < 0) err(1, "unable to enter capability mode"); } @@ -1835,14 +1836,14 @@ ktrstat(struct stat *statp) printf("struct stat {"); printf("dev=%ju, ino=%ju, ", (uintmax_t)statp->st_dev, (uintmax_t)statp->st_ino); - if (resolv == 0) + if (!resolv) printf("mode=0%jo, ", (uintmax_t)statp->st_mode); else { strmode(statp->st_mode, mode); printf("mode=%s, ", mode); } printf("nlink=%ju, ", (uintmax_t)statp->st_nlink); - if (resolv == 0) { + if (!resolv) { pwd = NULL; } else { #ifdef WITH_CASPER @@ -1856,7 +1857,7 @@ ktrstat(struct stat *statp) printf("uid=%ju, ", (uintmax_t)statp->st_uid); else printf("uid=\"%s\", ", pwd->pw_name); - if (resolv == 0) { + if (!resolv) { grp = NULL; } else { #ifdef WITH_CASPER @@ -1872,7 +1873,7 @@ ktrstat(struct stat *statp) printf("gid=\"%s\", ", grp->gr_name); printf("rdev=%ju, ", (uintmax_t)statp->st_rdev); printf("atime="); - if (resolv == 0) + if (!resolv) printf("%jd", (intmax_t)statp->st_atim.tv_sec); else { tm = localtime(&statp->st_atim.tv_sec); @@ -1884,7 +1885,7 @@ ktrstat(struct stat *statp) else printf(", "); printf("mtime="); - if (resolv == 0) + if (!resolv) printf("%jd", (intmax_t)statp->st_mtim.tv_sec); else { tm = localtime(&statp->st_mtim.tv_sec); @@ -1896,7 +1897,7 @@ ktrstat(struct stat *statp) else printf(", "); printf("ctime="); - if (resolv == 0) + if (!resolv) printf("%jd", (intmax_t)statp->st_ctim.tv_sec); else { tm = localtime(&statp->st_ctim.tv_sec); @@ -1908,7 +1909,7 @@ ktrstat(struct stat *statp) else printf(", "); printf("birthtime="); - if (resolv == 0) + if (!resolv) printf("%jd", (intmax_t)statp->st_birthtim.tv_sec); else { tm = localtime(&statp->st_birthtim.tv_sec); From owner-svn-src-all@freebsd.org Sat Aug 18 20:28: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 3CA3B1074C51; Sat, 18 Aug 2018 20:28:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E705A748B5; Sat, 18 Aug 2018 20:28:26 +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 C7D381C5F4; Sat, 18 Aug 2018 20:28:26 +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 w7IKSQVt096204; Sat, 18 Aug 2018 20:28:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IKSQvt096201; Sat, 18 Aug 2018 20:28:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808182028.w7IKSQvt096201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Aug 2018 20:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338022 - in head/stand/efi/loader: . arch/i386 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/stand/efi/loader: . arch/i386 X-SVN-Commit-Revision: 338022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 20:28:27 -0000 Author: jhb Date: Sat Aug 18 20:28:25 2018 New Revision: 338022 URL: https://svnweb.freebsd.org/changeset/base/338022 Log: Fix casts between 64-bit physical addresses and pointers in EFI. Compiling FreeBSD/i386 with modern GCC triggers warnings for various places that convert 64-bit EFI_ADDRs to pointers and vice versa. - Cast pointers to uintptr_t rather than to uint64_t when assigning to a 64-bit integer. - Cast 64-bit integers to uintptr_t before a cast to a pointer. Reviewed by: kevans MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16586 Modified: head/stand/efi/loader/arch/i386/efimd.c head/stand/efi/loader/bootinfo.c head/stand/efi/loader/copy.c Modified: head/stand/efi/loader/arch/i386/efimd.c ============================================================================== --- head/stand/efi/loader/arch/i386/efimd.c Sat Aug 18 20:23:53 2018 (r338021) +++ head/stand/efi/loader/arch/i386/efimd.c Sat Aug 18 20:28:25 2018 (r338022) @@ -70,14 +70,14 @@ ldr_bootinfo(struct bootinfo *bi, uint64_t *bi_addr) UINTN mmsz, pages, sz; UINT32 mmver; - bi->bi_systab = (uint64_t)ST; - bi->bi_hcdp = (uint64_t)efi_get_table(&hcdp_guid); + bi->bi_systab = (uintptr_t)ST; + bi->bi_hcdp = (uintptr_t)efi_get_table(&hcdp_guid); sz = sizeof(EFI_HANDLE); status = BS->LocateHandle(ByProtocol, &fpswa_guid, 0, &sz, &handle); if (status == 0) status = BS->HandleProtocol(handle, &fpswa_guid, &fpswa); - bi->bi_fpswa = (status == 0) ? (uint64_t)fpswa : 0; + bi->bi_fpswa = (status == 0) ? (uintptr_t)fpswa : 0; bisz = (sizeof(struct bootinfo) + 0x0f) & ~0x0f; @@ -109,7 +109,7 @@ ldr_bootinfo(struct bootinfo *bi, uint64_t *bi_addr) * aligned). */ *bi_addr = addr; - mm = (void *)(addr + bisz); + mm = (void *)(uintptr_t)(addr + bisz); sz = (EFI_PAGE_SIZE * pages) - bisz; status = BS->GetMemoryMap(&sz, mm, &mapkey, &mmsz, &mmver); if (EFI_ERROR(status)) { @@ -117,12 +117,12 @@ ldr_bootinfo(struct bootinfo *bi, uint64_t *bi_addr) (long)status); return (EINVAL); } - bi->bi_memmap = (uint64_t)mm; + bi->bi_memmap = (uintptr_t)mm; bi->bi_memmap_size = sz; bi->bi_memdesc_size = mmsz; bi->bi_memdesc_version = mmver; - bcopy(bi, (void *)(*bi_addr), sizeof(*bi)); + bcopy(bi, (void *)(uintptr_t)(*bi_addr), sizeof(*bi)); return (0); } Modified: head/stand/efi/loader/bootinfo.c ============================================================================== --- head/stand/efi/loader/bootinfo.c Sat Aug 18 20:23:53 2018 (r338021) +++ head/stand/efi/loader/bootinfo.c Sat Aug 18 20:28:25 2018 (r338022) @@ -363,7 +363,7 @@ bi_load_efi_data(struct preloaded_file *kfp) * memory map on a 16-byte boundary (the bootinfo block is page * aligned). */ - efihdr = (struct efi_map_header *)addr; + efihdr = (struct efi_map_header *)(uintptr_t)addr; mm = (void *)((uint8_t *)efihdr + efisz); sz = (EFI_PAGE_SIZE * pages) - efisz; Modified: head/stand/efi/loader/copy.c ============================================================================== --- head/stand/efi/loader/copy.c Sat Aug 18 20:23:53 2018 (r338021) +++ head/stand/efi/loader/copy.c Sat Aug 18 20:28:25 2018 (r338022) @@ -278,9 +278,9 @@ efi_copy_finish(void) { uint64_t *src, *dst, *last; - src = (uint64_t *)staging; - dst = (uint64_t *)(staging - stage_offset); - last = (uint64_t *)staging_end; + src = (uint64_t *)(uintptr_t)staging; + dst = (uint64_t *)(uintptr_t)(staging - stage_offset); + last = (uint64_t *)(uintptr_t)staging_end; while (src < last) *dst++ = *src++; From owner-svn-src-all@freebsd.org Sat Aug 18 20:32: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 CF1991075263; Sat, 18 Aug 2018 20:32: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8571174D57; Sat, 18 Aug 2018 20:32: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 669FF1C769; Sat, 18 Aug 2018 20:32: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 w7IKWAnA001379; Sat, 18 Aug 2018 20:32:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IKW8b0001372; Sat, 18 Aug 2018 20:32:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808182032.w7IKW8b0001372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Aug 2018 20:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338023 - in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf X-SVN-Commit-Revision: 338023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 20:32:11 -0000 Author: jhb Date: Sat Aug 18 20:32:08 2018 New Revision: 338023 URL: https://svnweb.freebsd.org/changeset/base/338023 Log: Make 'device crypto' lines more consistent. - In configurations with a pseudo devices section, move 'device crypto' into that section. - Use a consistent comment. Note that other things common in kernel configs such as GELI also require 'device crypto', not just IPSEC. Reviewed by: rgrimes, cem, imp Differential Revision: https://reviews.freebsd.org/D16775 Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/std.armv6 head/sys/arm/conf/std.armv7 head/sys/arm64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/riscv/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sat Aug 18 20:28:25 2018 (r338022) +++ head/sys/amd64/conf/GENERIC Sat Aug 18 20:32:08 2018 (r338023) @@ -314,6 +314,7 @@ device wi # WaveLAN/Intersil/Symbol 802.11 wireless device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. +device crypto # core crypto support device loop # Network loopback device random # Entropy device device padlock_rng # VIA Padlock RNG @@ -376,6 +377,3 @@ device vmx # VMware VMXNET3 Ethernet # Netmap provides direct access to TX/RX rings on supported NICs device netmap # netmap(4) support - -# The crypto framework is required by IPSEC -device crypto # Required by IPSEC Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Sat Aug 18 20:28:25 2018 (r338022) +++ head/sys/arm/conf/std.armv6 Sat Aug 18 20:32:08 2018 (r338023) @@ -9,7 +9,7 @@ options VIMAGE # Subsystem virtualization, e.g. VNE options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP -device crypto # IPSec && !crypto is nonsensical +device crypto # core crypto support options IPSEC # IP (v4/v6) security options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem Modified: head/sys/arm/conf/std.armv7 ============================================================================== --- head/sys/arm/conf/std.armv7 Sat Aug 18 20:28:25 2018 (r338022) +++ head/sys/arm/conf/std.armv7 Sat Aug 18 20:32:08 2018 (r338023) @@ -9,7 +9,7 @@ options VIMAGE # Subsystem virtualization, e.g. VNE options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP -device crypto # IPSec && !crypto is nonsensical +device crypto # core crypto support options IPSEC # IP (v4/v6) security options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Aug 18 20:28:25 2018 (r338022) +++ head/sys/arm64/conf/GENERIC Sat Aug 18 20:32:08 2018 (r338023) @@ -237,6 +237,7 @@ device kbdmux device vt_efifb # Pseudo devices. +device crypto # core crypto support device loop # Network loopback device random # Entropy device device ether # Ethernet support @@ -266,6 +267,3 @@ options THUNDERX_PASS_1_1_ERRATA options FDT device acpi - -# The crypto framework is required by IPSEC -device crypto # Required by IPSEC Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sat Aug 18 20:28:25 2018 (r338022) +++ head/sys/i386/conf/GENERIC Sat Aug 18 20:32:08 2018 (r338023) @@ -318,6 +318,7 @@ device wi # WaveLAN/Intersil/Symbol 802.11 wireless device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. +device crypto # core crypto support device loop # Network loopback device random # Entropy device device padlock_rng # VIA Padlock RNG @@ -377,6 +378,3 @@ device xenpci # Xen HVM Hypervisor services driver # VMware support device vmx # VMware VMXNET3 Ethernet - -# The crypto framework is required by IPSEC -device crypto # Required by IPSEC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sat Aug 18 20:28:25 2018 (r338022) +++ head/sys/powerpc/conf/GENERIC Sat Aug 18 20:32:08 2018 (r338023) @@ -160,6 +160,7 @@ device dc # DEC/Intel 21143 and various workalikes device fxp # Intel EtherExpress PRO/100B (82557, 82558) # Pseudo devices. +device crypto # core crypto support device loop # Network loopback device random # Entropy device device ether # Ethernet support @@ -225,6 +226,3 @@ device sound # Generic sound driver (required) device snd_ai2s # Apple I2S audio device snd_davbus # Apple DAVBUS audio device snd_uaudio # USB Audio - -# The crypto framework is required by IPSEC -device crypto # Required by IPSEC Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Sat Aug 18 20:28:25 2018 (r338022) +++ head/sys/riscv/conf/GENERIC Sat Aug 18 20:32:08 2018 (r338023) @@ -36,7 +36,6 @@ options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 -device crypto # core crypto support (required for IPSEC) options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem @@ -121,6 +120,7 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) options ZSTDIO # zstd-compressed kernel and user dumps # Pseudo devices. +device crypto # core crypto support device loop # Network loopback device random # Entropy device device ether # Ethernet support Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sat Aug 18 20:28:25 2018 (r338022) +++ head/sys/sparc64/conf/GENERIC Sat Aug 18 20:32:08 2018 (r338023) @@ -229,6 +229,7 @@ options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descr device ath_rate_sample # SampleRate tx rate control for ath # Pseudo devices. +device crypto # core crypto support device loop # Network loopback device random # Entropy device device ether # Ethernet support @@ -257,6 +258,3 @@ device sound # Generic sound driver (required) device snd_audiocs # Crystal Semiconductor CS4231 device snd_es137x # Ensoniq AudioPCI ES137x device snd_t4dwave # Acer Labs M5451 - -# The crypto framework is required by IPSEC -device crypto # Required by IPSEC From owner-svn-src-all@freebsd.org Sat Aug 18 20:35:20 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 93511107542B; Sat, 18 Aug 2018 20:35:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48E7B75065; Sat, 18 Aug 2018 20:35:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29A451C790; Sat, 18 Aug 2018 20:35:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IKZKX5001587; Sat, 18 Aug 2018 20:35:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IKZJTT001585; Sat, 18 Aug 2018 20:35:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808182035.w7IKZJTT001585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Aug 2018 20:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338024 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 338024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 20:35:20 -0000 Author: kib Date: Sat Aug 18 20:35:19 2018 New Revision: 338024 URL: https://svnweb.freebsd.org/changeset/base/338024 Log: Rudimentary AER reading code for ddb(4). This is very primitive code to inspect the PCI error state and AER error state, dump the log and clear errors, from ddb. pci_print_faulted_dev() is made external to allow calling it from other places. It was called from NMI handler but this chunk is not included. Also there is a tunable-controlled code to clear AER on device attach, disabled by default. All this code was useful to me when I debugged ACPI_DMAR failures (not faults) long time ago. Reviewed by: cem, imp (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7813 Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pcivar.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sat Aug 18 20:32:08 2018 (r338023) +++ head/sys/dev/pci/pci.c Sat Aug 18 20:35:19 2018 (r338024) @@ -399,6 +399,11 @@ static int pci_enable_ari = 1; SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, 0, "Enable support for PCIe Alternative RID Interpretation"); +static int pci_clear_aer_on_attach = 0; +SYSCTL_INT(_hw_pci, OID_AUTO, clear_aer_on_attach, CTLFLAG_RWTUN, + &pci_clear_aer_on_attach, 0, + "Clear port and device AER state on driver attach"); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -4204,17 +4209,98 @@ pci_create_iov_child_method(device_t bus, device_t pf, } #endif +static void +pci_add_child_clear_aer(device_t dev, struct pci_devinfo *dinfo) +{ + int aer; + uint32_t r; + uint16_t r2; + + if (dinfo->cfg.pcie.pcie_location != 0 && + dinfo->cfg.pcie.pcie_type == PCIEM_TYPE_ROOT_PORT) { + r2 = pci_read_config(dev, dinfo->cfg.pcie.pcie_location + + PCIER_ROOT_CTL, 2); + r2 &= ~(PCIEM_ROOT_CTL_SERR_CORR | + PCIEM_ROOT_CTL_SERR_NONFATAL | PCIEM_ROOT_CTL_SERR_FATAL); + pci_write_config(dev, dinfo->cfg.pcie.pcie_location + + PCIER_ROOT_CTL, r2, 2); + } + if (pci_find_extcap(dev, PCIZ_AER, &aer) == 0) { + r = pci_read_config(dev, aer + PCIR_AER_UC_STATUS, 4); + pci_write_config(dev, aer + PCIR_AER_UC_STATUS, r, 4); + if (r != 0 && bootverbose) { + pci_printf(&dinfo->cfg, + "clearing AER UC 0x%08x -> 0x%08x\n", + r, pci_read_config(dev, aer + PCIR_AER_UC_STATUS, + 4)); + } + + r = pci_read_config(dev, aer + PCIR_AER_UC_MASK, 4); + r &= ~(PCIM_AER_UC_TRAINING_ERROR | + PCIM_AER_UC_DL_PROTOCOL_ERROR | + PCIM_AER_UC_SURPRISE_LINK_DOWN | + PCIM_AER_UC_POISONED_TLP | + PCIM_AER_UC_FC_PROTOCOL_ERROR | + PCIM_AER_UC_COMPLETION_TIMEOUT | + PCIM_AER_UC_COMPLETER_ABORT | + PCIM_AER_UC_UNEXPECTED_COMPLETION | + PCIM_AER_UC_RECEIVER_OVERFLOW | + PCIM_AER_UC_MALFORMED_TLP | + PCIM_AER_UC_ECRC_ERROR | + PCIM_AER_UC_UNSUPPORTED_REQUEST | + PCIM_AER_UC_ACS_VIOLATION | + PCIM_AER_UC_INTERNAL_ERROR | + PCIM_AER_UC_MC_BLOCKED_TLP | + PCIM_AER_UC_ATOMIC_EGRESS_BLK | + PCIM_AER_UC_TLP_PREFIX_BLOCKED); + pci_write_config(dev, aer + PCIR_AER_UC_MASK, r, 4); + + r = pci_read_config(dev, aer + PCIR_AER_COR_STATUS, 4); + pci_write_config(dev, aer + PCIR_AER_COR_STATUS, r, 4); + if (r != 0 && bootverbose) { + pci_printf(&dinfo->cfg, + "clearing AER COR 0x%08x -> 0x%08x\n", + r, pci_read_config(dev, aer + PCIR_AER_COR_STATUS, + 4)); + } + + r = pci_read_config(dev, aer + PCIR_AER_COR_MASK, 4); + r &= ~(PCIM_AER_COR_RECEIVER_ERROR | + PCIM_AER_COR_BAD_TLP | + PCIM_AER_COR_BAD_DLLP | + PCIM_AER_COR_REPLAY_ROLLOVER | + PCIM_AER_COR_REPLAY_TIMEOUT | + PCIM_AER_COR_ADVISORY_NF_ERROR | + PCIM_AER_COR_INTERNAL_ERROR | + PCIM_AER_COR_HEADER_LOG_OVFLOW); + pci_write_config(dev, aer + PCIR_AER_COR_MASK, r, 4); + + r = pci_read_config(dev, dinfo->cfg.pcie.pcie_location + + PCIER_DEVICE_CTL, 2); + r |= PCIEM_CTL_COR_ENABLE | PCIEM_CTL_NFER_ENABLE | + PCIEM_CTL_FER_ENABLE | PCIEM_CTL_URR_ENABLE; + pci_write_config(dev, dinfo->cfg.pcie.pcie_location + + PCIER_DEVICE_CTL, r, 2); + } +} + void pci_add_child(device_t bus, struct pci_devinfo *dinfo) { - dinfo->cfg.dev = device_add_child(bus, NULL, -1); - device_set_ivars(dinfo->cfg.dev, dinfo); + device_t dev; + + dinfo->cfg.dev = dev = device_add_child(bus, NULL, -1); + device_set_ivars(dev, dinfo); resource_list_init(&dinfo->resources); - pci_cfg_save(dinfo->cfg.dev, dinfo, 0); - pci_cfg_restore(dinfo->cfg.dev, dinfo); + pci_cfg_save(dev, dinfo, 0); + pci_cfg_restore(dev, dinfo); pci_print_verbose(dinfo); - pci_add_resources(bus, dinfo->cfg.dev, 0, 0); + pci_add_resources(bus, dev, 0, 0); pci_child_added(dinfo->cfg.dev); + + if (pci_clear_aer_on_attach) + pci_add_child_clear_aer(dev, dinfo); + EVENTHANDLER_INVOKE(pci_add_device, dinfo->cfg.dev); } @@ -6280,3 +6366,128 @@ pci_match_device(device_t child, const struct pci_devi } return (NULL); } + +static void +pci_print_faulted_dev_name(const struct pci_devinfo *dinfo) +{ + const char *dev_name; + device_t dev; + + dev = dinfo->cfg.dev; + printf("pci%d:%d:%d:%d", dinfo->cfg.domain, dinfo->cfg.bus, + dinfo->cfg.slot, dinfo->cfg.func); + dev_name = device_get_name(dev); + if (dev_name != NULL) + printf(" (%s%d)", dev_name, device_get_unit(dev)); +} + +void +pci_print_faulted_dev(void) +{ + struct pci_devinfo *dinfo; + device_t dev; + int aer, i; + uint32_t r1, r2; + uint16_t status; + + STAILQ_FOREACH(dinfo, &pci_devq, pci_links) { + dev = dinfo->cfg.dev; + status = pci_read_config(dev, PCIR_STATUS, 2); + status &= PCIM_STATUS_MDPERR | PCIM_STATUS_STABORT | + PCIM_STATUS_RTABORT | PCIM_STATUS_RMABORT | + PCIM_STATUS_SERR | PCIM_STATUS_PERR; + if (status != 0) { + pci_print_faulted_dev_name(dinfo); + printf(" error 0x%04x\n", status); + } + if (dinfo->cfg.pcie.pcie_location != 0) { + status = pci_read_config(dev, + dinfo->cfg.pcie.pcie_location + + PCIER_DEVICE_STA, 2); + if ((status & (PCIEM_STA_CORRECTABLE_ERROR | + PCIEM_STA_NON_FATAL_ERROR | PCIEM_STA_FATAL_ERROR | + PCIEM_STA_UNSUPPORTED_REQ)) != 0) { + pci_print_faulted_dev_name(dinfo); + printf(" PCIe DEVCTL 0x%04x DEVSTA 0x%04x\n", + pci_read_config(dev, + dinfo->cfg.pcie.pcie_location + + PCIER_DEVICE_CTL, 2), + status); + } + } + if (pci_find_extcap(dev, PCIZ_AER, &aer) == 0) { + r1 = pci_read_config(dev, aer + PCIR_AER_UC_STATUS, 4); + r2 = pci_read_config(dev, aer + PCIR_AER_COR_STATUS, 4); + if (r1 != 0 || r2 != 0) { + pci_print_faulted_dev_name(dinfo); + printf(" AER UC 0x%08x Mask 0x%08x Svr 0x%08x\n" + " COR 0x%08x Mask 0x%08x Ctl 0x%08x\n", + r1, pci_read_config(dev, aer + + PCIR_AER_UC_MASK, 4), + pci_read_config(dev, aer + + PCIR_AER_UC_SEVERITY, 4), + r2, pci_read_config(dev, aer + + PCIR_AER_COR_MASK, 4), + pci_read_config(dev, aer + + PCIR_AER_CAP_CONTROL, 4)); + for (i = 0; i < 4; i++) { + r1 = pci_read_config(dev, aer + + PCIR_AER_HEADER_LOG + i * 4, 4); + printf(" HL%d: 0x%08x\n", i, r1); + } + } + } + } +} + +#ifdef DDB +DB_SHOW_COMMAND(pcierr, pci_print_faulted_dev_db) +{ + + pci_print_faulted_dev(); +} + +static void +db_clear_pcie_errors(const struct pci_devinfo *dinfo) +{ + device_t dev; + int aer; + uint32_t r; + + dev = dinfo->cfg.dev; + r = pci_read_config(dev, dinfo->cfg.pcie.pcie_location + + PCIER_DEVICE_STA, 2); + pci_write_config(dev, dinfo->cfg.pcie.pcie_location + + PCIER_DEVICE_STA, r, 2); + + if (pci_find_extcap(dev, PCIZ_AER, &aer) != 0) + return; + r = pci_read_config(dev, aer + PCIR_AER_UC_STATUS, 4); + if (r != 0) + pci_write_config(dev, aer + PCIR_AER_UC_STATUS, r, 4); + r = pci_read_config(dev, aer + PCIR_AER_COR_STATUS, 4); + if (r != 0) + pci_write_config(dev, aer + PCIR_AER_COR_STATUS, r, 4); +} + +DB_COMMAND(pci_clearerr, db_pci_clearerr) +{ + struct pci_devinfo *dinfo; + device_t dev; + uint16_t status, status1; + + STAILQ_FOREACH(dinfo, &pci_devq, pci_links) { + dev = dinfo->cfg.dev; + status1 = status = pci_read_config(dev, PCIR_STATUS, 2); + status1 &= PCIM_STATUS_MDPERR | PCIM_STATUS_STABORT | + PCIM_STATUS_RTABORT | PCIM_STATUS_RMABORT | + PCIM_STATUS_SERR | PCIM_STATUS_PERR; + if (status1 != 0) { + status &= ~status1; + pci_write_config(dev, PCIR_STATUS, status, 2); + } + if (dinfo->cfg.pcie.pcie_location != 0) + db_clear_pcie_errors(dinfo); + } +} +#endif Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Sat Aug 18 20:32:08 2018 (r338023) +++ head/sys/dev/pci/pcivar.h Sat Aug 18 20:35:19 2018 (r338024) @@ -682,6 +682,8 @@ bool pcie_flr(device_t dev, u_int max_delay, bool forc int pcie_get_max_completion_timeout(device_t dev); bool pcie_wait_for_pending_transactions(device_t dev, u_int max_delay); +void pci_print_faulted_dev(void); + #ifdef BUS_SPACE_MAXADDR #if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) #define PCI_DMA_BOUNDARY 0x100000000 From owner-svn-src-all@freebsd.org Sat Aug 18 20:41:45 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 120A01075769; Sat, 18 Aug 2018 20:41:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94305759CD; Sat, 18 Aug 2018 20:41:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63C4D1C804; Sat, 18 Aug 2018 20:41:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IKfih1007279; Sat, 18 Aug 2018 20:41:44 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IKfivO007278; Sat, 18 Aug 2018 20:41:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808182041.w7IKfivO007278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 18 Aug 2018 20:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338025 - head/sys/dev/bge X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/dev/bge X-SVN-Commit-Revision: 338025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 20:41:45 -0000 Author: dim Date: Sat Aug 18 20:41:43 2018 New Revision: 338025 URL: https://svnweb.freebsd.org/changeset/base/338025 Log: Use the size of one bge_devs element for the MODULE_PNP_INFO macro, instead of the size of the whole bge_devs array. This should stop kldxref searching beyond the end of .rodata when it processes relocations, and emitting "unhandled relocation type" errors, at least on i386. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sat Aug 18 20:35:19 2018 (r338024) +++ head/sys/dev/bge/if_bge.c Sat Aug 18 20:41:43 2018 (r338025) @@ -548,7 +548,7 @@ static devclass_t bge_devclass; DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device", pci, bge, bge_devs, - sizeof(bge_devs), nitems(bge_devs) - 1); + sizeof(bge_devs[0]), nitems(bge_devs) - 1); DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0); static int bge_allow_asf = 1; From owner-svn-src-all@freebsd.org Sat Aug 18 20:55:22 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 285A0107618D; Sat, 18 Aug 2018 20:55:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD11A77512; Sat, 18 Aug 2018 20:55:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2DFF1CAFC; Sat, 18 Aug 2018 20:55:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IKtL1C015492; Sat, 18 Aug 2018 20:55:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IKtL8e015490; Sat, 18 Aug 2018 20:55:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808182055.w7IKtL8e015490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 18 Aug 2018 20:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338027 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 338027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 20:55:22 -0000 Author: kevans Date: Sat Aug 18 20:55:20 2018 New Revision: 338027 URL: https://svnweb.freebsd.org/changeset/base/338027 Log: ls(1): Support other aliases for --color arguments used by GNU ls(1) These aliases are supported and documented in the man page. For now, they will not be mentioned in the error when an invalid argument is encountered, instead keeping that list to the shorter 'preferred' names of each argument. Reported by: rgrimes Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Sat Aug 18 20:43:53 2018 (r338026) +++ head/bin/ls/ls.1 Sat Aug 18 20:55:20 2018 (r338027) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd August 16, 2018 +.Dd August 18, 2018 .Dt LS 1 .Os .Sh NAME @@ -252,6 +252,26 @@ environment variable is set and not empty. .Pp .Cm never will disable color regardless of environment variables. +.Pp +For compatibility with GNU coreutils, +.Nm +supports +.Cm yes +or +.Cm force +as equivalent to +.Cm always , +.Cm no +or +.Cm none +as equivalent to +.Cm never , +and +.Cm tty +or +.Cm if-tty +as equivalent to +.Cm auto . .It Fl d Directories are listed as plain files (not searched recursively). .It Fl f Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Sat Aug 18 20:43:53 2018 (r338026) +++ head/bin/ls/ls.c Sat Aug 18 20:55:20 2018 (r338027) @@ -200,6 +200,30 @@ do_color(void) return (do_color_from_env()); } +static bool +do_color_always(const char *term) +{ + + return (strcmp(term, "always") == 0 || strcmp(term, "yes") == 0 || + strcmp(term, "force") == 0); +} + +static bool +do_color_never(const char *term) +{ + + return (strcmp(term, "never") == 0 || strcmp(term, "no") == 0 || + strcmp(term, "none") == 0); +} + +static bool +do_color_auto(const char *term) +{ + + return (strcmp(term, "auto") == 0 || strcmp(term, "tty") == 0 || + strcmp(term, "if-tty") == 0); +} + int main(int argc, char *argv[]) { @@ -406,11 +430,11 @@ main(int argc, char *argv[]) break; #ifdef COLORLS case COLOR_OPT: - if (optarg == NULL || strcmp(optarg, "always") == 0) + if (optarg == NULL || do_color_always(optarg)) colorflag = COLORFLAG_ALWAYS; - else if (strcmp(optarg, "auto") == 0) + else if (do_color_auto(optarg)) colorflag = COLORFLAG_AUTO; - else if (strcmp(optarg, "never") == 0) + else if (do_color_never(optarg)) colorflag = COLORFLAG_NEVER; else errx(2, "unsupported --color value '%s' (must be always, auto, or never)", From owner-svn-src-all@freebsd.org Sat Aug 18 21:03:20 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 2508B1076403; Sat, 18 Aug 2018 21:03:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0E787794B; Sat, 18 Aug 2018 21:03:19 +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 9C88D1CC99; Sat, 18 Aug 2018 21:03:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IL3JF9020717; Sat, 18 Aug 2018 21:03:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IL3JYZ020716; Sat, 18 Aug 2018 21:03:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808182103.w7IL3JYZ020716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 18 Aug 2018 21:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338028 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 338028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 21:03:20 -0000 Author: kevans Date: Sat Aug 18 21:03:19 2018 New Revision: 338028 URL: https://svnweb.freebsd.org/changeset/base/338028 Log: ls(1): Gate the do_color_* definitions behind COLORLS Pointy hat to: me Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Sat Aug 18 20:55:20 2018 (r338027) +++ head/bin/ls/ls.c Sat Aug 18 21:03:19 2018 (r338028) @@ -200,6 +200,7 @@ do_color(void) return (do_color_from_env()); } +#ifdef COLORLS static bool do_color_always(const char *term) { @@ -223,6 +224,7 @@ do_color_auto(const char *term) return (strcmp(term, "auto") == 0 || strcmp(term, "tty") == 0 || strcmp(term, "if-tty") == 0); } +#endif /* COLORLS */ int main(int argc, char *argv[]) From owner-svn-src-all@freebsd.org Sat Aug 18 21:21:09 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 7E9D31076756; Sat, 18 Aug 2018 21:21:09 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 344F777EE2; Sat, 18 Aug 2018 21:21:09 +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 155001CE70; Sat, 18 Aug 2018 21:21:09 +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 w7ILL9Q5026905; Sat, 18 Aug 2018 21:21:09 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ILL7NU026895; Sat, 18 Aug 2018 21:21:07 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201808182121.w7ILL7NU026895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 18 Aug 2018 21:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338029 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 338029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 21:21:09 -0000 Author: mckusick Date: Sat Aug 18 21:21:06 2018 New Revision: 338029 URL: https://svnweb.freebsd.org/changeset/base/338029 Log: Revert -r337396. It is being replaced with a revised interface that resulted from testing and further reviews. Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/softdep.h head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sat Aug 18 21:03:19 2018 (r338028) +++ head/sys/ufs/ffs/ffs_alloc.c Sat Aug 18 21:21:06 2018 (r338029) @@ -110,6 +110,8 @@ static ufs2_daddr_t static void ffs_blkfree_cg(struct ufsmount *, struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, struct workhead *); +static void ffs_blkfree_trim_completed(struct buf *); +static void ffs_blkfree_trim_task(void *ctx, int pending __unused); #ifdef INVARIANTS static int ffs_checkblk(struct inode *, ufs2_daddr_t, long); #endif @@ -393,23 +395,8 @@ retry: if (bno > 0) { bp->b_blkno = fsbtodb(fs, bno); if (!DOINGSOFTDEP(vp)) - /* - * The usual case is that a smaller fragment that - * was just allocated has been replaced with a bigger - * fragment or a full-size block. If it is marked as - * B_DELWRI, the current contents have not been written - * to disk. It is possible that the block was written - * earlier, but very uncommon. If the block has never - * been written, there is no need to send a BIO_DELETE - * for it when it is freed. The gain from avoiding the - * TRIMs for the common case of unwritten blocks far - * exceeds the cost of the write amplification for the - * uncommon case of failing to send a TRIM for a block - * that had been written. - */ ffs_blkfree(ump, fs, ump->um_devvp, bprev, (long)osize, - ip->i_number, vp->v_type, NULL, - (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); + ip->i_number, vp->v_type, NULL); delta = btodb(nsize - osize); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); if (flags & IO_EXT) @@ -534,7 +521,7 @@ ffs_reallocblks_ufs1(ap) struct fs *fs; struct inode *ip; struct vnode *vp; - struct buf *sbp, *ebp, *bp; + struct buf *sbp, *ebp; ufs1_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; @@ -743,29 +730,14 @@ ffs_reallocblks_ufs1(ap) printf("\n\tnew:"); #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { - bp = buflist->bs_children[i]; if (!DOINGSOFTDEP(vp)) - /* - * The usual case is that a set of N-contiguous blocks - * that was just allocated has been replaced with a - * set of N+1-contiguous blocks. If they are marked as - * B_DELWRI, the current contents have not been written - * to disk. It is possible that the blocks were written - * earlier, but very uncommon. If the blocks have never - * been written, there is no need to send a BIO_DELETE - * for them when they are freed. The gain from avoiding - * the TRIMs for the common case of unwritten blocks - * far exceeds the cost of the write amplification for - * the uncommon case of failing to send a TRIM for the - * blocks that had been written. - */ ffs_blkfree(ump, fs, ump->um_devvp, - dbtofsb(fs, bp->b_blkno), - fs->fs_bsize, ip->i_number, vp->v_type, NULL, - (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); - bp->b_blkno = fsbtodb(fs, blkno); + dbtofsb(fs, buflist->bs_children[i]->b_blkno), + fs->fs_bsize, ip->i_number, vp->v_type, NULL); + buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS - if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) + if (!ffs_checkblk(ip, + dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif #ifdef DEBUG @@ -799,7 +771,7 @@ ffs_reallocblks_ufs2(ap) struct fs *fs; struct inode *ip; struct vnode *vp; - struct buf *sbp, *ebp, *bp; + struct buf *sbp, *ebp; ufs2_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; @@ -1006,29 +978,14 @@ ffs_reallocblks_ufs2(ap) printf("\n\tnew:"); #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { - bp = buflist->bs_children[i]; if (!DOINGSOFTDEP(vp)) - /* - * The usual case is that a set of N-contiguous blocks - * that was just allocated has been replaced with a - * set of N+1-contiguous blocks. If they are marked as - * B_DELWRI, the current contents have not been written - * to disk. It is possible that the blocks were written - * earlier, but very uncommon. If the blocks have never - * been written, there is no need to send a BIO_DELETE - * for them when they are freed. The gain from avoiding - * the TRIMs for the common case of unwritten blocks - * far exceeds the cost of the write amplification for - * the uncommon case of failing to send a TRIM for the - * blocks that had been written. - */ ffs_blkfree(ump, fs, ump->um_devvp, - dbtofsb(fs, bp->b_blkno), - fs->fs_bsize, ip->i_number, vp->v_type, NULL, - (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); - bp->b_blkno = fsbtodb(fs, blkno); + dbtofsb(fs, buflist->bs_children[i]->b_blkno), + fs->fs_bsize, ip->i_number, vp->v_type, NULL); + buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS - if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) + if (!ffs_checkblk(ip, + dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif #ifdef DEBUG @@ -1866,7 +1823,8 @@ gotit: /* XXX Fixme. */ UFS_UNLOCK(ump); if (DOINGSOFTDEP(ITOV(ip))) - softdep_setup_blkmapdep(bp, UFSTOVFS(ump), blkno, size, 0); + softdep_setup_blkmapdep(bp, UFSTOVFS(ump), blkno, + size, 0); UFS_LOCK(ump); return (blkno); } @@ -2296,17 +2254,6 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) bdwrite(bp); } -/* - * Structures and routines associated with trim management. - */ -MALLOC_DEFINE(M_TRIM, "ufs_trim", "UFS trim structures"); - -#define TRIMLIST_HASH(ump, inum) \ - (&(ump)->um_trimhash[(inum) & (ump)->um_trimlisthashsize]) - -static void ffs_blkfree_trim_completed(struct buf *); -static void ffs_blkfree_trim_task(void *ctx, int pending __unused); - struct ffs_blkfree_trim_params { struct task task; struct ufsmount *ump; @@ -2330,7 +2277,7 @@ ffs_blkfree_trim_task(ctx, pending) tp->inum, tp->pdephd); vn_finished_secondary_write(UFSTOVFS(tp->ump)); atomic_add_int(&tp->ump->um_trim_inflight, -1); - free(tp, M_TRIM); + free(tp, M_TEMP); } static void @@ -2340,13 +2287,13 @@ ffs_blkfree_trim_completed(bp) struct ffs_blkfree_trim_params *tp; tp = bp->b_fsprivate1; - free(bp, M_TRIM); + free(bp, M_TEMP); TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); taskqueue_enqueue(tp->ump->um_trim_tq, &tp->task); } void -ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd, trimtype) +ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd) struct ufsmount *ump; struct fs *fs; struct vnode *devvp; @@ -2355,7 +2302,6 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de ino_t inum; enum vtype vtype; struct workhead *dephd; - int trimtype; { struct mount *mp; struct buf *bp; @@ -2373,11 +2319,10 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de return; } /* - * Nothing to delay if TRIM is not required for this block or TRIM - * is disabled or the operation is performed on a snapshot. + * Nothing to delay if TRIM is disabled, or the operation is + * performed on the snapshot. */ - if (trimtype == NOTRIM || ((ump->um_flags & UM_CANDELETE) == 0) || - devvp->v_type == VREG) { + if (((ump->um_flags) & UM_CANDELETE) == 0 || devvp->v_type == VREG) { ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd); return; } @@ -2389,7 +2334,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de * and write some new data into it. */ atomic_add_int(&ump->um_trim_inflight, 1); - tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TRIM, M_WAITOK); + tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TEMP, M_WAITOK); tp->ump = ump; tp->devvp = devvp; tp->bno = bno; @@ -2402,7 +2347,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de } else tp->pdephd = NULL; - bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO); + bp = malloc(sizeof(*bp), M_TEMP, M_WAITOK | M_ZERO); bp->b_iocmd = BIO_DELETE; bp->b_iooffset = dbtob(fsbtodb(fs, bno)); bp->b_iodone = ffs_blkfree_trim_completed; @@ -2879,7 +2824,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) long blkcnt, blksize; struct file *fp, *vfp; cap_rights_t rights; - int filetype, trimtype, error; + int filetype, error; static struct fileops *origops, bufferedops; if (req->newlen > sizeof cmd) @@ -3011,17 +2956,14 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) blkno = cmd.value; blkcnt = cmd.size; blksize = fs->fs_frag - (blkno % fs->fs_frag); - trimtype = (blksize < blkcnt) ? STARTFREE : SINGLETON; while (blkcnt > 0) { if (blksize > blkcnt) blksize = blkcnt; ffs_blkfree(ump, fs, ump->um_devvp, blkno, - blksize * fs->fs_fsize, UFS_ROOTINO, - VDIR, NULL, trimtype); + blksize * fs->fs_fsize, UFS_ROOTINO, VDIR, NULL); blkno += blksize; blkcnt -= blksize; blksize = fs->fs_frag; - trimtype = (blksize < blkcnt) ? CONTINUEFREE : ENDFREE; } break; Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Sat Aug 18 21:03:19 2018 (r338028) +++ head/sys/ufs/ffs/ffs_balloc.c Sat Aug 18 21:21:06 2018 (r338029) @@ -553,7 +553,7 @@ fail: lbns_remfree++; #endif ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, - ip->i_number, vp->v_type, NULL, SINGLETON); + ip->i_number, vp->v_type, NULL); } return (error); } @@ -1147,7 +1147,7 @@ fail: lbns_remfree++; #endif ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, - ip->i_number, vp->v_type, NULL, SINGLETON); + ip->i_number, vp->v_type, NULL); } return (error); } Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Sat Aug 18 21:03:19 2018 (r338028) +++ head/sys/ufs/ffs/ffs_extern.h Sat Aug 18 21:21:06 2018 (r338029) @@ -63,7 +63,7 @@ int ffs_balloc_ufs2(struct vnode *a_vp, off_t a_starto struct ucred *a_cred, int a_flags, struct buf **a_bpp); int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **); void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *, - ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *, int); + ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *); ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *); ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); @@ -111,27 +111,10 @@ vfs_vget_t ffs_vget; int ffs_vgetf(struct mount *, ino_t, int, struct vnode **, int); void process_deferred_inactive(struct mount *mp); -/* - * Flags to ffs_vgetf - */ #define FFSV_FORCEINSMQ 0x0001 -/* - * Flags to ffs_reload - */ #define FFSR_FORCE 0x0001 #define FFSR_UNSUSPEND 0x0002 - -/* - * Trim type to ffs_blkfree - used to help with BIO_DELETE (trim) requests - */ -#define NOTRIM 1 /* never written, so don't call trim for it */ -#define SINGLETON 2 /* only block being freed, so trim it now */ -#define STARTFREE 3 /* beginning to free for this inum */ -#define CONTINUEFREE 4 /* additional block free for this inum */ -#define ENDFREE 5 /* last block to free for this inum */ - -#define MAXTRIMIO 1024 /* maximum expected outstanding trim requests */ extern struct vop_vector ffs_vnodeops1; extern struct vop_vector ffs_fifoops1; Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Sat Aug 18 21:03:19 2018 (r338028) +++ head/sys/ufs/ffs/ffs_inode.c Sat Aug 18 21:21:06 2018 (r338029) @@ -195,7 +195,7 @@ ffs_truncate(vp, length, flags, cred) struct ufsmount *ump; int softdeptrunc, journaltrunc; int needextclean, extblocks; - int trimtype, firstfree, offset, size, level, nblocks; + int offset, size, level, nblocks; int i, error, allerror, indiroff, waitforupdate; off_t osize; @@ -275,7 +275,7 @@ ffs_truncate(vp, length, flags, cred) continue; ffs_blkfree(ump, fs, ITODEVVP(ip), oldblks[i], sblksize(fs, osize, i), ip->i_number, - vp->v_type, NULL, SINGLETON); + vp->v_type, NULL); } } } @@ -523,7 +523,7 @@ ffs_truncate(vp, length, flags, cred) DIP_SET(ip, i_ib[level], 0); ffs_blkfree(ump, fs, ump->um_devvp, bn, fs->fs_bsize, ip->i_number, - vp->v_type, NULL, SINGLETON); + vp->v_type, NULL); blocksreleased += nblocks; } } @@ -534,7 +534,6 @@ ffs_truncate(vp, length, flags, cred) /* * All whole direct blocks or frags. */ - firstfree = 1; for (i = UFS_NDADDR - 1; i > lastblock; i--) { long bsize; @@ -543,23 +542,8 @@ ffs_truncate(vp, length, flags, cred) continue; DIP_SET(ip, i_db[i], 0); bsize = blksize(fs, ip, i); - if (firstfree) { - if (i - 1 == lastblock || DIP(ip, i_db[i - 1]) == 0) { - trimtype = SINGLETON; - } else { - trimtype = STARTFREE; - firstfree = 0; - } - } else { - if (i - 1 == lastblock || DIP(ip, i_db[i - 1]) == 0) { - trimtype = ENDFREE; - firstfree = 1; - } else { - trimtype = CONTINUEFREE; - } - } ffs_blkfree(ump, fs, ump->um_devvp, bn, bsize, ip->i_number, - vp->v_type, NULL, trimtype); + vp->v_type, NULL); blocksreleased += btodb(bsize); } if (lastblock < 0) @@ -591,8 +575,7 @@ ffs_truncate(vp, length, flags, cred) */ bn += numfrags(fs, newspace); ffs_blkfree(ump, fs, ump->um_devvp, bn, - oldspace - newspace, ip->i_number, vp->v_type, - NULL, SINGLETON); + oldspace - newspace, ip->i_number, vp->v_type, NULL); blocksreleased += btodb(oldspace - newspace); } } @@ -653,7 +636,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) struct fs *fs; struct vnode *vp; caddr_t copy = NULL; - int i, trimtype, nblocks, firstfree, error = 0, allerror = 0; + int i, nblocks, error = 0, allerror = 0; ufs2_daddr_t nb, nlbn, last; ufs2_daddr_t blkcount, factor, blocksreleased = 0; ufs1_daddr_t *bap1 = NULL; @@ -736,7 +719,6 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) /* * Recursively free totally unused blocks. */ - firstfree = 1; for (i = NINDIR(fs) - 1, nlbn = lbn + 1 - i * factor; i > last; i--, nlbn += factor) { nb = BAP(ip, i); @@ -748,23 +730,8 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) allerror = error; blocksreleased += blkcount; } - if (firstfree) { - if (i - 1 == last || BAP(ip, i - 1) == 0) { - trimtype = SINGLETON; - } else { - trimtype = STARTFREE; - firstfree = 0; - } - } else { - if (i - 1 == last || BAP(ip, i - 1) == 0) { - trimtype = ENDFREE; - firstfree = 1; - } else { - trimtype = CONTINUEFREE; - } - } ffs_blkfree(ITOUMP(ip), fs, ITODEVVP(ip), nb, fs->fs_bsize, - ip->i_number, vp->v_type, NULL, trimtype); + ip->i_number, vp->v_type, NULL); blocksreleased += nblocks; } Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sat Aug 18 21:03:19 2018 (r338028) +++ head/sys/ufs/ffs/ffs_snapshot.c Sat Aug 18 21:21:06 2018 (r338029) @@ -583,7 +583,7 @@ loop: if (len != 0 && len < fs->fs_bsize) { ffs_blkfree(ump, copy_fs, vp, DIP(xp, i_db[loc]), len, xp->i_number, - xvp->v_type, NULL, SINGLETON); + xvp->v_type, NULL); blkno = DIP(xp, i_db[loc]); DIP_SET(xp, i_db[loc], 0); } @@ -1265,7 +1265,7 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expung if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, - vp->v_type, NULL, SINGLETON); + vp->v_type, NULL); } return (0); } @@ -1549,7 +1549,7 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expung if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, - vp->v_type, NULL, SINGLETON); + vp->v_type, NULL); } return (0); } Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Aug 18 21:03:19 2018 (r338028) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Aug 18 21:21:06 2018 (r338029) @@ -869,7 +869,7 @@ static void cancel_allocdirect(struct allocdirectlst * struct allocdirect *, struct freeblks *); static int check_inode_unwritten(struct inodedep *); static int free_inodedep(struct inodedep *); -static void freework_freeblock(struct freework *, int); +static void freework_freeblock(struct freework *); static void freework_enqueue(struct freework *); static int handle_workitem_freeblocks(struct freeblks *, int); static int handle_complete_freeblocks(struct freeblks *, int); @@ -884,7 +884,7 @@ static struct allocindir *newallocindir(struct inode * ufs2_daddr_t, ufs_lbn_t); static void handle_workitem_freefrag(struct freefrag *); static struct freefrag *newfreefrag(struct inode *, ufs2_daddr_t, long, - ufs_lbn_t, int); + ufs_lbn_t); static void allocdirect_merge(struct allocdirectlst *, struct allocdirect *, struct allocdirect *); static struct freefrag *allocindir_merge(struct allocindir *, @@ -5289,22 +5289,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, KASSERT(MOUNTEDSOFTDEP(mp) != 0, ("softdep_setup_allocdirect called on non-softdep filesystem")); if (oldblkno && oldblkno != newblkno) - /* - * The usual case is that a smaller fragment that - * was just allocated has been replaced with a bigger - * fragment or a full-size block. If it is marked as - * B_DELWRI, the current contents have not been written - * to disk. It is possible that the block was written - * earlier, but very uncommon. If the block has never - * been written, there is no need to send a BIO_DELETE - * for it when it is freed. The gain from avoiding the - * TRIMs for the common case of unwritten blocks far - * exceeds the cost of the write amplification for the - * uncommon case of failing to send a TRIM for a block - * that had been written. - */ - freefrag = newfreefrag(ip, oldblkno, oldsize, lbn, - (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); + freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); else freefrag = NULL; @@ -5581,12 +5566,11 @@ newjfreefrag(freefrag, ip, blkno, size, lbn) * Allocate a new freefrag structure. */ static struct freefrag * -newfreefrag(ip, blkno, size, lbn, trimtype) +newfreefrag(ip, blkno, size, lbn) struct inode *ip; ufs2_daddr_t blkno; long size; ufs_lbn_t lbn; - int trimtype; { struct freefrag *freefrag; struct ufsmount *ump; @@ -5607,7 +5591,6 @@ newfreefrag(ip, blkno, size, lbn, trimtype) freefrag->ff_vtype = ITOV(ip)->v_type; freefrag->ff_blkno = blkno; freefrag->ff_fragsize = size; - freefrag->ff_trimtype = trimtype; if (MOUNTEDSUJ(UFSTOVFS(ump))) { freefrag->ff_jdep = (struct worklist *) @@ -5653,8 +5636,7 @@ handle_workitem_freefrag(freefrag) } FREE_LOCK(ump); ffs_blkfree(ump, ump->um_fs, ump->um_devvp, freefrag->ff_blkno, - freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd, - freefrag->ff_trimtype); + freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd); ACQUIRE_LOCK(ump); WORKITEM_FREE(freefrag, D_FREEFRAG); FREE_LOCK(ump); @@ -5694,22 +5676,7 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, ne lbn = bp->b_lblkno; if (oldblkno && oldblkno != newblkno) - /* - * The usual case is that a smaller fragment that - * was just allocated has been replaced with a bigger - * fragment or a full-size block. If it is marked as - * B_DELWRI, the current contents have not been written - * to disk. It is possible that the block was written - * earlier, but very uncommon. If the block has never - * been written, there is no need to send a BIO_DELETE - * for it when it is freed. The gain from avoiding the - * TRIMs for the common case of unwritten blocks far - * exceeds the cost of the write amplification for the - * uncommon case of failing to send a TRIM for a block - * that had been written. - */ - freefrag = newfreefrag(ip, oldblkno, oldsize, lbn, - (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); + freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); else freefrag = NULL; @@ -5822,8 +5789,7 @@ newallocindir(ip, ptrno, newblkno, oldblkno, lbn) struct jnewblk *jnewblk; if (oldblkno) - freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn, - SINGLETON); + freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn); else freefrag = NULL; ACQUIRE_LOCK(ITOUMP(ip)); @@ -7758,9 +7724,8 @@ free_inodedep(inodedep) * in memory immediately. */ static void -freework_freeblock(freework, trimtype) +freework_freeblock(freework) struct freework *freework; - int trimtype; { struct freeblks *freeblks; struct jnewblk *jnewblk; @@ -7814,10 +7779,10 @@ freework_freeblock(freework, trimtype) FREE_LOCK(ump); freeblks_free(ump, freeblks, btodb(bsize)); CTR4(KTR_SUJ, - "freework_freeblock: ino %jd blkno %jd lbn %jd size %d", + "freework_freeblock: ino %d blkno %jd lbn %jd size %ld", freeblks->fb_inum, freework->fw_blkno, freework->fw_lbn, bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno, bsize, - freeblks->fb_inum, freeblks->fb_vtype, &wkhd, trimtype); + freeblks->fb_inum, freeblks->fb_vtype, &wkhd); ACQUIRE_LOCK(ump); /* * The jnewblk will be discarded and the bits in the map never @@ -7870,7 +7835,7 @@ handle_workitem_indirblk(freework) return; } if (freework->fw_off == NINDIR(fs)) { - freework_freeblock(freework, SINGLETON); + freework_freeblock(freework); return; } freework->fw_state |= INPROGRESS; @@ -7924,19 +7889,16 @@ handle_workitem_freeblocks(freeblks, flags) struct freeblks *freeblks; int flags; { - struct freework *freework, *prevfreework; + struct freework *freework; struct newblk *newblk; struct allocindir *aip; struct ufsmount *ump; struct worklist *wk; - int trimtype; KASSERT(LIST_EMPTY(&freeblks->fb_jblkdephd), ("handle_workitem_freeblocks: Journal entries not written.")); ump = VFSTOUFS(freeblks->fb_list.wk_mp); ACQUIRE_LOCK(ump); - prevfreework = NULL; - trimtype = 0; while ((wk = LIST_FIRST(&freeblks->fb_freeworkhd)) != NULL) { WORKLIST_REMOVE(wk); switch (wk->wk_type) { @@ -7970,26 +7932,16 @@ handle_workitem_freeblocks(freeblks, flags) case D_FREEWORK: freework = WK_FREEWORK(wk); - if (freework->fw_lbn <= -UFS_NDADDR) { + if (freework->fw_lbn <= -UFS_NDADDR) handle_workitem_indirblk(freework); - continue; - } else if (prevfreework == NULL) { - trimtype = SINGLETON; - } else if (trimtype == SINGLETON) { - freework_freeblock(prevfreework, STARTFREE); - trimtype = ENDFREE; - } else { - freework_freeblock(prevfreework, CONTINUEFREE); - } - prevfreework = freework; + else + freework_freeblock(freework); continue; default: panic("handle_workitem_freeblocks: Unknown type %s", TYPENAME(wk->wk_type)); } } - if (prevfreework != NULL) - freework_freeblock(prevfreework, trimtype); if (freeblks->fb_ref != 0) { freeblks->fb_state &= ~INPROGRESS; wake_worklist(&freeblks->fb_list); @@ -8128,8 +8080,13 @@ indir_trunc(freework, dbn, lbn) ufs1_daddr_t *bap1; ufs2_daddr_t nb, nnb, *bap2; ufs_lbn_t lbnadd, nlbn; - int nblocks, ufs1fmt, firstfree, trimtype, freedblocks; - int goingaway, freedeps, needj, level, cnt, i; + int i, nblocks, ufs1fmt; + int freedblocks; + int goingaway; + int freedeps; + int needj; + int level; + int cnt; freeblks = freework->fw_freeblks; ump = VFSTOUFS(freeblks->fb_list.wk_mp); @@ -8223,7 +8180,6 @@ indir_trunc(freework, dbn, lbn) * arranges for the current level to be freed when subordinates * are free when journaling. */ - firstfree = 1; for (i = freework->fw_off; i < NINDIR(fs); i++, nb = nnb) { if (i != NINDIR(fs) - 1) { if (ufs1fmt) @@ -8259,26 +8215,11 @@ indir_trunc(freework, dbn, lbn) freedeps++; } CTR3(KTR_SUJ, - "indir_trunc: ino %jd blkno %jd size %d", + "indir_trunc: ino %d blkno %jd size %ld", freeblks->fb_inum, nb, fs->fs_bsize); - if (firstfree) { - if (i == NINDIR(fs) - 1 || nnb == 0) { - trimtype = SINGLETON; - } else { - trimtype = STARTFREE; - firstfree = 0; - } - } else { - if (i == NINDIR(fs) - 1 || nnb == 0) { - trimtype = ENDFREE; - firstfree = 1; - } else { - trimtype = CONTINUEFREE; - } - } ffs_blkfree(ump, fs, freeblks->fb_devvp, nb, fs->fs_bsize, freeblks->fb_inum, - freeblks->fb_vtype, &wkhd, trimtype); + freeblks->fb_vtype, &wkhd); } } if (goingaway) { @@ -8303,7 +8244,7 @@ indir_trunc(freework, dbn, lbn) if (level == 0) freeblks->fb_cgwait += freedeps; if (freework->fw_ref == 0) - freework_freeblock(freework, SINGLETON); + freework_freeblock(freework); FREE_LOCK(ump); return; } @@ -8312,10 +8253,10 @@ indir_trunc(freework, dbn, lbn) */ dbn = dbtofsb(fs, dbn); CTR3(KTR_SUJ, - "indir_trunc 2: ino %jd blkno %jd size %d", + "indir_trunc 2: ino %d blkno %jd size %ld", freeblks->fb_inum, dbn, fs->fs_bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, dbn, fs->fs_bsize, - freeblks->fb_inum, freeblks->fb_vtype, NULL, SINGLETON); + freeblks->fb_inum, freeblks->fb_vtype, NULL); /* Non SUJ softdep does single-threaded truncations. */ if (freework->fw_blkno == dbn) { freework->fw_state |= ALLCOMPLETE; Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat Aug 18 21:03:19 2018 (r338028) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat Aug 18 21:21:06 2018 (r338029) @@ -978,8 +978,6 @@ ffs_mountfs(devvp, mp, td) taskqueue_thread_enqueue, &ump->um_trim_tq); taskqueue_start_threads(&ump->um_trim_tq, 1, PVFS, "%s trim", mp->mnt_stat.f_mntonname); - ump->um_trimhash = hashinit(MAXTRIMIO, M_TRIM, - &ump->um_trimlisthashsize); } } @@ -1258,7 +1256,6 @@ ffs_unmount(mp, mntflags) pause("ufsutr", hz); taskqueue_drain_all(ump->um_trim_tq); taskqueue_free(ump->um_trim_tq); - free (ump->um_trimhash, M_TRIM); } g_topology_lock(); if (ump->um_fsckpid > 0) { Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Sat Aug 18 21:03:19 2018 (r338028) +++ head/sys/ufs/ffs/softdep.h Sat Aug 18 21:21:06 2018 (r338029) @@ -557,7 +557,6 @@ struct freefrag { long ff_fragsize; /* size of fragment being deleted */ ino_t ff_inum; /* owning inode number */ enum vtype ff_vtype; /* owning inode's file type */ - int ff_trimtype; /* trim status when deleted */ }; /* Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Sat Aug 18 21:03:19 2018 (r338028) +++ head/sys/ufs/ufs/ufsmount.h Sat Aug 18 21:21:06 2018 (r338029) @@ -47,7 +47,6 @@ struct ufs_args { #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_UFSMNT); -MALLOC_DECLARE(M_TRIM); #endif struct buf; @@ -64,7 +63,6 @@ struct inodedep; TAILQ_HEAD(inodedeplst, inodedep); LIST_HEAD(bmsafemaphd, bmsafemap); -LIST_HEAD(trimlist_hashhead, ffs_blkfree_trim_params); /* * This structure describes the UFS specific mount structure data. @@ -103,8 +101,6 @@ struct ufsmount { u_int um_flags; /* (i) filesystem flags */ u_int um_trim_inflight; /* (a) outstanding trim count */ struct taskqueue *um_trim_tq; /* (c) trim request queue */ - struct trimlist_hashhead *um_trimhash; /* (i) trimlist hash table */ - u_long um_trimlisthashsize; /* (i) trim hash table size-1 */ /* (c) - below function ptrs */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); From owner-svn-src-all@freebsd.org Sat Aug 18 22:07: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 8D40910775B7; Sat, 18 Aug 2018 22:07:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 360FE796A1; Sat, 18 Aug 2018 22:07:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A7C31D666; Sat, 18 Aug 2018 22:07:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IM7nJq051093; Sat, 18 Aug 2018 22:07:49 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IM7m3C051088; Sat, 18 Aug 2018 22:07:48 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201808182207.w7IM7m3C051088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 18 Aug 2018 22:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338030 - in head/sys: dev/amd_ecc_inject dev/drm dev/drm2 vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: dev/amd_ecc_inject dev/drm dev/drm2 vm X-SVN-Commit-Revision: 338030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 22:07:50 -0000 Author: alc Date: Sat Aug 18 22:07:48 2018 New Revision: 338030 URL: https://svnweb.freebsd.org/changeset/base/338030 Log: Eliminate the unused arena parameter from kmem_alloc_attr(). Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D16793 Modified: head/sys/dev/amd_ecc_inject/ecc_inject.c head/sys/dev/drm/drm_scatter.c head/sys/dev/drm2/drm_scatter.c head/sys/vm/vm_extern.h head/sys/vm/vm_init.c head/sys/vm/vm_kern.c Modified: head/sys/dev/amd_ecc_inject/ecc_inject.c ============================================================================== --- head/sys/dev/amd_ecc_inject/ecc_inject.c Sat Aug 18 21:21:06 2018 (r338029) +++ head/sys/dev/amd_ecc_inject/ecc_inject.c Sat Aug 18 22:07:48 2018 (r338030) @@ -186,7 +186,7 @@ ecc_ei_inject(int count) KASSERT(bit_mask != 0 && (bit_mask & ~INJ_VECTOR_MASK) == 0, ("bit mask value is outside of range: 0x%x", bit_mask)); - memory = kmem_alloc_attr(kernel_arena, PAGE_SIZE, M_WAITOK, 0, ~0, + memory = kmem_alloc_attr(PAGE_SIZE, M_WAITOK, 0, ~0, VM_MEMATTR_UNCACHEABLE); for (injected = 0; injected < count; injected++) { Modified: head/sys/dev/drm/drm_scatter.c ============================================================================== --- head/sys/dev/drm/drm_scatter.c Sat Aug 18 21:21:06 2018 (r338029) +++ head/sys/dev/drm/drm_scatter.c Sat Aug 18 22:07:48 2018 (r338030) @@ -52,8 +52,8 @@ drm_sg_alloc(struct drm_device *dev, struct drm_scatte entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO); - entry->vaddr = kmem_alloc_attr(kernel_arena, size, M_WAITOK | M_ZERO, - 0, BUS_SPACE_MAXADDR_32BIT, VM_MEMATTR_WRITE_COMBINING); + entry->vaddr = kmem_alloc_attr(size, M_WAITOK | M_ZERO, 0, + BUS_SPACE_MAXADDR_32BIT, VM_MEMATTR_WRITE_COMBINING); if (entry->vaddr == 0) { drm_sg_cleanup(entry); return (ENOMEM); Modified: head/sys/dev/drm2/drm_scatter.c ============================================================================== --- head/sys/dev/drm2/drm_scatter.c Sat Aug 18 21:21:06 2018 (r338029) +++ head/sys/dev/drm2/drm_scatter.c Sat Aug 18 22:07:48 2018 (r338030) @@ -37,8 +37,8 @@ __FBSDID("$FreeBSD$"); static inline vm_offset_t drm_vmalloc_dma(vm_size_t size) { - return kmem_alloc_attr(kernel_arena, size, M_NOWAIT | M_ZERO, - 0, BUS_SPACE_MAXADDR_32BIT, VM_MEMATTR_WRITE_COMBINING); + return kmem_alloc_attr(size, M_NOWAIT | M_ZERO, 0, + BUS_SPACE_MAXADDR_32BIT, VM_MEMATTR_WRITE_COMBINING); } void drm_sg_cleanup(struct drm_sg_mem * entry) Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Sat Aug 18 21:21:06 2018 (r338029) +++ head/sys/vm/vm_extern.h Sat Aug 18 22:07:48 2018 (r338030) @@ -54,7 +54,7 @@ vm_offset_t kmap_alloc_wait(vm_map_t, vm_size_t); void kmap_free_wakeup(vm_map_t, vm_offset_t, vm_size_t); /* These operate on virtual addresses backed by memory. */ -vm_offset_t kmem_alloc_attr(struct vmem *, vm_size_t size, int flags, +vm_offset_t kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); vm_offset_t kmem_alloc_attr_domain(int domain, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Sat Aug 18 21:21:06 2018 (r338029) +++ head/sys/vm/vm_init.c Sat Aug 18 22:07:48 2018 (r338030) @@ -274,9 +274,8 @@ again: * Try to protect 32-bit DMAable memory from the largest * early alloc of wired mem. */ - firstaddr = kmem_alloc_attr(kernel_arena, size, - M_ZERO | M_NOWAIT, (vm_paddr_t)1 << 32, - ~(vm_paddr_t)0, VM_MEMATTR_DEFAULT); + firstaddr = kmem_alloc_attr(size, M_ZERO | M_NOWAIT, + (vm_paddr_t)1 << 32, ~(vm_paddr_t)0, VM_MEMATTR_DEFAULT); if (firstaddr == 0) #endif firstaddr = kmem_malloc(kernel_arena, size, Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Sat Aug 18 21:21:06 2018 (r338029) +++ head/sys/vm/vm_kern.c Sat Aug 18 22:07:48 2018 (r338030) @@ -220,15 +220,12 @@ retry: } vm_offset_t -kmem_alloc_attr(vmem_t *vmem, vm_size_t size, int flags, vm_paddr_t low, - vm_paddr_t high, vm_memattr_t memattr) +kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, + vm_memattr_t memattr) { struct vm_domainset_iter di; vm_offset_t addr; int domain; - - KASSERT(vmem == kernel_arena, - ("kmem_alloc_attr: Only kernel_arena is supported.")); vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); do { From owner-svn-src-all@freebsd.org Sat Aug 18 22:22:02 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 B34001077A30; Sat, 18 Aug 2018 22:22:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7A279DC3; Sat, 18 Aug 2018 22:22:01 +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 406581D87F; Sat, 18 Aug 2018 22:22:01 +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 w7IMM1rg059384; Sat, 18 Aug 2018 22:22:01 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IMLxBV059347; Sat, 18 Aug 2018 22:21:59 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201808182221.w7IMLxBV059347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 18 Aug 2018 22:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338031 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 338031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 22:22:02 -0000 Author: mckusick Date: Sat Aug 18 22:21:59 2018 New Revision: 338031 URL: https://svnweb.freebsd.org/changeset/base/338031 Log: Replace the TRIM consolodation framework originally added in -r337396 driven by problems found with the algorithms being tested for TRIM consolodation. Reported by: Peter Holm Suggested by: kib Reviewed by: kib Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/softdep.h head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sat Aug 18 22:07:48 2018 (r338030) +++ head/sys/ufs/ffs/ffs_alloc.c Sat Aug 18 22:21:59 2018 (r338031) @@ -110,8 +110,6 @@ static ufs2_daddr_t static void ffs_blkfree_cg(struct ufsmount *, struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, struct workhead *); -static void ffs_blkfree_trim_completed(struct buf *); -static void ffs_blkfree_trim_task(void *ctx, int pending __unused); #ifdef INVARIANTS static int ffs_checkblk(struct inode *, ufs2_daddr_t, long); #endif @@ -395,8 +393,24 @@ retry: if (bno > 0) { bp->b_blkno = fsbtodb(fs, bno); if (!DOINGSOFTDEP(vp)) + /* + * The usual case is that a smaller fragment that + * was just allocated has been replaced with a bigger + * fragment or a full-size block. If it is marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the block was written + * earlier, but very uncommon. If the block has never + * been written, there is no need to send a BIO_DELETE + * for it when it is freed. The gain from avoiding the + * TRIMs for the common case of unwritten blocks far + * exceeds the cost of the write amplification for the + * uncommon case of failing to send a TRIM for a block + * that had been written. + */ ffs_blkfree(ump, fs, ump->um_devvp, bprev, (long)osize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, + (bp->b_flags & B_DELWRI) != 0 ? + NOTRIM_KEY : SINGLETON_KEY); delta = btodb(nsize - osize); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); if (flags & IO_EXT) @@ -521,7 +535,7 @@ ffs_reallocblks_ufs1(ap) struct fs *fs; struct inode *ip; struct vnode *vp; - struct buf *sbp, *ebp; + struct buf *sbp, *ebp, *bp; ufs1_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; @@ -730,14 +744,30 @@ ffs_reallocblks_ufs1(ap) printf("\n\tnew:"); #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { + bp = buflist->bs_children[i]; if (!DOINGSOFTDEP(vp)) + /* + * The usual case is that a set of N-contiguous blocks + * that was just allocated has been replaced with a + * set of N+1-contiguous blocks. If they are marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the blocks were written + * earlier, but very uncommon. If the blocks have never + * been written, there is no need to send a BIO_DELETE + * for them when they are freed. The gain from avoiding + * the TRIMs for the common case of unwritten blocks + * far exceeds the cost of the write amplification for + * the uncommon case of failing to send a TRIM for the + * blocks that had been written. + */ ffs_blkfree(ump, fs, ump->um_devvp, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), - fs->fs_bsize, ip->i_number, vp->v_type, NULL); - buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); + dbtofsb(fs, bp->b_blkno), + fs->fs_bsize, ip->i_number, vp->v_type, NULL, + (bp->b_flags & B_DELWRI) != 0 ? + NOTRIM_KEY : SINGLETON_KEY); + bp->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS - if (!ffs_checkblk(ip, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize)) + if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif #ifdef DEBUG @@ -771,7 +801,7 @@ ffs_reallocblks_ufs2(ap) struct fs *fs; struct inode *ip; struct vnode *vp; - struct buf *sbp, *ebp; + struct buf *sbp, *ebp, *bp; ufs2_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; @@ -978,14 +1008,30 @@ ffs_reallocblks_ufs2(ap) printf("\n\tnew:"); #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { + bp = buflist->bs_children[i]; if (!DOINGSOFTDEP(vp)) + /* + * The usual case is that a set of N-contiguous blocks + * that was just allocated has been replaced with a + * set of N+1-contiguous blocks. If they are marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the blocks were written + * earlier, but very uncommon. If the blocks have never + * been written, there is no need to send a BIO_DELETE + * for them when they are freed. The gain from avoiding + * the TRIMs for the common case of unwritten blocks + * far exceeds the cost of the write amplification for + * the uncommon case of failing to send a TRIM for the + * blocks that had been written. + */ ffs_blkfree(ump, fs, ump->um_devvp, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), - fs->fs_bsize, ip->i_number, vp->v_type, NULL); - buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); + dbtofsb(fs, bp->b_blkno), + fs->fs_bsize, ip->i_number, vp->v_type, NULL, + (bp->b_flags & B_DELWRI) != 0 ? + NOTRIM_KEY : SINGLETON_KEY); + bp->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS - if (!ffs_checkblk(ip, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize)) + if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif #ifdef DEBUG @@ -1823,8 +1869,7 @@ gotit: /* XXX Fixme. */ UFS_UNLOCK(ump); if (DOINGSOFTDEP(ITOV(ip))) - softdep_setup_blkmapdep(bp, UFSTOVFS(ump), blkno, - size, 0); + softdep_setup_blkmapdep(bp, UFSTOVFS(ump), blkno, size, 0); UFS_LOCK(ump); return (blkno); } @@ -2254,6 +2299,17 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) bdwrite(bp); } +/* + * Structures and routines associated with trim management. + */ +MALLOC_DEFINE(M_TRIM, "ufs_trim", "UFS trim structures"); + +#define TRIMLIST_HASH(ump, key) \ + (&(ump)->um_trimhash[(key) & (ump)->um_trimlisthashsize]) + +static void ffs_blkfree_trim_completed(struct buf *); +static void ffs_blkfree_trim_task(void *ctx, int pending __unused); + struct ffs_blkfree_trim_params { struct task task; struct ufsmount *ump; @@ -2277,7 +2333,7 @@ ffs_blkfree_trim_task(ctx, pending) tp->inum, tp->pdephd); vn_finished_secondary_write(UFSTOVFS(tp->ump)); atomic_add_int(&tp->ump->um_trim_inflight, -1); - free(tp, M_TEMP); + free(tp, M_TRIM); } static void @@ -2287,14 +2343,46 @@ ffs_blkfree_trim_completed(bp) struct ffs_blkfree_trim_params *tp; tp = bp->b_fsprivate1; - free(bp, M_TEMP); + free(bp, M_TRIM); TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); taskqueue_enqueue(tp->ump->um_trim_tq, &tp->task); } +/* + * Allocate a new key to use to identify a range of blocks. + */ +u_long +ffs_blkrelease_start(ump, devvp, inum) + struct ufsmount *ump; + struct vnode *devvp; + ino_t inum; +{ + static u_long masterkey; + u_long key; + + if ((ump->um_flags & UM_CANDELETE) == 0) + return (SINGLETON_KEY); + do { + key = atomic_fetchadd_long(&masterkey, 1); + } while (key < FIRST_VALID_KEY); + return (key); +} + +/* + * Deallocate a key that has been used to identify a range of blocks. + */ void -ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd) +ffs_blkrelease_finish(ump, key) struct ufsmount *ump; + u_long key; +{ + + return; +} + +void +ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd, key) + struct ufsmount *ump; struct fs *fs; struct vnode *devvp; ufs2_daddr_t bno; @@ -2302,6 +2390,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de ino_t inum; enum vtype vtype; struct workhead *dephd; + u_long key; { struct mount *mp; struct buf *bp; @@ -2319,10 +2408,11 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de return; } /* - * Nothing to delay if TRIM is disabled, or the operation is - * performed on the snapshot. + * Nothing to delay if TRIM is not required for this block or TRIM + * is disabled or the operation is performed on a snapshot. */ - if (((ump->um_flags) & UM_CANDELETE) == 0 || devvp->v_type == VREG) { + if (key == NOTRIM_KEY || ((ump->um_flags & UM_CANDELETE) == 0) || + devvp->v_type == VREG) { ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd); return; } @@ -2334,7 +2424,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de * and write some new data into it. */ atomic_add_int(&ump->um_trim_inflight, 1); - tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TEMP, M_WAITOK); + tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TRIM, M_WAITOK); tp->ump = ump; tp->devvp = devvp; tp->bno = bno; @@ -2347,7 +2437,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de } else tp->pdephd = NULL; - bp = malloc(sizeof(*bp), M_TEMP, M_WAITOK | M_ZERO); + bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO); bp->b_iocmd = BIO_DELETE; bp->b_iooffset = dbtob(fsbtodb(fs, bno)); bp->b_iodone = ffs_blkfree_trim_completed; @@ -2822,6 +2912,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) struct fs *fs; ufs2_daddr_t blkno; long blkcnt, blksize; + u_long key; struct file *fp, *vfp; cap_rights_t rights; int filetype, error; @@ -2956,15 +3047,18 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) blkno = cmd.value; blkcnt = cmd.size; blksize = fs->fs_frag - (blkno % fs->fs_frag); + key = ffs_blkrelease_start(ump, ump->um_devvp, UFS_ROOTINO); while (blkcnt > 0) { - if (blksize > blkcnt) + if (blkcnt < blksize) blksize = blkcnt; ffs_blkfree(ump, fs, ump->um_devvp, blkno, - blksize * fs->fs_fsize, UFS_ROOTINO, VDIR, NULL); + blksize * fs->fs_fsize, UFS_ROOTINO, + VDIR, NULL, key); blkno += blksize; blkcnt -= blksize; blksize = fs->fs_frag; } + ffs_blkrelease_finish(ump, key); break; /* Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Sat Aug 18 22:07:48 2018 (r338030) +++ head/sys/ufs/ffs/ffs_balloc.c Sat Aug 18 22:21:59 2018 (r338031) @@ -553,7 +553,7 @@ fail: lbns_remfree++; #endif ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, SINGLETON_KEY); } return (error); } @@ -1147,7 +1147,7 @@ fail: lbns_remfree++; #endif ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, SINGLETON_KEY); } return (error); } Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Sat Aug 18 22:07:48 2018 (r338030) +++ head/sys/ufs/ffs/ffs_extern.h Sat Aug 18 22:21:59 2018 (r338031) @@ -63,9 +63,11 @@ int ffs_balloc_ufs2(struct vnode *a_vp, off_t a_starto struct ucred *a_cred, int a_flags, struct buf **a_bpp); int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **); void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *, - ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *); + ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *, u_long); ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *); ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *); +void ffs_blkrelease_finish(struct ufsmount *, u_long); +u_long ffs_blkrelease_start(struct ufsmount *, struct vnode *, ino_t); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); void ffs_clrblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_clusteracct(struct fs *, struct cg *, ufs1_daddr_t, int); @@ -111,10 +113,26 @@ vfs_vget_t ffs_vget; int ffs_vgetf(struct mount *, ino_t, int, struct vnode **, int); void process_deferred_inactive(struct mount *mp); +/* + * Flags to ffs_vgetf + */ #define FFSV_FORCEINSMQ 0x0001 +/* + * Flags to ffs_reload + */ #define FFSR_FORCE 0x0001 #define FFSR_UNSUSPEND 0x0002 + +/* + * Definitions for TRIM interface + * + * Special keys and recommended hash table size + */ +#define NOTRIM_KEY 1 /* never written, so don't call trim for it */ +#define SINGLETON_KEY 2 /* only block being freed, so trim it now */ +#define FIRST_VALID_KEY 3 /* first valid key describing a block range */ +#define MAXTRIMIO 1024 /* maximum expected outstanding trim requests */ extern struct vop_vector ffs_vnodeops1; extern struct vop_vector ffs_fifoops1; Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Sat Aug 18 22:07:48 2018 (r338030) +++ head/sys/ufs/ffs/ffs_inode.c Sat Aug 18 22:21:59 2018 (r338031) @@ -197,6 +197,7 @@ ffs_truncate(vp, length, flags, cred) int needextclean, extblocks; int offset, size, level, nblocks; int i, error, allerror, indiroff, waitforupdate; + u_long key; off_t osize; ip = VTOI(vp); @@ -275,7 +276,7 @@ ffs_truncate(vp, length, flags, cred) continue; ffs_blkfree(ump, fs, ITODEVVP(ip), oldblks[i], sblksize(fs, osize, i), ip->i_number, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON_KEY); } } } @@ -523,7 +524,7 @@ ffs_truncate(vp, length, flags, cred) DIP_SET(ip, i_ib[level], 0); ffs_blkfree(ump, fs, ump->um_devvp, bn, fs->fs_bsize, ip->i_number, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON_KEY); blocksreleased += nblocks; } } @@ -534,6 +535,7 @@ ffs_truncate(vp, length, flags, cred) /* * All whole direct blocks or frags. */ + key = ffs_blkrelease_start(ump, ump->um_devvp, ip->i_number); for (i = UFS_NDADDR - 1; i > lastblock; i--) { long bsize; @@ -543,9 +545,10 @@ ffs_truncate(vp, length, flags, cred) DIP_SET(ip, i_db[i], 0); bsize = blksize(fs, ip, i); ffs_blkfree(ump, fs, ump->um_devvp, bn, bsize, ip->i_number, - vp->v_type, NULL); + vp->v_type, NULL, key); blocksreleased += btodb(bsize); } + ffs_blkrelease_finish(ump, key); if (lastblock < 0) goto done; @@ -575,7 +578,8 @@ ffs_truncate(vp, length, flags, cred) */ bn += numfrags(fs, newspace); ffs_blkfree(ump, fs, ump->um_devvp, bn, - oldspace - newspace, ip->i_number, vp->v_type, NULL); + oldspace - newspace, ip->i_number, vp->v_type, + NULL, SINGLETON_KEY); blocksreleased += btodb(oldspace - newspace); } } @@ -634,8 +638,10 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) { struct buf *bp; struct fs *fs; + struct ufsmount *ump; struct vnode *vp; caddr_t copy = NULL; + u_long key; int i, nblocks, error = 0, allerror = 0; ufs2_daddr_t nb, nlbn, last; ufs2_daddr_t blkcount, factor, blocksreleased = 0; @@ -644,6 +650,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) #define BAP(ip, i) (I_IS_UFS1(ip) ? bap1[i] : bap2[i]) fs = ITOFS(ip); + ump = ITOUMP(ip); /* * Calculate index in current block of last @@ -719,6 +726,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) /* * Recursively free totally unused blocks. */ + key = ffs_blkrelease_start(ump, ITODEVVP(ip), ip->i_number); for (i = NINDIR(fs) - 1, nlbn = lbn + 1 - i * factor; i > last; i--, nlbn += factor) { nb = BAP(ip, i); @@ -730,10 +738,11 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) allerror = error; blocksreleased += blkcount; } - ffs_blkfree(ITOUMP(ip), fs, ITODEVVP(ip), nb, fs->fs_bsize, - ip->i_number, vp->v_type, NULL); + ffs_blkfree(ump, fs, ITODEVVP(ip), nb, fs->fs_bsize, + ip->i_number, vp->v_type, NULL, key); blocksreleased += nblocks; } + ffs_blkrelease_finish(ump, key); /* * Recursively free last partial block. Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sat Aug 18 22:07:48 2018 (r338030) +++ head/sys/ufs/ffs/ffs_snapshot.c Sat Aug 18 22:21:59 2018 (r338031) @@ -583,7 +583,7 @@ loop: if (len != 0 && len < fs->fs_bsize) { ffs_blkfree(ump, copy_fs, vp, DIP(xp, i_db[loc]), len, xp->i_number, - xvp->v_type, NULL); + xvp->v_type, NULL, SINGLETON_KEY); blkno = DIP(xp, i_db[loc]); DIP_SET(xp, i_db[loc], 0); } @@ -1265,7 +1265,7 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expung if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON_KEY); } return (0); } @@ -1549,7 +1549,7 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expung if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON_KEY); } return (0); } Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Aug 18 22:07:48 2018 (r338030) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Aug 18 22:21:59 2018 (r338031) @@ -869,7 +869,7 @@ static void cancel_allocdirect(struct allocdirectlst * struct allocdirect *, struct freeblks *); static int check_inode_unwritten(struct inodedep *); static int free_inodedep(struct inodedep *); -static void freework_freeblock(struct freework *); +static void freework_freeblock(struct freework *, u_long); static void freework_enqueue(struct freework *); static int handle_workitem_freeblocks(struct freeblks *, int); static int handle_complete_freeblocks(struct freeblks *, int); @@ -884,7 +884,7 @@ static struct allocindir *newallocindir(struct inode * ufs2_daddr_t, ufs_lbn_t); static void handle_workitem_freefrag(struct freefrag *); static struct freefrag *newfreefrag(struct inode *, ufs2_daddr_t, long, - ufs_lbn_t); + ufs_lbn_t, u_long); static void allocdirect_merge(struct allocdirectlst *, struct allocdirect *, struct allocdirect *); static struct freefrag *allocindir_merge(struct allocindir *, @@ -5289,7 +5289,22 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, KASSERT(MOUNTEDSOFTDEP(mp) != 0, ("softdep_setup_allocdirect called on non-softdep filesystem")); if (oldblkno && oldblkno != newblkno) - freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); + /* + * The usual case is that a smaller fragment that + * was just allocated has been replaced with a bigger + * fragment or a full-size block. If it is marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the block was written + * earlier, but very uncommon. If the block has never + * been written, there is no need to send a BIO_DELETE + * for it when it is freed. The gain from avoiding the + * TRIMs for the common case of unwritten blocks far + * exceeds the cost of the write amplification for the + * uncommon case of failing to send a TRIM for a block + * that had been written. + */ + freefrag = newfreefrag(ip, oldblkno, oldsize, lbn, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM_KEY : SINGLETON_KEY); else freefrag = NULL; @@ -5566,11 +5581,12 @@ newjfreefrag(freefrag, ip, blkno, size, lbn) * Allocate a new freefrag structure. */ static struct freefrag * -newfreefrag(ip, blkno, size, lbn) +newfreefrag(ip, blkno, size, lbn, key) struct inode *ip; ufs2_daddr_t blkno; long size; ufs_lbn_t lbn; + u_long key; { struct freefrag *freefrag; struct ufsmount *ump; @@ -5591,6 +5607,7 @@ newfreefrag(ip, blkno, size, lbn) freefrag->ff_vtype = ITOV(ip)->v_type; freefrag->ff_blkno = blkno; freefrag->ff_fragsize = size; + freefrag->ff_key = key; if (MOUNTEDSUJ(UFSTOVFS(ump))) { freefrag->ff_jdep = (struct worklist *) @@ -5636,7 +5653,8 @@ handle_workitem_freefrag(freefrag) } FREE_LOCK(ump); ffs_blkfree(ump, ump->um_fs, ump->um_devvp, freefrag->ff_blkno, - freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd); + freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, + &wkhd, freefrag->ff_key); ACQUIRE_LOCK(ump); WORKITEM_FREE(freefrag, D_FREEFRAG); FREE_LOCK(ump); @@ -5676,7 +5694,22 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, ne lbn = bp->b_lblkno; if (oldblkno && oldblkno != newblkno) - freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); + /* + * The usual case is that a smaller fragment that + * was just allocated has been replaced with a bigger + * fragment or a full-size block. If it is marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the block was written + * earlier, but very uncommon. If the block has never + * been written, there is no need to send a BIO_DELETE + * for it when it is freed. The gain from avoiding the + * TRIMs for the common case of unwritten blocks far + * exceeds the cost of the write amplification for the + * uncommon case of failing to send a TRIM for a block + * that had been written. + */ + freefrag = newfreefrag(ip, oldblkno, oldsize, lbn, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM_KEY : SINGLETON_KEY); else freefrag = NULL; @@ -5789,7 +5822,8 @@ newallocindir(ip, ptrno, newblkno, oldblkno, lbn) struct jnewblk *jnewblk; if (oldblkno) - freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn); + freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn, + SINGLETON_KEY); else freefrag = NULL; ACQUIRE_LOCK(ITOUMP(ip)); @@ -7724,8 +7758,9 @@ free_inodedep(inodedep) * in memory immediately. */ static void -freework_freeblock(freework) +freework_freeblock(freework, key) struct freework *freework; + u_long key; { struct freeblks *freeblks; struct jnewblk *jnewblk; @@ -7779,10 +7814,10 @@ freework_freeblock(freework) FREE_LOCK(ump); freeblks_free(ump, freeblks, btodb(bsize)); CTR4(KTR_SUJ, - "freework_freeblock: ino %d blkno %jd lbn %jd size %ld", + "freework_freeblock: ino %jd blkno %jd lbn %jd size %d", freeblks->fb_inum, freework->fw_blkno, freework->fw_lbn, bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno, bsize, - freeblks->fb_inum, freeblks->fb_vtype, &wkhd); + freeblks->fb_inum, freeblks->fb_vtype, &wkhd, key); ACQUIRE_LOCK(ump); /* * The jnewblk will be discarded and the bits in the map never @@ -7835,7 +7870,7 @@ handle_workitem_indirblk(freework) return; } if (freework->fw_off == NINDIR(fs)) { - freework_freeblock(freework); + freework_freeblock(freework, SINGLETON_KEY); return; } freework->fw_state |= INPROGRESS; @@ -7894,10 +7929,12 @@ handle_workitem_freeblocks(freeblks, flags) struct allocindir *aip; struct ufsmount *ump; struct worklist *wk; + u_long key; KASSERT(LIST_EMPTY(&freeblks->fb_jblkdephd), ("handle_workitem_freeblocks: Journal entries not written.")); ump = VFSTOUFS(freeblks->fb_list.wk_mp); + key = ffs_blkrelease_start(ump, freeblks->fb_devvp, freeblks->fb_inum); ACQUIRE_LOCK(ump); while ((wk = LIST_FIRST(&freeblks->fb_freeworkhd)) != NULL) { WORKLIST_REMOVE(wk); @@ -7935,7 +7972,7 @@ handle_workitem_freeblocks(freeblks, flags) if (freework->fw_lbn <= -UFS_NDADDR) handle_workitem_indirblk(freework); else - freework_freeblock(freework); + freework_freeblock(freework, key); continue; default: panic("handle_workitem_freeblocks: Unknown type %s", @@ -7948,6 +7985,7 @@ handle_workitem_freeblocks(freeblks, flags) freeblks = NULL; } FREE_LOCK(ump); + ffs_blkrelease_finish(ump, key); if (freeblks) return handle_complete_freeblocks(freeblks, flags); return (0); @@ -8080,13 +8118,9 @@ indir_trunc(freework, dbn, lbn) ufs1_daddr_t *bap1; ufs2_daddr_t nb, nnb, *bap2; ufs_lbn_t lbnadd, nlbn; - int i, nblocks, ufs1fmt; - int freedblocks; - int goingaway; - int freedeps; - int needj; - int level; - int cnt; + u_long key; + int nblocks, ufs1fmt, freedblocks; + int goingaway, freedeps, needj, level, cnt, i; freeblks = freework->fw_freeblks; ump = VFSTOUFS(freeblks->fb_list.wk_mp); @@ -8180,6 +8214,7 @@ indir_trunc(freework, dbn, lbn) * arranges for the current level to be freed when subordinates * are free when journaling. */ + key = ffs_blkrelease_start(ump, freeblks->fb_devvp, freeblks->fb_inum); for (i = freework->fw_off; i < NINDIR(fs); i++, nb = nnb) { if (i != NINDIR(fs) - 1) { if (ufs1fmt) @@ -8215,13 +8250,14 @@ indir_trunc(freework, dbn, lbn) freedeps++; } CTR3(KTR_SUJ, - "indir_trunc: ino %d blkno %jd size %ld", + "indir_trunc: ino %jd blkno %jd size %d", freeblks->fb_inum, nb, fs->fs_bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, nb, fs->fs_bsize, freeblks->fb_inum, - freeblks->fb_vtype, &wkhd); + freeblks->fb_vtype, &wkhd, key); } } + ffs_blkrelease_finish(ump, key); if (goingaway) { bp->b_flags |= B_INVAL | B_NOCACHE; brelse(bp); @@ -8244,7 +8280,7 @@ indir_trunc(freework, dbn, lbn) if (level == 0) freeblks->fb_cgwait += freedeps; if (freework->fw_ref == 0) - freework_freeblock(freework); + freework_freeblock(freework, SINGLETON_KEY); FREE_LOCK(ump); return; } @@ -8253,10 +8289,10 @@ indir_trunc(freework, dbn, lbn) */ dbn = dbtofsb(fs, dbn); CTR3(KTR_SUJ, - "indir_trunc 2: ino %d blkno %jd size %ld", + "indir_trunc 2: ino %jd blkno %jd size %d", freeblks->fb_inum, dbn, fs->fs_bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, dbn, fs->fs_bsize, - freeblks->fb_inum, freeblks->fb_vtype, NULL); + freeblks->fb_inum, freeblks->fb_vtype, NULL, SINGLETON_KEY); /* Non SUJ softdep does single-threaded truncations. */ if (freework->fw_blkno == dbn) { freework->fw_state |= ALLCOMPLETE; Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat Aug 18 22:07:48 2018 (r338030) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat Aug 18 22:21:59 2018 (r338031) @@ -978,6 +978,8 @@ ffs_mountfs(devvp, mp, td) taskqueue_thread_enqueue, &ump->um_trim_tq); taskqueue_start_threads(&ump->um_trim_tq, 1, PVFS, "%s trim", mp->mnt_stat.f_mntonname); + ump->um_trimhash = hashinit(MAXTRIMIO, M_TRIM, + &ump->um_trimlisthashsize); } } @@ -1256,6 +1258,7 @@ ffs_unmount(mp, mntflags) pause("ufsutr", hz); taskqueue_drain_all(ump->um_trim_tq); taskqueue_free(ump->um_trim_tq); + free (ump->um_trimhash, M_TRIM); } g_topology_lock(); if (ump->um_fsckpid > 0) { Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Sat Aug 18 22:07:48 2018 (r338030) +++ head/sys/ufs/ffs/softdep.h Sat Aug 18 22:21:59 2018 (r338031) @@ -557,6 +557,7 @@ struct freefrag { long ff_fragsize; /* size of fragment being deleted */ ino_t ff_inum; /* owning inode number */ enum vtype ff_vtype; /* owning inode's file type */ + int ff_key; /* trim key when deleted */ }; /* Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Sat Aug 18 22:07:48 2018 (r338030) +++ head/sys/ufs/ufs/ufsmount.h Sat Aug 18 22:21:59 2018 (r338031) @@ -47,6 +47,7 @@ struct ufs_args { #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_UFSMNT); +MALLOC_DECLARE(M_TRIM); #endif struct buf; @@ -63,6 +64,7 @@ struct inodedep; TAILQ_HEAD(inodedeplst, inodedep); LIST_HEAD(bmsafemaphd, bmsafemap); +LIST_HEAD(trimlist_hashhead, ffs_blkfree_trim_params); /* * This structure describes the UFS specific mount structure data. @@ -70,7 +72,6 @@ LIST_HEAD(bmsafemaphd, bmsafemap); * UFS (UFS1, UFS2, etc). * * Lock reference: - * a - atomic operations * c - set at allocation then constant until freed * i - ufsmount interlock (UFS_LOCK / UFS_UNLOCK) * q - associated quota file is locked @@ -99,8 +100,13 @@ struct ufsmount { char um_qflags[MAXQUOTAS]; /* (i) quota specific flags */ int64_t um_savedmaxfilesize; /* (c) track maxfilesize */ u_int um_flags; /* (i) filesystem flags */ - u_int um_trim_inflight; /* (a) outstanding trim count */ + u_int um_trim_inflight; /* (i) outstanding trim count */ + u_int um_trim_inflight_blks; /* (i) outstanding trim blks */ + u_long um_trim_total; /* (i) total trim count */ + u_long um_trim_total_blks; /* (i) total trim block count */ struct taskqueue *um_trim_tq; /* (c) trim request queue */ + struct trimlist_hashhead *um_trimhash; /* (i) trimlist hash table */ + u_long um_trimlisthashsize; /* (i) trim hash table size-1 */ /* (c) - below function ptrs */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); From owner-svn-src-all@freebsd.org Sat Aug 18 22:35: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 C56391077DFB; Sat, 18 Aug 2018 22:35:21 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B4397A3D8; Sat, 18 Aug 2018 22:35:21 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 587C51DB55; Sat, 18 Aug 2018 22:35:21 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IMZLT4066360; Sat, 18 Aug 2018 22:35:21 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IMZJob066354; Sat, 18 Aug 2018 22:35:19 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201808182235.w7IMZJob066354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 18 Aug 2018 22:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338032 - in head/sys: arm/arm arm64/arm64 dev/agp mips/mips X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 dev/agp mips/mips X-SVN-Commit-Revision: 338032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 22:35:22 -0000 Author: alc Date: Sat Aug 18 22:35:19 2018 New Revision: 338032 URL: https://svnweb.freebsd.org/changeset/base/338032 Log: Oops. r338030 didn't eliminate the unused arena argument from all of kmem_alloc_attr()'s callers. Correct that mistake. Modified: head/sys/arm/arm/busdma_machdep-v4.c head/sys/arm/arm/busdma_machdep-v6.c head/sys/arm/arm/pmap-v6.c head/sys/arm64/arm64/busdma_bounce.c head/sys/dev/agp/agp_amd.c head/sys/dev/agp/agp_ati.c head/sys/mips/mips/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep-v4.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v4.c Sat Aug 18 22:21:59 2018 (r338031) +++ head/sys/arm/arm/busdma_machdep-v4.c Sat Aug 18 22:35:19 2018 (r338032) @@ -747,8 +747,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int howmany(dmat->maxsize, MIN(dmat->maxsegsz, PAGE_SIZE)) && dmat->alignment <= PAGE_SIZE && (dmat->boundary % PAGE_SIZE) == 0) { - *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->maxsize, - mflags, 0, dmat->lowaddr, memattr); + *vaddr = (void *)kmem_alloc_attr(dmat->maxsize, mflags, 0, + dmat->lowaddr, memattr); } else { *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->maxsize, mflags, 0, dmat->lowaddr, dmat->alignment, dmat->boundary, Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sat Aug 18 22:21:59 2018 (r338031) +++ head/sys/arm/arm/busdma_machdep-v6.c Sat Aug 18 22:35:19 2018 (r338032) @@ -812,8 +812,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int howmany(dmat->maxsize, MIN(dmat->maxsegsz, PAGE_SIZE)) && dmat->alignment <= PAGE_SIZE && (dmat->boundary % PAGE_SIZE) == 0) { - *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->maxsize, - mflags, 0, dmat->lowaddr, memattr); + *vaddr = (void *)kmem_alloc_attr(dmat->maxsize, mflags, 0, + dmat->lowaddr, memattr); } else { *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->maxsize, mflags, 0, dmat->lowaddr, dmat->alignment, dmat->boundary, Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Aug 18 22:21:59 2018 (r338031) +++ head/sys/arm/arm/pmap-v6.c Sat Aug 18 22:35:19 2018 (r338032) @@ -2236,8 +2236,8 @@ pmap_pinit(pmap_t pmap) * be used no matter which process is current. Its mapping * in PT2MAP can be used only for current process. */ - pmap->pm_pt2tab = (pt2_entry_t *)kmem_alloc_attr(kernel_arena, - NB_IN_PT2TAB, M_NOWAIT | M_ZERO, 0, -1UL, pt_memattr); + pmap->pm_pt2tab = (pt2_entry_t *)kmem_alloc_attr(NB_IN_PT2TAB, + M_NOWAIT | M_ZERO, 0, -1UL, pt_memattr); if (pmap->pm_pt2tab == NULL) { /* * QQQ: As struct pmap is allocated from UMA with Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Sat Aug 18 22:21:59 2018 (r338031) +++ head/sys/arm64/arm64/busdma_bounce.c Sat Aug 18 22:35:19 2018 (r338032) @@ -491,9 +491,8 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad dmat->common.alignment <= PAGE_SIZE && (dmat->common.boundary % PAGE_SIZE) == 0) { /* Page-based multi-segment allocations allowed */ - *vaddr = (void *)kmem_alloc_attr(kernel_arena, - dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, - attr); + *vaddr = (void *)kmem_alloc_attr(dmat->common.maxsize, mflags, + 0ul, dmat->common.lowaddr, attr); dmat->bounce_flags |= BF_KMEM_ALLOC; } else { *vaddr = (void *)kmem_alloc_contig(kernel_arena, Modified: head/sys/dev/agp/agp_amd.c ============================================================================== --- head/sys/dev/agp/agp_amd.c Sat Aug 18 22:21:59 2018 (r338031) +++ head/sys/dev/agp/agp_amd.c Sat Aug 18 22:35:19 2018 (r338032) @@ -101,9 +101,8 @@ agp_amd_alloc_gatt(device_t dev) * directory. */ gatt->ag_entries = entries; - gatt->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, - entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, - VM_MEMATTR_WRITE_COMBINING); + gatt->ag_virtual = (void *)kmem_alloc_attr(entries * sizeof(u_int32_t), + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_virtual) { if (bootverbose) device_printf(dev, "allocation failed\n"); @@ -114,8 +113,8 @@ agp_amd_alloc_gatt(device_t dev) /* * Allocate the page directory. */ - gatt->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, - M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); + gatt->ag_vdir = (void *)kmem_alloc_attr(AGP_PAGE_SIZE, M_NOWAIT | + M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_vdir) { if (bootverbose) device_printf(dev, Modified: head/sys/dev/agp/agp_ati.c ============================================================================== --- head/sys/dev/agp/agp_ati.c Sat Aug 18 22:21:59 2018 (r338031) +++ head/sys/dev/agp/agp_ati.c Sat Aug 18 22:35:19 2018 (r338032) @@ -133,9 +133,8 @@ agp_ati_alloc_gatt(device_t dev) /* Alloc the GATT -- pointers to pages of AGP memory */ sc->ag_entries = entries; - sc->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, - entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, - VM_MEMATTR_WRITE_COMBINING); + sc->ag_virtual = (void *)kmem_alloc_attr(entries * sizeof(u_int32_t), + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (sc->ag_virtual == NULL) { if (bootverbose) device_printf(dev, "GATT allocation failed\n"); @@ -143,8 +142,8 @@ agp_ati_alloc_gatt(device_t dev) } /* Alloc the page directory -- pointers to each page of the GATT */ - sc->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, - M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); + sc->ag_vdir = (void *)kmem_alloc_attr(AGP_PAGE_SIZE, M_NOWAIT | M_ZERO, + 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (sc->ag_vdir == NULL) { if (bootverbose) device_printf(dev, "pagedir allocation failed\n"); Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Sat Aug 18 22:21:59 2018 (r338031) +++ head/sys/mips/mips/busdma_machdep.c Sat Aug 18 22:35:19 2018 (r338032) @@ -714,8 +714,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddrp, in howmany(dmat->maxsize, MIN(dmat->maxsegsz, PAGE_SIZE)) && dmat->alignment <= PAGE_SIZE && (dmat->boundary % PAGE_SIZE) == 0) { - vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->maxsize, - mflags, 0, dmat->lowaddr, memattr); + vaddr = (void *)kmem_alloc_attr(dmat->maxsize, mflags, 0, + dmat->lowaddr, memattr); } else { vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->maxsize, mflags, 0, dmat->lowaddr, dmat->alignment, dmat->boundary, From owner-svn-src-all@freebsd.org Sat Aug 18 23:24: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 3C3FC1078DA5; Sat, 18 Aug 2018 23:24:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D146D7B807; Sat, 18 Aug 2018 23:24:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC6EF1E36D; Sat, 18 Aug 2018 23:24:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7INOkFn091428; Sat, 18 Aug 2018 23:24:46 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7INOkVB091427; Sat, 18 Aug 2018 23:24:46 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201808182324.w7INOkVB091427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 18 Aug 2018 23:24:46 +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: r338033 - stable/11/contrib/libarchive/libarchive X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: stable/11/contrib/libarchive/libarchive X-SVN-Commit-Revision: 338033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 23:24:47 -0000 Author: mm Date: Sat Aug 18 23:24:46 2018 New Revision: 338033 URL: https://svnweb.freebsd.org/changeset/base/338033 Log: MFH r337745: Sync libarchive with vendor.. Vendor changes: PR #1042: validate iso9660 directory record length MFC after: 3 days Security: CVE-2017-14501 Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Sat Aug 18 22:35:19 2018 (r338032) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Sat Aug 18 23:24:46 2018 (r338033) @@ -409,7 +409,8 @@ static int next_entry_seek(struct archive_read *, stru struct file_info **); static struct file_info * parse_file_info(struct archive_read *a, - struct file_info *parent, const unsigned char *isodirrec); + struct file_info *parent, const unsigned char *isodirrec, + size_t reclen); static int parse_rockridge(struct archive_read *a, struct file_info *file, const unsigned char *start, const unsigned char *end); @@ -1022,7 +1023,7 @@ read_children(struct archive_read *a, struct file_info if (*(p + DR_name_len_offset) == 1 && *(p + DR_name_offset) == '\001') continue; - child = parse_file_info(a, parent, p); + child = parse_file_info(a, parent, p, b - p); if (child == NULL) { __archive_read_consume(a, skip_size); return (ARCHIVE_FATAL); @@ -1112,7 +1113,7 @@ choose_volume(struct archive_read *a, struct iso9660 * */ seenJoliet = iso9660->seenJoliet;/* Save flag. */ iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); + file = parse_file_info(a, NULL, block, vd->size); if (file == NULL) return (ARCHIVE_FATAL); iso9660->seenJoliet = seenJoliet; @@ -1144,7 +1145,7 @@ choose_volume(struct archive_read *a, struct iso9660 * return (ARCHIVE_FATAL); } iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); + file = parse_file_info(a, NULL, block, vd->size); if (file == NULL) return (ARCHIVE_FATAL); iso9660->seenJoliet = seenJoliet; @@ -1749,7 +1750,7 @@ archive_read_format_iso9660_cleanup(struct archive_rea */ static struct file_info * parse_file_info(struct archive_read *a, struct file_info *parent, - const unsigned char *isodirrec) + const unsigned char *isodirrec, size_t reclen) { struct iso9660 *iso9660; struct file_info *file, *filep; @@ -1763,16 +1764,20 @@ parse_file_info(struct archive_read *a, struct file_in iso9660 = (struct iso9660 *)(a->format->data); - dr_len = (size_t)isodirrec[DR_length_offset]; - name_len = (size_t)isodirrec[DR_name_len_offset]; - location = archive_le32dec(isodirrec + DR_extent_offset); - fsize = toi(isodirrec + DR_size_offset, DR_size_size); - /* Sanity check that dr_len needs at least 34. */ - if (dr_len < 34) { + if (reclen != 0) + dr_len = (size_t)isodirrec[DR_length_offset]; + /* + * Sanity check that reclen is not zero and dr_len is greater than + * reclen but at least 34 + */ + if (reclen == 0 || reclen < dr_len || dr_len < 34) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Invalid length of directory record"); + "Invalid length of directory record"); return (NULL); } + name_len = (size_t)isodirrec[DR_name_len_offset]; + location = archive_le32dec(isodirrec + DR_extent_offset); + fsize = toi(isodirrec + DR_size_offset, DR_size_size); /* Sanity check that name_len doesn't exceed dr_len. */ if (dr_len - 33 < name_len || name_len == 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, From owner-svn-src-all@freebsd.org Sat Aug 18 23:24:56 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 6F6B71078DD9; Sat, 18 Aug 2018 23:24:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A7737B8F2; Sat, 18 Aug 2018 23:24:54 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CA851E36E; Sat, 18 Aug 2018 23:24:54 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7INOsO1091480; Sat, 18 Aug 2018 23:24:54 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7INOsnn091479; Sat, 18 Aug 2018 23:24:54 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201808182324.w7INOsnn091479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 18 Aug 2018 23:24:54 +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: r338034 - stable/10/contrib/libarchive/libarchive X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: stable/10/contrib/libarchive/libarchive X-SVN-Commit-Revision: 338034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2018 23:24:56 -0000 Author: mm Date: Sat Aug 18 23:24:53 2018 New Revision: 338034 URL: https://svnweb.freebsd.org/changeset/base/338034 Log: MFH r337745: Sync libarchive with vendor.. Vendor changes: PR #1042: validate iso9660 directory record length MFC after: 3 days Security: CVE-2017-14501 Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Sat Aug 18 23:24:46 2018 (r338033) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Sat Aug 18 23:24:53 2018 (r338034) @@ -409,7 +409,8 @@ static int next_entry_seek(struct archive_read *, stru struct file_info **); static struct file_info * parse_file_info(struct archive_read *a, - struct file_info *parent, const unsigned char *isodirrec); + struct file_info *parent, const unsigned char *isodirrec, + size_t reclen); static int parse_rockridge(struct archive_read *a, struct file_info *file, const unsigned char *start, const unsigned char *end); @@ -1022,7 +1023,7 @@ read_children(struct archive_read *a, struct file_info if (*(p + DR_name_len_offset) == 1 && *(p + DR_name_offset) == '\001') continue; - child = parse_file_info(a, parent, p); + child = parse_file_info(a, parent, p, b - p); if (child == NULL) { __archive_read_consume(a, skip_size); return (ARCHIVE_FATAL); @@ -1112,7 +1113,7 @@ choose_volume(struct archive_read *a, struct iso9660 * */ seenJoliet = iso9660->seenJoliet;/* Save flag. */ iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); + file = parse_file_info(a, NULL, block, vd->size); if (file == NULL) return (ARCHIVE_FATAL); iso9660->seenJoliet = seenJoliet; @@ -1144,7 +1145,7 @@ choose_volume(struct archive_read *a, struct iso9660 * return (ARCHIVE_FATAL); } iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); + file = parse_file_info(a, NULL, block, vd->size); if (file == NULL) return (ARCHIVE_FATAL); iso9660->seenJoliet = seenJoliet; @@ -1749,7 +1750,7 @@ archive_read_format_iso9660_cleanup(struct archive_rea */ static struct file_info * parse_file_info(struct archive_read *a, struct file_info *parent, - const unsigned char *isodirrec) + const unsigned char *isodirrec, size_t reclen) { struct iso9660 *iso9660; struct file_info *file, *filep; @@ -1763,16 +1764,20 @@ parse_file_info(struct archive_read *a, struct file_in iso9660 = (struct iso9660 *)(a->format->data); - dr_len = (size_t)isodirrec[DR_length_offset]; - name_len = (size_t)isodirrec[DR_name_len_offset]; - location = archive_le32dec(isodirrec + DR_extent_offset); - fsize = toi(isodirrec + DR_size_offset, DR_size_size); - /* Sanity check that dr_len needs at least 34. */ - if (dr_len < 34) { + if (reclen != 0) + dr_len = (size_t)isodirrec[DR_length_offset]; + /* + * Sanity check that reclen is not zero and dr_len is greater than + * reclen but at least 34 + */ + if (reclen == 0 || reclen < dr_len || dr_len < 34) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Invalid length of directory record"); + "Invalid length of directory record"); return (NULL); } + name_len = (size_t)isodirrec[DR_name_len_offset]; + location = archive_le32dec(isodirrec + DR_extent_offset); + fsize = toi(isodirrec + DR_size_offset, DR_size_size); /* Sanity check that name_len doesn't exceed dr_len. */ if (dr_len - 33 < name_len || name_len == 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,